[Samba] Bulk smbcacls calls

Noel Power nopower at suse.com
Wed Dec 11 02:44:44 MST 2013


Hi,

On 29/11/13 10:05, Noel Power wrote:
> [...]
>>> Failing that, I assume that much of the time taken is spent on 
>>> authenticating the user/pw for each request. Would it be possible to 
>>> write something that keeps the connection so that multiple requests can 
>>> be made without reauthenticating (I'm not familiar with how 
>>> LDAP/AD/Samba works)? I have looked at the source of smbcacls but 
>>> nothing jumped out at me.
>> Noel (cc'ed) just finished a bunch of changes adding inheritance
>> propagation to smbcacls:
>>
>> http://cgit.freedesktop.org/~noelp/noelp-samba/log/?h=smbcalcs-inherit-v2
>>
>> It doesn't do recursion on --get, but the new code could certainly be
>> leveraged to add this feature.
> Yes unfortunately support for '--get' in a recursive fashion isn't
> currently supported, it didn't quite fit with the inheritance
> propagation feature, but... David is correct in that the new code could
> definitely be leveraged to do that. However something like what you
> require I believe needs another new cmdline switch e.g. something -like
> maybe "-r|-recursive" [1]. Also I wonder how the output of smbcacls
> should look for such an operation as the existing output doesn't
> actually mention the file/dir that is being processed.
>
> Noel
>
> [1] in general I do believe a pure recursive option could be useful ( at
> least for --get, --chown, --chgrp )
if you are up to building from source you could try my repo
http://cgit.freedesktop.org/~noelp/noelp-samba/log/?h=recursive-smbcacls
I've added there a '-r' switch.

With that version built from source you can use '-r' with the new
'--propagate-inheritance' switch e.g.
   smbcalcs -r --propagate-inheritance --add|--modify|--set|--delete

you can additionally use '-r' with the following operations --get,
--chown & --chgrp

note: you can't use -r with ' --add|--modify|--set|--delete' alone, if
you want to use '-r' with (add/modify/delete...) you *must* additionally
specify '--propagate-inheritance'

I did some very very rough performance testing with a linux host running
kvm with a winserver 2012 guest

  smbcalcs -r --get -Uusername%password //guestIP/share /testdir > /dev/null

returns in < 2 minutes ( testdir has 20,069 files in 2,842 directories )

regards,
Noel


More information about the samba mailing list