[CIFS] Use fsuid (fsgid) more consistently instead of uid/gid in
authorSteve French <sfrench@us.ibm.com>
Fri, 2 Dec 2005 01:12:59 +0000 (17:12 -0800)
committerSteve French <sfrench@us.ibm.com>
Fri, 2 Dec 2005 01:12:59 +0000 (17:12 -0800)
assembling smb requests when setuids and Linux protocol extensions enabled
and in checking more matching sessions in multiuser mount mode.

Pointed out by Shaggy.

Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/CHANGES
fs/cifs/cifsfs.h
fs/cifs/dir.c
fs/cifs/inode.c
fs/cifs/misc.c

index 943ef9b82244ef9b71a3211e24bb1a1899f51409..8bef2f3a41302fd5bf56abb54161ebc506ce5d12 100644 (file)
@@ -1,3 +1,7 @@
+Version 1.40
+------------
+Use fsuid (fsgid) more consistently instead of uid (gid).
+
 Version 1.39
 ------------
 Defer close of a file handle slightly if pending writes depend on that handle
@@ -7,6 +11,8 @@ Fix SFU style symlinks and mknod needed for servers which do not support the
 CIFS Unix Extensions.  Fix setfacl/getfacl on bigendian. Timeout negative
 dentries so files that the client sees as deleted but that later get created
 on the server will be recognized.  Add client side permission check on setattr.
+Timeout stuck requests better (where server has never responded or sent corrupt
+responses)
 
 Version 1.38
 ------------
index 9ec40e0e54fc4eed289eb9070aeb0c8120f610cd..821a8eb2255965a77e031c37a6b2f4c674f97e48 100644 (file)
@@ -99,5 +99,5 @@ extern ssize_t        cifs_getxattr(struct dentry *, const char *, void *, size_t);
 extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
 extern int cifs_ioctl (struct inode * inode, struct file * filep,
                       unsigned int command, unsigned long arg);
-#define CIFS_VERSION   "1.39"
+#define CIFS_VERSION   "1.40"
 #endif                         /* _CIFSFS_H */
index 32cc96cafa3eb050d19871f85cf4e089c68b7562..fed55e3c53dfab365c72886001ed4f240ddd6cee 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   vfs operations that deal with dentries
  * 
- *   Copyright (C) International Business Machines  Corp., 2002,2003
+ *   Copyright (C) International Business Machines  Corp., 2002,2005
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   This library is free software; you can redistribute it and/or modify
@@ -200,8 +200,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                        (oplock & CIFS_CREATE_ACTION))
                        if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
                                CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
-                                       (__u64)current->euid,
-                                       (__u64)current->egid,
+                                       (__u64)current->fsuid,
+                                       (__u64)current->fsgid,
                                        0 /* dev */,
                                        cifs_sb->local_nls, 
                                        cifs_sb->mnt_cifs_flags & 
@@ -325,7 +325,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
        else if (pTcon->ses->capabilities & CAP_UNIX) {
                if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
                        rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path,
-                               mode,(__u64)current->euid,(__u64)current->egid,
+                               mode,(__u64)current->fsuid,(__u64)current->fsgid,
                                device_number, cifs_sb->local_nls,
                                cifs_sb->mnt_cifs_flags & 
                                        CIFS_MOUNT_MAP_SPECIAL_CHR);
index 411c1f7f84da6074efd483e27df1221db4647df1..d1e99575743650a331638665edd267262bbb178e 100644 (file)
@@ -750,8 +750,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                        if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
                                CIFSSMBUnixSetPerms(xid, pTcon, full_path,
                                                    mode,
-                                                   (__u64)current->euid,
-                                                   (__u64)current->egid,
+                                                   (__u64)current->fsuid,
+                                                   (__u64)current->fsgid,
                                                    0 /* dev_t */,
                                                    cifs_sb->local_nls,
                                                    cifs_sb->mnt_cifs_flags &
index 94baf6c8ecbda85946984cd2e4d524034cc94644..9af37f864688fe251a12f2cfdcfd187c22f0703d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/misc.c
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2004
+ *   Copyright (C) International Business Machines  Corp., 2002,2005
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   This library is free software; you can redistribute it and/or modify
@@ -348,12 +348,12 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
                /*  BB Add support for establishing new tCon and SMB Session  */
                /*      with userid/password pairs found on the smb session   */ 
                /*      for other target tcp/ip addresses               BB    */
-                               if(current->uid != treeCon->ses->linux_uid) {
-                                       cFYI(1,("Multiuser mode and UID did not match tcon uid "));
+                               if(current->fsuid != treeCon->ses->linux_uid) {
+                                       cFYI(1,("Multiuser mode and UID did not match tcon uid"));
                                        read_lock(&GlobalSMBSeslock);
                                        list_for_each(temp_item, &GlobalSMBSessionList) {
                                                ses = list_entry(temp_item, struct cifsSesInfo, cifsSessionList);
-                                               if(ses->linux_uid == current->uid) {
+                                               if(ses->linux_uid == current->fsuid) {
                                                        if(ses->server == treeCon->ses->server) {
                                                                cFYI(1,("found matching uid substitute right smb_uid"));  
                                                                buffer->Uid = ses->Suid;
This page took 0.030662 seconds and 5 git commands to generate.