1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-10 05:18:36 +03:00

Avoid cookie sharing between forked processes

Before fork, ensure cookie is reset so it's not shared between processes.
This commit is contained in:
Zdenek Kabelac 2011-01-10 19:31:02 +00:00
parent 2e776f6b50
commit c141fe1c44
3 changed files with 5 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.81 -
===================================
Fix cookie sharing between forked lvm processes (2.02.80).
Version 2.02.80 - 10th January 2011
===================================

View File

@ -54,6 +54,8 @@ int exec_cmd(struct cmd_context *cmd, const char *const argv[], int *rstatus)
log_verbose("Executing: %s", _verbose_args(argv, buf, sizeof(buf)));
fs_unlock(); /* Flush oops and ensure cookie is not shared */
if ((pid = fork()) == -1) {
log_error("fork failed: %s", strerror(errno));
return 0;

View File

@ -42,6 +42,8 @@ static int _become_daemon(struct cmd_context *cmd)
sigaction(SIGCHLD, &act, NULL);
fs_unlock(); /* Flush oops and ensure cookie is not shared */
if ((pid = fork()) == -1) {
log_error("fork failed: %s", strerror(errno));
return -1;