diff options
author | Steve French <sfrench@us.ibm.com> | 2007-10-19 17:57:39 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-10-19 17:57:39 -0400 |
commit | 4879b44829d94a1f8facf90cced3c5f23c5a8c62 (patch) | |
tree | 4fe294715e3c275cafcc2f2eebc531dd517b4440 | |
parent | c4ec20717313daafba59225f812db89595952b83 (diff) |
[CIFS] ACL support part 5
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/cifsacl.c | 23 | ||||
-rw-r--r-- | fs/cifs/cifsproto.h | 2 | ||||
-rw-r--r-- | fs/cifs/inode.c | 6 |
3 files changed, 30 insertions, 1 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index e8e56353f5a1..e8083043a26c 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -129,6 +129,29 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid) | |||
129 | return (1); /* sids compare/match */ | 129 | return (1); /* sids compare/match */ |
130 | } | 130 | } |
131 | 131 | ||
132 | void get_mode_from_acl(struct inode * inode, const char * path) | ||
133 | { | ||
134 | |||
135 | if (inode == NULL) | ||
136 | return; | ||
137 | |||
138 | /* find an open readable handle | ||
139 | if handle found | ||
140 | lock handle | ||
141 | else open file | ||
142 | if no open file can not hurt to check if path is null | ||
143 | GetCIFSACL | ||
144 | for all ACEs in ACL { | ||
145 | if U or G or O | ||
146 | inode->i_mode = parse_ace(file_type, UG or O, ace->perms, inode->i_mode) | ||
147 | else continue | ||
148 | } | ||
149 | if handle open close it | ||
150 | else unlock handle */ | ||
151 | |||
152 | return; | ||
153 | } | ||
154 | |||
132 | 155 | ||
133 | static void parse_ace(struct cifs_ace *pace, char *end_of_acl) | 156 | static void parse_ace(struct cifs_ace *pace, char *end_of_acl) |
134 | { | 157 | { |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 1a883663b22d..7c445f8f233f 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -92,7 +92,7 @@ extern int cifs_get_inode_info(struct inode **pinode, | |||
92 | extern int cifs_get_inode_info_unix(struct inode **pinode, | 92 | extern int cifs_get_inode_info_unix(struct inode **pinode, |
93 | const unsigned char *search_path, | 93 | const unsigned char *search_path, |
94 | struct super_block *sb, int xid); | 94 | struct super_block *sb, int xid); |
95 | 95 | extern void get_mode_from_acl(struct inode * inode, const char * search_path); | |
96 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, | 96 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, |
97 | const char *); | 97 | const char *); |
98 | extern int cifs_umount(struct super_block *, struct cifs_sb_info *); | 98 | extern int cifs_umount(struct super_block *, struct cifs_sb_info *); |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 5e8b388be3b6..9a5c0c925bab 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -527,6 +527,12 @@ int cifs_get_inode_info(struct inode **pinode, | |||
527 | 527 | ||
528 | /* BB fill in uid and gid here? with help from winbind? | 528 | /* BB fill in uid and gid here? with help from winbind? |
529 | or retrieve from NTFS stream extended attribute */ | 529 | or retrieve from NTFS stream extended attribute */ |
530 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
531 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | ||
532 | cFYI(1, ("Getting mode bits from ACL")); | ||
533 | get_mode_from_acl(inode, search_path); | ||
534 | } | ||
535 | #endif | ||
530 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { | 536 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { |
531 | /* fill in uid, gid, mode from server ACL */ | 537 | /* fill in uid, gid, mode from server ACL */ |
532 | /* BB FIXME this should also take into account the | 538 | /* BB FIXME this should also take into account the |