This was already being checked in the lower layer,
so no change in behavior, just an efficiency and
clarity change.
Just move an extra check here so we refuse the
set if a default ACL is sent on a file object
before we go into the lower layers.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
goto out;
}
+ /* If we have a default acl, this *must* be a directory. */
+ if (valid_def_acls && !fsp->is_directory) {
+ DBG_INFO("Can't set default acls on "
+ "non-directory %s\n",
+ fsp_str_dbg(fsp));
+ return NT_STATUS_INVALID_HANDLE;
+ }
+
DBG_DEBUG("file %s num_file_acls = %"PRIu16", "
"num_def_acls = %"PRIu16"\n",
fsp_str_dbg(fsp),