diff options
author | Yclept Nemo <orbisvicis@gmail.com> | 2012-07-18 07:58:11 +0200 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2012-07-18 08:00:32 +0200 |
commit | 26a694b1a18a92580d211ec2d18803af0ad05d99 (patch) | |
tree | dbf7417279be6155f3e30e412f47597910bb893e | |
parent | f61b94d12cb84a4929e19cde812f0a1423380b6a (diff) | |
download | gnome-keyring-26a694b1a18a92580d211ec2d18803af0ad05d99.tar.gz |
daemon: Use setsid() to become a process leader when daemonizing
* Fixes corner cases where people try to use gnome-keyring-daemon
from the console.
https://bugzilla.gnome.org/show_bug.cgi?id=679892
-rw-r--r-- | daemon/gkd-main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c index f081fb89..da71da79 100644 --- a/daemon/gkd-main.c +++ b/daemon/gkd-main.c @@ -679,6 +679,13 @@ fork_and_print_environment (void) if (run_daemonized) { + /* + * Become session leader of a new session, process group leader of a new + * process group, and detach from the controlling TTY, so that SIGHUP is + * not sent to this process when the previous session leader dies + */ + setsid (); + /* Double fork if need to daemonize properly */ pid = fork (); |