aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/acl.c')
-rw-r--r--fs/ocfs2/acl.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index 260b16281fc3..8a404576fb26 100644
--- a/fs/ocfs2/acl.c
+++ b/fs/ocfs2/acl.c
@@ -65,7 +65,20 @@ static struct posix_acl *ocfs2_acl_from_xattr(const void *value, size_t size)
65 65
66 acl->a_entries[n].e_tag = le16_to_cpu(entry->e_tag); 66 acl->a_entries[n].e_tag = le16_to_cpu(entry->e_tag);
67 acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm); 67 acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm);
68 acl->a_entries[n].e_id = le32_to_cpu(entry->e_id); 68 switch(acl->a_entries[n].e_tag) {
69 case ACL_USER:
70 acl->a_entries[n].e_uid =
71 make_kuid(&init_user_ns,
72 le32_to_cpu(entry->e_id));
73 break;
74 case ACL_GROUP:
75 acl->a_entries[n].e_gid =
76 make_kgid(&init_user_ns,
77 le32_to_cpu(entry->e_id));
78 break;
79 default:
80 break;
81 }
69 value += sizeof(struct posix_acl_entry); 82 value += sizeof(struct posix_acl_entry);
70 83
71 } 84 }
@@ -91,7 +104,21 @@ static void *ocfs2_acl_to_xattr(const struct posix_acl *acl, size_t *size)
91 for (n = 0; n < acl->a_count; n++, entry++) { 104 for (n = 0; n < acl->a_count; n++, entry++) {
92 entry->e_tag = cpu_to_le16(acl->a_entries[n].e_tag); 105 entry->e_tag = cpu_to_le16(acl->a_entries[n].e_tag);
93 entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm); 106 entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm);
94 entry->e_id = cpu_to_le32(acl->a_entries[n].e_id); 107 switch(acl->a_entries[n].e_tag) {
108 case ACL_USER:
109 entry->e_id = cpu_to_le32(
110 from_kuid(&init_user_ns,
111 acl->a_entries[n].e_uid));
112 break;
113 case ACL_GROUP:
114 entry->e_id = cpu_to_le32(
115 from_kgid(&init_user_ns,
116 acl->a_entries[n].e_gid));
117 break;
118 default:
119 entry->e_id = cpu_to_le32(ACL_UNDEFINED_ID);
120 break;
121 }
95 } 122 }
96 return ocfs2_acl; 123 return ocfs2_acl;
97} 124}