1. 23 5月, 2012 6 次提交
  2. 17 5月, 2012 7 次提交
  3. 24 3月, 2012 8 次提交
  4. 22 3月, 2012 4 次提交
  5. 20 3月, 2012 1 次提交
  6. 19 1月, 2012 1 次提交
  7. 04 1月, 2012 1 次提交
  8. 25 10月, 2011 1 次提交
  9. 20 10月, 2011 3 次提交
  10. 14 10月, 2011 2 次提交
  11. 13 10月, 2011 3 次提交
    • S
      cifs: Add data structures and functions for uid/gid to SID mapping (try #4) · 21fed0d5
      Shirish Pargaonkar 提交于
      Add data structures and functions necessary to map a uid and gid to SID.
      These functions are very similar to the ones used to map a SID to uid and gid.
      This time, instead of storing sid to id mapping sorted on a sid value,
      id to sid is stored, sorted on an id.
      A cifs upcall sends an id (uid or gid) and expects a SID structure
      in return, if mapping was done successfully.
      
      A failed id to sid mapping to EINVAL.
      
      This patchset aims to enable chown and chgrp commands when
      cifsacl mount option is specified, especially to Windows SMB servers.
      Currently we can't do that.  So now along with chmod command,
      chown and chgrp work.
      
      Winbind is used to map id to a SID.  chown and chgrp use an upcall
      to provide an id to winbind and upcall returns with corrosponding
      SID if any exists. That SID is used to build security descriptor.
      The DACL part of a security descriptor is not changed by either
      chown or chgrp functionality.
      
      cifs client maintains a separate caches for uid to SID and
      gid to SID mapping. This is similar to the one used earlier
      to map SID to id (as part of ID mapping code).
      
      I tested it by mounting shares from a Windows (2003) server by
      authenticating as two users, one at a time, as Administrator and
      as a ordinary user.
      And then attempting to change owner of a file on the share.
      
      Depending on the permissions/privileges at the server for that file,
      chown request fails to either open a file (to change the ownership)
      or to set security descriptor.
      So it all depends on privileges on the file at the server and what
      user you are authenticated as at the server, cifs client is just a
      conduit.
      
      I compared the security descriptor during chown command to that
      what smbcacls sends when it is used with -M OWNNER: option
      and they are similar.
      
      This patchset aim to enable chown and chgrp commands when
      cifsacl mount option is specified, especially to Windows SMB servers.
      Currently we can't do that.  So now along with chmod command,
      chown and chgrp work.
      
      I tested it by mounting shares from a Windows (2003) server by
      authenticating as two users, one at a time, as Administrator and
      as a ordinary user.
      And then attempting to change owner of a file on the share.
      
      Depending on the permissions/privileges at the server for that file,
      chown request fails to either open a file (to change the ownership)
      or to set security descriptor.
      So it all depends on privileges on the file at the server and what
      user you are authenticated as at the server, cifs client is just a
      conduit.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      21fed0d5
    • S
      cifs: Add mount options for backup intent (try #6) · 3d3ea8e6
      Shirish Pargaonkar 提交于
      Add mount options backupuid and backugid.
      
      It allows an authenticated user to access files with the intent to back them
      up including their ACLs, who may not have access permission but has
      "Backup files and directories user right" on them (by virtue of being part
      of the built-in group Backup Operators.
      
      When mount options backupuid is specified, cifs client restricts the
      use of backup intents to the user whose effective user id is specified
      along with the mount option.
      
      When mount options backupgid is specified, cifs client restricts the
      use of backup intents to the users whose effective user id belongs to the
      group id specified along with the mount option.
      
      If an authenticated user is not part of the built-in group Backup Operators
      at the server, access to such files is denied, even if allowed by the client.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      3d3ea8e6
    • S
      add new module parameter 'enable_oplocks' · e7504734
      Steve French 提交于
      Thus spake Jeff Layton:
      
      "Making that a module parm would allow you to set that parameter at boot
      time without needing to add special startup scripts. IMO, all of the
      procfile "switches" under /proc/fs/cifs should be module parms
      instead."
      
      This patch doesn't alter the default behavior (Oplocks are enabled by
      default).
      
      To disable oplocks when loading the module, use
      
         modprobe cifs enable_oplocks=0
      
      (any of '0' or 'n' or 'N' conventions can be used).
      
      To disable oplocks at runtime using the new interface, use
      
         echo 0 > /sys/module/cifs/parameters/enable_oplocks
      
      The older /proc/fs/cifs/OplockEnabled interface will be deprecated
      after two releases. A subsequent patch will add an warning message
      about this deprecation.
      
      Changes since v2:
         - make enable_oplocks a 'bool'
      
      Changes since v1:
         - eliminate the use of extra variable by renaming the old one to
           enable_oplocks and make it an 'int' type.
      Reported-by: NAlexander Swen <alex@swen.nu>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      e7504734
  12. 12 8月, 2011 1 次提交
    • S
      [CIFS] Cleanup use of CONFIG_CIFS_STATS2 ifdef to make transport routines more readable · 789e6661
      Steve French 提交于
      Christoph had requested that the stats related code (in
      CONFIG_CIFS_STATS2) be moved into helpers to make code flow more
      readable.   This patch should help.   For example the following
      section from transport.c
      
                             spin_unlock(&GlobalMid_Lock);
                             atomic_inc(&ses->server->num_waiters);
                             wait_event(ses->server->request_q,
                                        atomic_read(&ses->server->inFlight)
                                          < cifs_max_pending);
                             atomic_dec(&ses->server->num_waiters);
                             spin_lock(&GlobalMid_Lock);
      
      becomes simpler (with the patch below):
                             spin_unlock(&GlobalMid_Lock);
                             cifs_num_waiters_inc(server);
                             wait_event(server->request_q,
                                        atomic_read(&server->inFlight)
                                          < cifs_max_pending);
                             cifs_num_waiters_dec(server);
                             spin_lock(&GlobalMid_Lock);
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      CC: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      Reviewed-by: NPavel Shilovsky <piastry@etersoft.ru>
      789e6661
  13. 01 8月, 2011 1 次提交
    • J
      cifs: simplify refcounting for oplock breaks · ad635942
      Jeff Layton 提交于
      Currently, we take a sb->s_active reference and a cifsFileInfo reference
      when an oplock break workqueue job is queued. This is unnecessary and
      more complicated than it needs to be. Also as Al points out,
      deactivate_super has non-trivial locking implications so it's best to
      avoid that if we can.
      
      Instead, just cancel any pending oplock breaks for this filehandle
      synchronously in cifsFileInfo_put after taking it off the lists.
      That should ensure that this job doesn't outlive the structures it
      depends on.
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ad635942
  14. 26 7月, 2011 1 次提交