]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: modify get_ea_names_from_file signature fn to take fsp alone
authorNoel Power <npower@quick-trouble.localdomain>
Sun, 31 Jan 2021 19:18:03 +0000 (19:18 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 26 Feb 2021 21:28:33 +0000 (21:28 +0000)
Removes the smb_filename function parameter

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_streams_xattr.c
source3/smbd/nttrans.c
source3/smbd/proto.h
source3/smbd/trans2.c

index f66fad7d1692c8082e952036d96b2c547beec562..ca85ad86705550a3fe0bb65d22e489d3456b2287 100644 (file)
@@ -686,8 +686,7 @@ static NTSTATUS walk_xattr_streams(vfs_handle_struct *handle,
 
        status = get_ea_names_from_file(talloc_tos(),
                                handle->conn,
-                               fsp,
-                               smb_fname,
+                               smb_fname->fsp,
                                &names,
                                &num_names);
        if (!NT_STATUS_IS_OK(status)) {
index c74cfa48c521a7c4c088b712f9358c599c989e76..c2e253227665f72dc75b150b4a458e0a2d99c097 100644 (file)
@@ -788,7 +788,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
                        size_t num_names = 0;
                        /* Do we have any EA's ? */
                        status = get_ea_names_from_file(
-                           ctx, conn, fsp, smb_fname, NULL, &num_names);
+                           ctx, conn, smb_fname->fsp, NULL, &num_names);
                        if (NT_STATUS_IS_OK(status) && num_names) {
                                file_status &= ~NO_EAS;
                        }
@@ -1466,7 +1466,7 @@ static void call_nt_transact_create(connection_struct *conn,
                        size_t num_names = 0;
                        /* Do we have any EA's ? */
                        status = get_ea_names_from_file(
-                           ctx, conn, fsp, smb_fname, NULL, &num_names);
+                           ctx, conn, smb_fname->fsp, NULL, &num_names);
                        if (NT_STATUS_IS_OK(status) && num_names) {
                                file_status &= ~NO_EAS;
                        }
index f0f947f44f6a35efc2b0f3786d66acb1ebad19b3..5d7fee329f3a90d647f66da83f2484ab635d55f4 100644 (file)
@@ -1215,7 +1215,6 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
 NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
                        connection_struct *conn,
                        files_struct *fsp,
-                       const struct smb_filename *smb_fname,
                        char ***pnames,
                        size_t *pnum_names);
 NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
index c3344b2b105e812b9f59cd3945bc3add85899835..8cdd448a66b3ce9f4036abf3db03c48a3449d3ad 100644 (file)
@@ -294,7 +294,6 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx,
 NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
                                connection_struct *conn,
                                files_struct *fsp,
-                               const struct smb_filename *smb_fname,
                                char ***pnames,
                                size_t *pnum_names)
 {
@@ -315,10 +314,11 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
        }
        *pnum_names = 0;
 
-       status = refuse_symlink(conn, fsp, smb_fname);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (fsp == NULL) {
                /*
-                * Just return no EA's on a symlink.
+                * Callers may pass fsp == NULL when passing smb_fname->fsp of a
+                * symlink. This is ok, handle it here, by just return no EA's
+                * on a symlink.
                 */
                return NT_STATUS_OK;
        }
@@ -449,7 +449,6 @@ static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx,
        status = get_ea_names_from_file(talloc_tos(),
                                conn,
                                fsp,
-                               smb_fname,
                                &names,
                                &num_names);