The Samba-Bugzilla – Attachment 16011 Details for
Bug 14397
smbcacls:c:ace:_compare incorrectly reorders ACLs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for ACL setting & sorting in libsmbclient
libsmb_xattr-acl-set-sort.patch (text/plain), 1.77 KB, created by
Peter Eriksson
on 2020-05-28 13:34:49 UTC
(
hide
)
Description:
Patch for ACL setting & sorting in libsmbclient
Filename:
MIME Type:
Creator:
Peter Eriksson
Created:
2020-05-28 13:34:49 UTC
Size:
1.77 KB
patch
obsolete
>--- samba-4.12.3/source3/libsmb/libsmb_xattr.c 2020-01-31 11:25:36.000000000 +0100 >+++ samba-4.12.3-liu/source3/libsmb/libsmb_xattr.c 2020-05-28 13:50:32.523687000 +0200 >@@ -303,7 +303,8 @@ > p++; > /* Try to parse numeric form */ > >- if (sscanf(p, "%u/%u/%u", &atype, &aflags, &amask) == 3 && >+ if ((sscanf(p, "%u/%u/0x%x", &atype, &aflags, &amask) == 3 || >+ sscanf(p, "%u/%u/%u", &atype, &aflags, &amask) == 3) && > convert_string_to_sid(ipc_cli, pol, numeric, &sid, str)) { > goto done; > } >@@ -1645,7 +1646,8 @@ > } > > /* Denied ACE entries must come before allowed ones */ >- sort_acl(old->dacl); >+ if (mode != SMBC_XATTR_MODE_SET || (flags & SMBC_XATTR_FLAG_NO_ACL_SORT) == 0) >+ sort_acl(old->dacl); > > /* Create new security descriptor and set it */ > sd = make_sec_desc(ctx, old->revision, SEC_DESC_SELF_RELATIVE, >@@ -1848,6 +1850,9 @@ > errno = ENOMEM; > ret = -1; > } else { >+ if (strcasecmp_m(name, "system.nt_sec_desc.*") == 0 || >+ strcasecmp_m(name, "system.nt_sec_desc.*+") == 0) >+ flags |= SMBC_XATTR_FLAG_NO_ACL_SORT; > ret = cacl_set(context, talloc_tos(), srv->cli, > ipc_srv->cli, &ipc_srv->pol, path, > namevalue, >--- samba-4.12.3/source3/include/libsmbclient.h 2020-01-31 11:25:36.000000000 +0100 >+++ samba-4.12.3-liu/source3/include/libsmbclient.h 2020-05-28 13:48:25.434517000 +0200 >@@ -189,7 +189,7 @@ > */ > #define SMBC_XATTR_FLAG_CREATE 0x1 /* fail if attr already exists */ > #define SMBC_XATTR_FLAG_REPLACE 0x2 /* fail if attr does not exist */ >- >+#define SMBC_XATTR_FLAG_NO_ACL_SORT 0x4 /* no ACL sorting */ > > /* > * Mappings of the DOS mode bits, as returned by smbc_getxattr() when the
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14397
: 16011