s4-ntvfs: use xattr_ntacl_name() in pvfs_xattr module
authorGünther Deschner <gd@samba.org>
Wed, 18 Nov 2020 17:26:43 +0000 (18:26 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 3 Nov 2021 19:09:01 +0000 (20:09 +0100)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
source4/ntvfs/posix/pvfs_xattr.c

index ab88d89d10bddab2ffcd244b80aca0518079c20c..b65cf45ff6ae4c7d30acc4433040cd57c2540266 100644 (file)
@@ -25,6 +25,7 @@
 #include "librpc/gen_ndr/ndr_xattr.h"
 #include "param/param.h"
 #include "ntvfs/posix/posix_eadb_proto.h"
+#include "ntvfs/posix/xattr_util.h"
 
 /*
   pull a xattr as a blob
@@ -359,12 +360,13 @@ NTSTATUS pvfs_acl_load(struct pvfs_state *pvfs, struct pvfs_filename *name, int
                       struct xattr_NTACL *acl)
 {
        NTSTATUS status;
+       const char *xattr_name = xattr_ntacl_name(pvfs->ntvfs->ctx->lp_ctx);
        ZERO_STRUCTP(acl);
        if (!(pvfs->flags & PVFS_FLAG_XATTR_ENABLE)) {
                return NT_STATUS_NOT_FOUND;
        }
        status = pvfs_xattr_ndr_load(pvfs, acl, name->full_name, fd, 
-                                    XATTR_NTACL_NAME,
+                                    xattr_name,
                                     acl, 
                                     (void *) ndr_pull_xattr_NTACL);
        return status;
@@ -378,16 +380,17 @@ NTSTATUS pvfs_acl_save(struct pvfs_state *pvfs, struct pvfs_filename *name, int
 {
        NTSTATUS status;
        void *privs;
+       const char *xattr_name = xattr_ntacl_name(pvfs->ntvfs->ctx->lp_ctx);
 
        if (!(pvfs->flags & PVFS_FLAG_XATTR_ENABLE)) {
                return NT_STATUS_OK;
        }
 
-       /* this xattr is in the "system" namespace, so we need
+       /* this xattr is usually in the "system" namespace, so we need
           admin privileges to set it */
        privs = root_privileges();
        status = pvfs_xattr_ndr_save(pvfs, name->full_name, fd, 
-                                    XATTR_NTACL_NAME, 
+                                    xattr_name,
                                     acl, 
                                     (void *) ndr_push_xattr_NTACL);
        talloc_free(privs);