[Samba] Bulk smbcacls calls

Andrew Bartlett abartlet at samba.org
Fri Nov 29 00:16:06 MST 2013

On Thu, 2013-11-28 at 15:00 +0000, Peter Flood wrote:
> I want to get ACLs (output similar to that of smbcacls) for a *lot* of 
> files (potentially millions). I can only process about 10 files per 
> second when running the command (`smbcacls -U ...` via a Python 
> wrapper), I'm looking for a faster way.
> Does anyone know any libraries or other commands that could help me?
> 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.

See the code in python/samba/netcmd/gpo.py that sets a remote ACL for
GPOs.  This could be called from your own script, avoiding the
connection cost.

Otherwise, make sure you authenticate with kerberos, as this will be
much faster, even if you connect per file with smbcacls. 

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 mailing list