提交 852e2295 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: use the NUM_AUTHS and NUM_SUBAUTHS constants in cifsacl code

...instead of hardcoding in '5' and '6' all over the place.
Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 fc03d8a5
...@@ -210,7 +210,7 @@ sid_to_str(struct cifs_sid *sidptr, char *sidstr) ...@@ -210,7 +210,7 @@ sid_to_str(struct cifs_sid *sidptr, char *sidstr)
sprintf(strptr, "-%d", sidptr->revision); sprintf(strptr, "-%d", sidptr->revision);
strptr = sidstr + strlen(sidstr); strptr = sidstr + strlen(sidstr);
for (i = 0; i < 6; ++i) { for (i = 0; i < NUM_AUTHS; ++i) {
if (sidptr->authority[i]) { if (sidptr->authority[i]) {
sprintf(strptr, "-%d", sidptr->authority[i]); sprintf(strptr, "-%d", sidptr->authority[i]);
strptr = sidstr + strlen(sidstr); strptr = sidstr + strlen(sidstr);
...@@ -649,7 +649,7 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) ...@@ -649,7 +649,7 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid)
} }
/* compare all of the six auth values */ /* compare all of the six auth values */
for (i = 0; i < 6; ++i) { for (i = 0; i < NUM_AUTHS; ++i) {
if (ctsid->authority[i] != cwsid->authority[i]) { if (ctsid->authority[i] != cwsid->authority[i]) {
if (ctsid->authority[i] > cwsid->authority[i]) if (ctsid->authority[i] > cwsid->authority[i])
return 1; return 1;
...@@ -811,7 +811,7 @@ static __u16 fill_ace_for_sid(struct cifs_ace *pntace, ...@@ -811,7 +811,7 @@ static __u16 fill_ace_for_sid(struct cifs_ace *pntace,
pntace->sid.revision = psid->revision; pntace->sid.revision = psid->revision;
pntace->sid.num_subauth = psid->num_subauth; pntace->sid.num_subauth = psid->num_subauth;
for (i = 0; i < 6; i++) for (i = 0; i < NUM_AUTHS; i++)
pntace->sid.authority[i] = psid->authority[i]; pntace->sid.authority[i] = psid->authority[i];
for (i = 0; i < psid->num_subauth; i++) for (i = 0; i < psid->num_subauth; i++)
pntace->sid.sub_auth[i] = psid->sub_auth[i]; pntace->sid.sub_auth[i] = psid->sub_auth[i];
......
...@@ -60,8 +60,8 @@ struct cifs_ntsd { ...@@ -60,8 +60,8 @@ struct cifs_ntsd {
struct cifs_sid { struct cifs_sid {
__u8 revision; /* revision level */ __u8 revision; /* revision level */
__u8 num_subauth; __u8 num_subauth;
__u8 authority[6]; __u8 authority[NUM_AUTHS];
__le32 sub_auth[5]; /* sub_auth[num_subauth] */ __le32 sub_auth[NUM_SUBAUTHS]; /* sub_auth[num_subauth] */
} __attribute__((packed)); } __attribute__((packed));
struct cifs_acl { struct cifs_acl {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册