summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Protopopov <boris.v.protopopov@gmail.com>2020-01-06 16:31:18 +0000
committerPavel Shilovsky <pshilov@microsoft.com>2020-09-03 10:35:18 -0700
commita138fd1155b5259e8955cb6d6997091e47acfd8c (patch)
tree240d7691d7f55b69b4fbbe2104c5b4dd923ba06d
parent9bd8c8dba414333a5e8acccebc1689b28d92f7c7 (diff)
downloadcifs-utils-a138fd1155b5259e8955cb6d6997091e47acfd8c.tar.gz
cifs-utils-a138fd1155b5259e8955cb6d6997091e47acfd8c.tar.bz2
cifs-utils-a138fd1155b5259e8955cb6d6997091e47acfd8c.zip
Convert owner and group SID offsets to LE format
Convert owner and group SID offsets to LE format when writing to ntsd Signed-off-by: Boris Protopopov <boris.v.protopopov@gmail.com>
-rw-r--r--setcifsacl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/setcifsacl.c b/setcifsacl.c
index f3d0189..9a301e2 100644
--- a/setcifsacl.c
+++ b/setcifsacl.c
@@ -114,12 +114,14 @@ copy_sec_desc(const struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd,
if (dacloffset <= osidsoffset) {
/* owners placed at end of ACL */
nowner_sid_ptr = (struct cifs_sid *)((char *)pnntsd + dacloffset + size);
- pnntsd->osidoffset = dacloffset + size;
+ osidsoffset = dacloffset + size;
+ pnntsd->osidoffset = htole32(osidsoffset);
size = copy_cifs_sid(nowner_sid_ptr, owner_sid_ptr);
bufsize += size;
/* put group SID after owner SID */
ngroup_sid_ptr = (struct cifs_sid *)((char *)nowner_sid_ptr + size);
- pnntsd->gsidoffset = pnntsd->osidoffset + size;
+ gsidsoffset = osidsoffset + size;
+ pnntsd->gsidoffset = htole32(gsidsoffset);
} else {
/*
* Most servers put the owner information at the beginning,