The case for telling SMB_VFS_GET_NT_ACL whether we know the object is a directory or a file or unknown
jra at samba.org
Thu Mar 29 11:39:37 MDT 2012
On Thu, Mar 29, 2012 at 10:34:17AM -0700, Richard Sharpe wrote:
> When you are handling SMB_VFS_GET_NT_ACL requests in a VFS module, and
> you want to do something slightly different if the obect is a
> directory, you need to make a potentially relatively expensive
> stat-like call to determine this.
> However, in a number of places Samba actually knows that the object it
> is requesting an SD/ACL for is actually a directory. In other cases it
> has no idea.
> Can I suggest we add an is_dir arg that takes two vals: DEFINITELY, UNKNOWN
> That looks like a bool, but maybe an enum is better.
Ah. The underlying problem is that SMB_VFS_GET_NT_ACL is only
given a "const char *name" instead of a "const struct smb_filename *fname".
The "const struct smb_filename *fname" must contain a valid
stat struct that contains the IS_DIR() test.
That's the actual fix here (IMHO).
More information about the samba-technical