linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Convert owner and group SID offsets to LE format
@ 2020-01-06 16:31 Boris Protopopov
  2020-01-06 16:31 ` [PATCH] Add support for setting owner and group in ntsd Boris Protopopov
  2020-01-22  0:25 ` [PATCH 1/2] Convert owner and group SID offsets to LE format Pavel Shilovsky
  0 siblings, 2 replies; 7+ messages in thread
From: Boris Protopopov @ 2020-01-06 16:31 UTC (permalink / raw)
  To: linux-cifs; +Cc: sfrench, samba-technical, sblbir, boris.v.protopopov

Convert owner and group SID offsets to LE format
when writing to ntsd

Signed-off-by: Boris Protopopov <boris.v.protopopov@gmail.com>
---
 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,
-- 
2.14.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-22  0:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 16:31 [PATCH 1/2] Convert owner and group SID offsets to LE format Boris Protopopov
2020-01-06 16:31 ` [PATCH] Add support for setting owner and group in ntsd Boris Protopopov
2020-01-08 20:42   ` Pavel Shilovsky
2020-01-09 16:07     ` Boris Protopopov
2020-01-09 18:29       ` Pavel Shilovsky
2020-01-22  0:26         ` Pavel Shilovsky
2020-01-22  0:25 ` [PATCH 1/2] Convert owner and group SID offsets to LE format Pavel Shilovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).