umask(0) in all binaries
jra at samba.org
Tue Nov 5 11:25:59 MST 2013
On Tue, Nov 05, 2013 at 08:55:57AM -0700, Christof Schmitt wrote:
> On Mon, Nov 04, 2013 at 04:54:31PM -0700, Christof Schmitt wrote:
> > On Mon, Nov 04, 2013 at 03:34:24PM -0800, Jeremy Allison wrote:
> > > On Mon, Nov 04, 2013 at 02:26:13PM -0700, Christof Schmitt wrote:
> > >
> > > > If we decide that only smbd, winbindd and nmbd should create those
> > > > directories in case they are missing: Wouldn't it be simpler to create
> > > > the directories directly during startup of those daemons, and remove the
> > > > if (!directory_exist(fname)) from xx_path?
> > >
> > > Yes, I would support that change.
> > Ok, here is my attempt on making that change. The first patch ensures
> > that the directories are only created during daemon startup, and the
> > second one adds checks against NULL pointers in codepaths that can be
> > reached from utility code.
> There is at least one case where the directories are needed before a
> daemon starts: net ads join is run before starting any daemons, and it
> tries to look up DC information from the gencache. I can try to change
Ah. Then the net ads join needs to be added to the list of
programs that create the directories (but only if euid == 0)
> the code that it returns NOT_FOUND without the cache directory. The
> question is if that is worth the effort, or if our code should expect
> that all required directories already exist, e.g. from the package
If we required install to create all the directories we could
remove all the create code from the xx_path code. Not everyone
installs from a package (although I'll grant you most people do :-)
so I think we just need to determine which programs need to
do the create and limit the creation code to them.
More information about the samba-technical