From a138fd1155b5259e8955cb6d6997091e47acfd8c Mon Sep 17 00:00:00 2001 From: Boris Protopopov Date: Mon, 6 Jan 2020 16:31:18 +0000 Subject: 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 --- setcifsacl.c | 6 ++++-- 1 file 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, -- cgit v1.2.3