except SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ, SMB_ACL_OTHER.
****************************************************************************/
-bool set_unix_posix_acl(connection_struct *conn,
+NTSTATUS set_unix_posix_acl(connection_struct *conn,
files_struct *fsp,
const struct smb_filename *smb_fname,
uint16_t num_acls,
if (!num_acls) {
/* Remove the ACL from the file. */
- status = remove_posix_acl(conn, fsp, smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- return false;
- }
- return true;
+ return remove_posix_acl(conn, fsp, smb_fname);
}
file_acl = create_posix_acl_from_wire(conn,
pdata,
talloc_tos());
if (file_acl == NULL) {
- return false;
+ return map_nt_error_from_unix(errno);
}
if (fsp && fsp->fh->fd != -1) {
/* The preferred way - use an open fd. */
ret = SMB_VFS_SYS_ACL_SET_FD(fsp, file_acl);
if (ret == -1) {
+ status = map_nt_error_from_unix(errno);
DBG_INFO("acl_set_file failed on %s (%s)\n",
fname,
strerror(errno));
TALLOC_FREE(file_acl);
- return false;
+ return status;
}
} else {
ret = SMB_VFS_SYS_ACL_SET_FILE(conn,
SMB_ACL_TYPE_ACCESS,
file_acl);
if (ret == -1) {
+ status = map_nt_error_from_unix(errno);
DBG_INFO("acl_set_file failed on %s (%s)\n",
fname,
strerror(errno));
TALLOC_FREE(file_acl);
- return false;
+ return status;
}
}
fname);
TALLOC_FREE(file_acl);
- return true;
+ return NT_STATUS_OK;
}
/********************************************************************
bool set_unix_posix_default_acl(connection_struct *conn,
const struct smb_filename *smb_fname,
uint16_t num_def_acls, const char *pdata);
-bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp,
+NTSTATUS set_unix_posix_acl(connection_struct *conn, files_struct *fsp,
const struct smb_filename *smb_fname,
uint16_t num_acls,
const char *pdata);
pdata += SMB_POSIX_ACL_HEADER_SIZE;
if (valid_file_acls) {
- bool ok = set_unix_posix_acl(conn,
+ status = set_unix_posix_acl(conn,
fsp,
fsp->fsp_name,
num_file_acls,
pdata);
- if (!ok) {
- status = map_nt_error_from_unix(errno);
+ if (!NT_STATUS_IS_OK(status)) {
goto out;
}
}