Skip to content

improve performance for samba-tool ntacl sysvolreset

The sysvolreset cmd was slow with large amount of files.

With perf tool, we figure out the bottle neck is in user_sid_in_group_sid which is trying to create user token from sid all the time while we call setntacl.

To avoid that, we pass a session_info parameter all the way down to the related functions, which has the security_token with it. And then in smbd/posix_acls.c:uid_entry_in_group, we check with the security_token if exist.

In our testenv, with 2k files, time for sysvolreset cmd decrease from about 155s to 80s.

Merge request reports