umask(0) in all binaries

Christof Schmitt cs at samba.org
Mon Nov 4 12:54:23 MST 2013


I have been chasing an issue where the permissions on /var/ctdb/samba
are set to 0700 instead of 0755. Commit 59462f2 "winbindd and nmbd don't
set their umask to zero on startup like smbd does." fixed this in case
the directory is created by winbindd or nmbd. Other binaries from
source3/utils will also call into cache_path() that will create the
directory through xx_path() in case it does not exist. Depending on the
umask of the caller, the permissions will be different than expected.

What is the best way to fix this? Call umask(0) from every main function
to ensure that we use the intended permissions?

Christof


More information about the samba-technical mailing list