Skip to content

Commit

Permalink
xattr NTSecurity should be hidden
Browse files Browse the repository at this point in the history
Or many things get confused, especially the tests.

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Aug 22, 2023
1 parent 6a2ef05 commit eac4f03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions include/os/windows/spl/sys/sid.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ extern "C" {

#include <sys/kidmap.h>

#define EA_NTACL "security.NTACL"

typedef struct ksiddomain {
char *kd_name;
} ksiddomain_t;
Expand Down
9 changes: 0 additions & 9 deletions module/os/windows/zfs/zfs_vnops_windows_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2429,8 +2429,6 @@ find_set_gid(struct vnode *vp, struct vnode *dvp,
#endif
}

#define EA_NTACL "security.NTACL"

void
zfs_save_ntsecurity(struct vnode *vp)
{
Expand Down Expand Up @@ -2736,13 +2734,6 @@ zfs_attach_security(struct vnode *vp, struct vnode *dvp)
return (Status);
}

// return true if a XATTR name should be skipped
int
xattr_protected(char *name)
{
return (0);
}

// return true if xattr is a stream (name ends with ":$DATA")
int
xattr_stream(char *name)
Expand Down
14 changes: 14 additions & 0 deletions module/os/windows/zfs/zfs_vnops_windows_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ enum xattr_permission {

static unsigned int zfs_xattr_compat = 0;

// return true if a XATTR name should be skipped
int
xattr_protected(char *name)
{
if (strcmp(EA_NTACL, name) == 0)
return (1);

if ((strncmp(XATTR_USER_PREFIX, name, XATTR_USER_PREFIX_LEN) == 0) &&
(strcmp(EA_NTACL, &name[XATTR_USER_PREFIX_LEN]) == 0))
return (1);

return (0);
}

static enum xattr_permission
zpl_xattr_permission(struct vnode *dvp, zfs_uio_t *uio, const char *name,
int name_len)
Expand Down

0 comments on commit eac4f03

Please sign in to comment.