On Mon, Feb 01, 2016 at 09:13:00PM +0100, Jérémie Courrèges-Anglas wrote: > Gleydson Soares <[email protected]> writes: > > > Hi Landry, > > > > On Sun, Jan 31, 2016 at 09:39:52AM +0100, Landry Breuil wrote: > >> Hi, > >> > >> i'm tinkering with ldapd and writing regress tests for it, and to > >> allow running independent instances (with separate port/control > >> socket/etc) i needed to add the possibility to specify an alternative > >> datadir, which was so far #defined in the code. > >> Patch is pretty simple and works fine, i'm open to suggestions of course > >> on a better wording for the manpage and option choose (i went for -r..) > >> okays welcome too ! > > > > slight tweak, > > looks like it is missing a chdir(3) to check failure if an > > invalid(nonexistent) > > datadir was passed to optarg. > > > > I just added these lines in ldapd.c: > > 159 if (datadir && chdir(datadir)) > > 160 err(1, "chdir"); > > Hum, while a check would be nicer, I prefer when daemons stick to /.
Thinking about it .. would a call to access(2) with R_OK|W_OK|R_OK|F_OK satisfy everyone ? Or only F_OK ? Landry
