]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
[CIFS] ACL support part 5
authorSteve French <sfrench@us.ibm.com>
Fri, 19 Oct 2007 21:57:39 +0000 (21:57 +0000)
committerSteve French <sfrench@us.ibm.com>
Fri, 19 Oct 2007 21:57:39 +0000 (21:57 +0000)
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsacl.c
fs/cifs/cifsproto.h
fs/cifs/inode.c

index e8e56353f5a1c423b5e6e70f986bbb8b6a3f7a19..e8083043a26c0bbe3391b100581c8ac7d34b3c00 100644 (file)
@@ -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)
 {
index 1a883663b22dfcc51eac71da6fc8930bf5b7d3e6..7c445f8f233f95ded619b7d4b6644df3e0e1b782 100644 (file)
@@ -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 *);
index 5e8b388be3b672a7130e9e26f8bb954ed8321534..9a5c0c925babac70eda79e3a921d4d9f160a8274 100644 (file)
@@ -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