summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2012-10-29 15:45:37 -0400
committerJeff Layton <jlayton@samba.org>2012-10-29 15:45:37 -0400
commit60bca663f94e27436ed1afe1e673a8afa3342e1d (patch)
treec87056e4708d1036ba6c3c9bbd1d0fb0ea67811a
parent679fbebb5a656b4eb1a8988fb0d8697a5f919794 (diff)
downloadcifs-utils-60bca663f94e27436ed1afe1e673a8afa3342e1d.tar.gz
cifs-utils-60bca663f94e27436ed1afe1e673a8afa3342e1d.tar.bz2
cifs-utils-60bca663f94e27436ed1afe1e673a8afa3342e1d.zip
cifs.idmap: make sure cifsacl structs are packed
The kernel equivalent definitions are defined with __attribute__((packed)), and the code seems to assume the userspace and kernel ones will be properly aligned. Fix the userspace definitions in a similar fashion. Given the way these structs are, there is probably not any padding between fields on most arches, but it's best to be safe here. Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
-rw-r--r--cifsacl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/cifsacl.h b/cifsacl.h
index 4ea7fd4..101881b 100644
--- a/cifsacl.h
+++ b/cifsacl.h
@@ -110,20 +110,20 @@ struct cifs_ntsd {
uint32_t gsidoffset;
uint32_t sacloffset;
uint32_t dacloffset;
-};
+} __attribute__((packed));
struct cifs_sid {
uint8_t revision; /* revision level */
uint8_t num_subauth;
uint8_t authority[6];
uint32_t sub_auth[5]; /* sub_auth[num_subauth] */
-};
+} __attribute__((packed));
struct cifs_ctrl_acl {
uint16_t revision; /* revision level */
uint16_t size;
uint32_t num_aces;
-};
+} __attribute__((packed));
struct cifs_ace {
uint8_t type;
@@ -131,6 +131,6 @@ struct cifs_ace {
uint16_t size;
uint32_t access_req;
struct cifs_sid sid; /* ie UUID of user or group who gets these perms */
-};
+} __attribute__((packed));
#endif /* CIFSACL_H */