linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Protopopov <boris.v.protopopov@gmail.com>
To: linux-cifs@vger.kernel.org
Cc: sfrench@samba.org, samba-technical@lists.samba.org,
	sblbir@amazon.com, boris.v.protopopov@gmail.com
Subject: [PATCH 1/2] Convert owner and group SID offsets to LE format
Date: Mon,  6 Jan 2020 16:31:18 +0000	[thread overview]
Message-ID: <20200106163119.9083-1-boris.v.protopopov@gmail.com> (raw)

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


             reply	other threads:[~2020-01-06 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 16:31 Boris Protopopov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200106163119.9083-1-boris.v.protopopov@gmail.com \
    --to=boris.v.protopopov@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sblbir@amazon.com \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).