Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce06c9f025120dbb2978d9b84641d76c25f17902
Commit:     ce06c9f025120dbb2978d9b84641d76c25f17902
Parent:     15b0395911eb45a0834755f0d9e84570644a8c22
Author:     Steve French <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 8 21:12:01 2007 +0000
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Thu Nov 8 21:12:01 2007 +0000

    [CIFS] add mode to acl conversion helper function
    
    Acked-by: Shirish Pargaonkar <[EMAIL PROTECTED]>
    Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/CHANGES   |    3 +++
 fs/cifs/cifsacl.c |   35 +++++++++++++++++++++++++++++++++--
 fs/cifs/cifsfs.h  |    2 +-
 3 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 6d3e736..53629b8 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,3 +1,6 @@
+Version 1.52
+------------
+
 Version 1.51
 ------------
 Fix memory leak in statfs when mounted to very old servers (e.g.
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index ec44580..dabbce0 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -138,9 +138,9 @@ static void access_flags_to_mode(__u32 ace_flags, int type, 
umode_t *pmode,
                                 umode_t *pbits_to_set)
 {
        /* the order of ACEs is important.  The canonical order is to begin with
-          DENY entries then follow with ALLOW, otherwise an allow entry could 
be
+          DENY entries followed by ALLOW, otherwise an allow entry could be
           encountered first, making the subsequent deny entry like "dead code"
-           which would be superflous since Windows stops when a match is made 
+          which would be superflous since Windows stops when a match is made
           for the operation you are trying to perform for your user */
 
        /* For deny ACEs we change the mask so that subsequent allow access
@@ -188,6 +188,37 @@ static void access_flags_to_mode(__u32 ace_flags, int 
type, umode_t *pmode,
        return;
 }
 
+/*
+   Generate access flags to reflect permissions mode is the existing mode.
+   This function is called for every ACE in the DACL whose SID matches
+   with either owner or group or everyone.
+*/
+
+static void mode_to_access_flags(umode_t mode, umode_t bits_to_use,
+                               __u32 *pace_flags)
+{
+       /* reset access mask */
+       *pace_flags = 0x0;
+
+       /* bits to use are either S_IRWXU or S_IRWXG or S_IRWXO */
+       mode &= bits_to_use;
+
+       /* check for R/W/X UGO since we do not know whose flags
+          is this but we have cleared all the bits sans RWX for
+          either user or group or other as per bits_to_use */
+       if (mode & S_IRUGO)
+               *pace_flags |= SET_FILE_READ_RIGHTS;
+       if (mode & S_IWUGO)
+               *pace_flags |= SET_FILE_WRITE_RIGHTS;
+       if (mode & S_IXUGO)
+               *pace_flags |= SET_FILE_EXEC_RIGHTS;
+
+#ifdef CONFIG_CIFS_DEBUG2
+       cFYI(1, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags));
+#endif
+       return;
+}
+
 
 #ifdef CONFIG_CIFS_DEBUG2
 static void dump_ace(struct cifs_ace *pace, char *end_of_acl)
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 0a3ee5a..62357d2 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -106,5 +106,5 @@ extern int cifs_ioctl(struct inode *inode, struct file 
*filep,
 extern struct export_operations cifs_export_ops;
 #endif /* EXPERIMENTAL */
 
-#define CIFS_VERSION   "1.51"
+#define CIFS_VERSION   "1.52"
 #endif                         /* _CIFSFS_H */
-
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

Reply via email to