winbindd and nmbd don't set their umask to zero on startup like smbd does.
authorJeremy Allison <jra@samba.org>
Tue, 18 Jun 2013 00:25:41 +0000 (17:25 -0700)
committerMichael Adam <obnox@samba.org>
Thu, 27 Jun 2013 00:02:24 +0000 (02:02 +0200)
Fix this - we already control tightly what permissions are
on the files we create. Ensure we don't get surprised.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jun 27 02:02:24 CEST 2013 on sn-devel-104

source3/nmbd/nmbd.c
source3/winbindd/winbindd.c

index 42e2b2f6ff918ebd89b00f8a44007aa325809ba6..ec0e7d098f00fcc32fbda3a7b746437bb8122248 100644 (file)
@@ -808,6 +808,12 @@ static bool open_sockets(bool isdaemon, int port)
        talloc_enable_null_tracking();
        frame = talloc_stackframe();
 
+       /*
+        * We want total control over the permissions on created files,
+        * so set our umask to 0.
+        */
+       umask(0);
+
        setup_logging(argv[0], DEBUG_DEFAULT_STDOUT);
 
        load_case_tables();
index 141ca5c7c56d662b85819d61753b66695b47f5c2..953e208e2a743d501d4cadd25d8a07adaa973ab2 100644 (file)
@@ -1336,6 +1336,12 @@ int main(int argc, char **argv, char **envp)
        talloc_enable_null_tracking();
        frame = talloc_stackframe();
 
+       /*
+        * We want total control over the permissions on created files,
+        * so set our umask to 0.
+        */
+       umask(0);
+
        setup_logging("winbindd", DEBUG_DEFAULT_STDOUT);
 
        /* glibc (?) likes to print "User defined signal 1" and exit if a