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:
parent
2e776f6b50
commit
c141fe1c44
@ -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
|
||||
===================================
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user