avoid #ifdef ENABLE_SELFTEST (was: Re: Quota patches)

Andrew Bartlett abartlet at samba.org
Tue Jul 24 17:20:32 UTC 2018

On Tue, 2018-07-24 at 10:29 +0100, Noel Power via samba-technical
> Hi Jeremy
> I promised at sambaxp to bug you again with the quota patches for smb2
> (which also include some rewrite of the existing code to use idl). Aside
> from the fact we need to step away from SMB1 we have some customer
> interest in this. I hope you can find some time to have a look. I've
> rebased the patches (attached) against current master

Subject: [PATCH 11/12] s3/smbd: allow set quota for non root user (when
 with --enable-selftest)

Don't put #ifdef ENABLE_SELFTEST in the tree if at all possible.

sec_initial_uid() is used unconditionally elsewhere, and is designed to
allow us to run Samba non-root in some situations (which don't have to
be selftest). 

The only other user of ENABLE_SELFTEST in the .c code is to enable the
virtual line printer.

The reason we do that is that we want our selftest binaries to be as
close to our production binaries as possible, just possibly being
developer builds.  It isn't perfect, while socket_wrapper is LD_PRELOAD
these days, we have some tweaks that ensure stuff stays in the build
tree only (not in the installed tree), but in general.


Andrew Bartlett
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

More information about the samba-technical mailing list