From b529893b5a7f6f36dbceb5cd20f26f3f413beaa4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Jun 2013 17:25:41 -0700 Subject: [PATCH] winbindd and nmbd don't set their umask to zero on startup like smbd does. 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 --- source3/nmbd/nmbd.c | 4 ++++ source3/winbindd/winbindd.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 12afb00..7eb6e63 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -796,6 +796,10 @@ 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(); diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 7a0700d..fb43f17 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1323,6 +1323,10 @@ 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 -- 1.8.1.2