avoid #ifdef ENABLE_SELFTEST

Noel Power nopower at suse.com
Thu Jul 26 09:17:46 UTC 2018

Hi Andrew

On 24/07/18 18:20, Andrew Bartlett wrote:
> On Tue, 2018-07-24 at 10:29 +0100, Noel Power via samba-technical
> wrote:
>> 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
> built
>  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). 
'k so if iiuc then I can just replace the previous usage e.g

-     if (get_current_uid(conn) != 0) {
+    if (get_current_uid(conn) != sec_initial_uid()) {

that would be so much easier, I wasn't sure if I would be able to do
that hence the #ifdef


More information about the samba-technical mailing list