Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339456
b: refs/heads/master
c: 36f87ee
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Dec 5, 2012
1 parent 05e8cd9 commit 6ede43f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 436bb435fcbe2d52678ec7e2abc45fd1938601ce
refs/heads/master: 36f87ee70f754d04e55518853e6fb30ed4732dda
10 changes: 8 additions & 2 deletions trunk/fs/cifs/cifsacl.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,14 @@ compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid)
static void
cifs_copy_sid(struct cifs_sid *dst, const struct cifs_sid *src)
{
memcpy(dst, src, sizeof(*dst));
int i;

dst->revision = src->revision;
dst->num_subauth = min_t(u8, src->num_subauth, NUM_SUBAUTHS);
for (i = 0; i < NUM_AUTHS; ++i)
dst->authority[i] = src->authority[i];
for (i = 0; i < dst->num_subauth; ++i)
dst->sub_auth[i] = src->sub_auth[i];
}

static void
Expand Down Expand Up @@ -427,7 +433,7 @@ id_to_sid(unsigned long cid, uint sidtype, struct cifs_sid *ssid)
if (IS_ERR(sidkey)) {
rc = -EINVAL;
cFYI(1, "%s: Can't map and id to a SID", __func__);
} else if (sidkey->datalen < sizeof(struct cifs_sid)) {
} else if (sidkey->datalen < CIFS_SID_BASE_SIZE) {
rc = -EIO;
cFYI(1, "%s: Downcall contained malformed key "
"(datalen=%hu)", __func__, sidkey->datalen);
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/cifs/cifsacl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ struct cifs_sid {
__le32 sub_auth[NUM_SUBAUTHS]; /* sub_auth[num_subauth] */
} __attribute__((packed));

/* size of a struct cifs_sid, sans sub_auth array */
#define CIFS_SID_BASE_SIZE (1 + 1 + NUM_AUTHS)

struct cifs_acl {
__le16 revision; /* revision level */
__le16 size;
Expand Down

0 comments on commit 6ede43f

Please sign in to comment.