]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add can_write_to_fsp(). Not yet used.
authorJeremy Allison <jra@samba.org>
Wed, 2 Jun 2021 18:36:59 +0000 (11:36 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/file_access.c
source3/smbd/proto.h

index 0dd441b44686a8687e83034d023fb7a8a80936e8..54c99b17c5f1058aaddec1d360d72353ebc87da4 100644 (file)
@@ -152,6 +152,17 @@ bool can_write_to_file(connection_struct *conn,
                                FILE_WRITE_DATA));
 }
 
+/****************************************************************************
+ Userspace check for write access to fsp.
+****************************************************************************/
+
+bool can_write_to_fsp(struct files_struct *fsp)
+{
+       return NT_STATUS_IS_OK(smbd_check_access_rights_fsp(fsp,
+                                                       false,
+                                                       FILE_WRITE_DATA));
+}
+
 /****************************************************************************
  Check for an existing default Windows ACL on a directory fsp.
 ****************************************************************************/
index 26d65df8fab2a00ad24356cd3d319a5d0618f411..f9691656ea28410fdceb97b07b30747cfbabe0aa 100644 (file)
@@ -337,6 +337,7 @@ bool can_delete_file_in_directory(connection_struct *conn,
 bool can_write_to_file(connection_struct *conn,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname);
+bool can_write_to_fsp(struct files_struct *fsp);
 bool directory_has_default_acl_fsp(struct files_struct *fsp);
 NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode);