diff options
author | Matt McCutchen <matt@mattmccutchen.net> | 2008-11-10 08:55:27 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2008-11-10 08:55:27 -0500 |
commit | 0314e701c812565bd7bdac548cadfea5d310d66c (patch) | |
tree | 4fb55231397367d68cfbfe8f30a238c56cfcfff6 /dbus/dbus-sysdeps-util-unix.c | |
parent | 14afa0564e9eea01d28d4b2fd1e6ac0bfec626e7 (diff) |
Bug 18446: Keep umask for session bus
Signed-off-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r-- | dbus/dbus-sysdeps-util-unix.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c index 0343a90c..d8718c21 100644 --- a/dbus/dbus-sysdeps-util-unix.c +++ b/dbus/dbus-sysdeps-util-unix.c @@ -69,12 +69,14 @@ * @param pidfile #NULL, or pidfile to create * @param print_pid_pipe pipe to print daemon's pid to, or -1 for none * @param error return location for errors + * @param keep_umask #TRUE to keep the original umask * @returns #FALSE on failure */ dbus_bool_t _dbus_become_daemon (const DBusString *pidfile, DBusPipe *print_pid_pipe, - DBusError *error) + DBusError *error, + dbus_bool_t keep_umask) { const char *s; pid_t child_pid; @@ -121,9 +123,12 @@ _dbus_become_daemon (const DBusString *pidfile, _dbus_verbose ("keeping stderr open due to DBUS_DEBUG_OUTPUT\n"); } - /* Get a predictable umask */ - _dbus_verbose ("setting umask\n"); - umask (022); + if (!keep_umask) + { + /* Get a predictable umask */ + _dbus_verbose ("setting umask\n"); + umask (022); + } _dbus_verbose ("calling setsid()\n"); if (setsid () == -1) |