Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4879b44829d94a1f8facf90cced3c5f23c5a8c62
Commit: 4879b44829d94a1f8facf90cced3c5f23c5a8c62
Parent: c4ec20717313daafba59225f812db89595952b83
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 21:57:39 2007 +0000
Committer: Steve French <[EMAIL PROTECTED]>
CommitDate: Fri Oct 19 21:57:39 2007 +0000
[CIFS] ACL support part 5
Acked-by: Shirish Pargaonkar <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
fs/cifs/cifsacl.c | 23 +++++++++++++++++++++++
fs/cifs/cifsproto.h | 2 +-
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 e8e5635..e808304 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)
return (1); /* sids compare/match */
}
+void get_mode_from_acl(struct inode * inode, const char * path)
+{
+
+ if (inode == NULL)
+ return;
+
+ /* find an open readable handle
+ if handle found
+ lock handle
+ else open file
+ if no open file can not hurt to check if path is null
+ GetCIFSACL
+ for all ACEs in ACL {
+ if U or G or O
+ inode->i_mode = parse_ace(file_type, UG or O,
ace->perms, inode->i_mode)
+ else continue
+ }
+ if handle open close it
+ else unlock handle */
+
+ return;
+}
+
static void parse_ace(struct cifs_ace *pace, char *end_of_acl)
{
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 1a88366..7c445f8 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -92,7 +92,7 @@ extern int cifs_get_inode_info(struct inode **pinode,
extern int cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *search_path,
struct super_block *sb, int xid);
-
+extern void get_mode_from_acl(struct inode * inode, const char * search_path);
extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *,
const char *);
extern int cifs_umount(struct super_block *, struct cifs_sb_info *);
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 5e8b388..9a5c0c9 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -527,6 +527,12 @@ int cifs_get_inode_info(struct inode **pinode,
/* BB fill in uid and gid here? with help from winbind?
or retrieve from NTFS stream extended attribute */
+#ifdef CONFIG_CIFS_EXPERIMENTAL
+ if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
+ cFYI(1, ("Getting mode bits from ACL"));
+ get_mode_from_acl(inode, search_path);
+ }
+#endif
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) {
/* fill in uid, gid, mode from server ACL */
/* BB FIXME this should also take into account the
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html