/* The following definitions come from smbd/open.c */
-NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
+NTSTATUS smb1_file_se_access_check(connection_struct *conn,
+ const struct security_descriptor *sd,
const NT_USER_TOKEN *token,
uint32_t access_desired,
uint32_t *access_granted);
nt_errstr(status) ));
return status;
}
- status = smb1_file_se_access_check(parent_desc,
+ status = smb1_file_se_access_check(handle->conn,
+ parent_desc,
handle->conn->server_info->ptok,
access_mask,
&access_granted);
&pdesc);
if (NT_STATUS_IS_OK(status)) {
/* See if we can access it. */
- status = smb1_file_se_access_check(pdesc,
+ status = smb1_file_se_access_check(handle->conn,
+ pdesc,
handle->conn->server_info->ptok,
fsp->access_mask,
&access_granted);
SMB1 file varient of se_access_check. Never test FILE_READ_ATTRIBUTES.
****************************************************************************/
-NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
+NTSTATUS smb1_file_se_access_check(connection_struct *conn,
+ const struct security_descriptor *sd,
const NT_USER_TOKEN *token,
uint32_t access_desired,
uint32_t *access_granted)
{
+ *access_granted = 0;
+
+ if (conn->server_info->utok.uid == 0 || conn->admin_user) {
+ /* I'm sorry sir, I didn't know you were root... */
+ *access_granted = access_desired;
+ if (access_desired & SEC_FLAG_MAXIMUM_ALLOWED) {
+ *access_granted |= FILE_GENERIC_ALL;
+ }
+ return NT_STATUS_OK;
+ }
+
return se_access_check(sd,
token,
(access_desired & ~FILE_READ_ATTRIBUTES),
NTSTATUS status;
struct security_descriptor *sd = NULL;
- *access_granted = 0;
-
- if (conn->server_info->utok.uid == 0 || conn->admin_user) {
- /* I'm sorry sir, I didn't know you were root... */
- *access_granted = access_mask;
- if (access_mask & SEC_FLAG_MAXIMUM_ALLOWED) {
- *access_granted |= FILE_GENERIC_ALL;
- }
- return NT_STATUS_OK;
- }
-
status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name,
(OWNER_SECURITY_INFORMATION |
GROUP_SECURITY_INFORMATION |
return status;
}
- status = smb1_file_se_access_check(sd,
+ status = smb1_file_se_access_check(conn,
+ sd,
conn->server_info->ptok,
access_mask,
access_granted);
return NT_STATUS_ACCESS_DENIED;
}
- status = smb1_file_se_access_check(sd,
+ status = smb1_file_se_access_check(conn,
+ sd,
conn->server_info->ptok,
access_mask,
&access_granted);