tree-wide: fix assorted typos all over the place
[safe/jmp/linux-2.6] / fs / cifs / README
index e7a3ce6..a727b7c 100644 (file)
@@ -1,9 +1,16 @@
 The CIFS VFS support for Linux supports many advanced network filesystem 
-features such as heirarchical dfs like namespace, hardlinks, locking and more.  
+features such as hierarchical dfs like namespace, hardlinks, locking and more.  
 It was designed to comply with the SNIA CIFS Technical Reference (which 
 supersedes the 1992 X/Open SMB Standard) as well as to perform best practice 
 practical interoperability with Windows 2000, Windows XP, Samba and equivalent 
-servers.  
+servers.  This code was developed in participation with the Protocol Freedom
+Information Foundation.
+
+Please see
+  http://protocolfreedom.org/ and
+  http://samba.org/samba/PFIF/
+for more details.
+
 
 For questions or bug reports please contact:
     sfrench@samba.org (sfrench@us.ibm.com) 
@@ -56,7 +63,8 @@ the CIFS VFS web site) copy it to the same directory in which mount.smbfs and
 similar files reside (usually /sbin).  Although the helper software is not  
 required, mount.cifs is recommended.  Eventually the Samba 3.0 utility program 
 "net" may also be helpful since it may someday provide easier mount syntax for
-users who are used to Windows e.g.  net use <mount point> <UNC name or cifs URL>
+users who are used to Windows e.g.
+       net use <mount point> <UNC name or cifs URL>
 Note that running the Winbind pam/nss module (logon service) on all of your
 Linux clients is useful in mapping Uids and Gids consistently across the
 domain to the proper network user.  The mount.cifs mount helper can be
@@ -225,12 +233,9 @@ If no password is provided, mount.cifs will prompt for password entry
 
 Restrictions
 ============
-Servers must support the NTLM SMB dialect (which is the most recent, supported 
-by Samba and Windows NT version 4, 2000 and XP and many other SMB/CIFS servers) 
 Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC 
-1001/1002 support for "Netbios-Over-TCP/IP." Neither of these is likely to be a 
-problem as most servers support this.  IPv6 support is planned for the future,
-and is almost complete.
+1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a 
+problem as most servers support this.
 
 Valid filenames differ between Windows and Linux.  Windows typically restricts
 filenames which contain certain reserved characters (e.g.the character : 
@@ -251,26 +256,29 @@ A partial list of the supported mount options follows:
                the CIFS session.
   password     The user password.  If the mount helper is
                installed, the user will be prompted for password
-               if it is not supplied.
+               if not supplied.
   ip           The ip address of the target server
   unc          The target server Universal Network Name (export) to 
                mount.  
   domain       Set the SMB/CIFS workgroup name prepended to the
                username during CIFS session establishment
-  uid          If CIFS Unix extensions are not supported by the server
-               this overrides the default uid for inodes. For mounts to
-               servers which do support the CIFS Unix extensions, such
-               as a properly configured Samba server, the server provides
-               the uid, gid and mode.  For servers which do not support
-               the Unix extensions, the default uid (and gid) returned on
-               lookup of existing files is the uid (gid) of the person
+  forceuid     Set the default uid for inodes to the uid
+               passed in on mount. For mounts to servers
+               which do support the CIFS Unix extensions, such as a
+               properly configured Samba server, the server provides
+               the uid, gid and mode so this parameter should not be
+               specified unless the server and clients uid and gid
+               numbering differ.  If the server and client are in the
+               same domain (e.g. running winbind or nss_ldap) and
+               the server supports the Unix Extensions then the uid
+               and gid can be retrieved from the server (and uid
+               and gid would not have to be specifed on the mount. 
+               For servers which do not support the CIFS Unix
+               extensions, the default uid (and gid) returned on lookup
+               of existing files will be the uid (gid) of the person
                who executed the mount (root, except when mount.cifs
                is configured setuid for user mounts) unless the "uid=" 
-               (gid) mount option is specified.  For the uid (gid) of newly
-               created files and directories, ie files created since 
-               the last mount of the server share, the expected uid 
-               (gid) is cached as as long as the inode remains in 
-               memory on the client.   Also note that permission
+               (gid) mount option is specified. Also note that permission
                checks (authorization checks) on accesses to a file occur
                at the server, but there are cases in which an administrator
                may want to restrict at the client as well.  For those
@@ -278,9 +286,19 @@ A partial list of the supported mount options follows:
                (such as Windows), permissions can also be checked at the
                client, and a crude form of client side permission checking 
                can be enabled by specifying file_mode and dir_mode on 
-               the client
-  gid          If CIFS Unix extensions are not supported by the server
-               this overrides the default gid for inodes.
+               the client.  (default)
+  forcegid     (similar to above but for the groupid instead of uid) (default)
+  noforceuid   Fill in file owner information (uid) by requesting it from
+               the server if possible. With this option, the value given in
+               the uid= option (on mount) will only be used if the server
+               can not support returning uids on inodes.
+  noforcegid   (similar to above but for the group owner, gid, instead of uid)
+  uid          Set the default uid for inodes, and indicate to the
+               cifs kernel driver which local user mounted. If the server
+               supports the unix extensions the default uid is
+               not used to fill in the owner fields of inodes (files)
+               unless the "forceuid" parameter is specified.
+  gid          Set the default gid for inodes (similar to above).
   file_mode     If CIFS Unix extensions are not supported by the server
                this overrides the default mode for file inodes.
   dir_mode      If CIFS Unix extensions are not supported by the server 
@@ -294,10 +312,21 @@ A partial list of the supported mount options follows:
                during the local client kernel build will be used.
                If server does not support Unicode, this parameter is
                unused.
-  rsize                default read size (usually 16K)
-  wsize                default write size (usually 16K, 32K is often better over GigE)
-               maximum wsize currently allowed by CIFS is 57344 (14 4096 byte
-               pages)
+  rsize                default read size (usually 16K). The client currently
+               can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
+               defaults to 16K and may be changed (from 8K to the maximum
+               kmalloc size allowed by your kernel) at module install time
+               for cifs.ko. Setting CIFSMaxBufSize to a very large value
+               will cause cifs to use more memory and may reduce performance
+               in some cases.  To use rsize greater than 127K (the original
+               cifs protocol maximum) also requires that the server support
+               a new Unix Capability flag (for very large read) which some
+               newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
+               set from a minimum of 2048 to a maximum of 130048 (127K or
+               CIFSMaxBufSize, whichever is smaller)
+  wsize                default write size (default 57344)
+               maximum wsize currently allowed by CIFS is 57344 (fourteen
+               4096 byte pages)
   rw           mount the network share read-write (note that the
                server may still consider the share read-only)
   ro           mount network share read-only
@@ -345,11 +374,14 @@ A partial list of the supported mount options follows:
                client system. It is typically only needed when the server
                supports the CIFS Unix Extensions but the UIDs/GIDs on the
                client and server system do not match closely enough to allow
-               access by the user doing the mount.
+               access by the user doing the mount, but it may be useful with
+               non CIFS Unix Extension mounts for cases in which the default
+               mode is specified on the mount but is not to be enforced on the
+               client (e.g. perhaps when MultiUserMount is enabled)
                Note that this does not affect the normal ACL check on the
                target machine done by the server software (of the server
                ACL against the user name provided at mount time).
-  serverino    Use servers inode numbers instead of generating automatically
+  serverino    Use server's inode numbers instead of generating automatically
                incrementing inode numbers on the client.  Although this will
                make it easier to spot hardlinked files (as they will have
                the same inode numbers) and inode numbers may be persistent,
@@ -357,31 +389,41 @@ A partial list of the supported mount options follows:
                are unique if multiple server side mounts are exported under a
                single share (since inode numbers on the servers might not
                be unique if multiple filesystems are mounted under the same
-               shared higher level directory).  Note that this requires that
-               the server support the CIFS Unix Extensions as other servers
-               do not return a unique IndexNumber on SMB FindFirst (most
-               servers return zero as the IndexNumber).  Parameter has no
-               effect to Windows servers and others which do not support the
-               CIFS Unix Extensions.
+               shared higher level directory).  Note that some older
+               (e.g. pre-Windows 2000) do not support returning UniqueIDs
+               or the CIFS Unix Extensions equivalent and for those
+               this mount option will have no effect.  Exporting cifs mounts
+               under nfsd requires this mount option on the cifs mount.
+               This is now the default if server supports the 
+               required network operation.
   noserverino   Client generates inode numbers (rather than using the actual one
-               from the server) by default.
+               from the server). These inode numbers will vary after
+               unmount or reboot which can confuse some applications,
+               but not all server filesystems support unique inode
+               numbers.
   setuids       If the CIFS Unix extensions are negotiated with the server
                the client will attempt to set the effective uid and gid of
                the local process on newly created files, directories, and
-               devices (create, mkdir, mknod).
+               devices (create, mkdir, mknod).  If the CIFS Unix Extensions
+               are not negotiated, for newly created files and directories
+               instead of using the default uid and gid specified on
+               the mount, cache the new file's uid and gid locally which means
+               that the uid for the file can change when the inode is
+               reloaded (or the user remounts the share).
   nosetuids     The client will not attempt to set the uid and gid on
                on newly created files, directories, and devices (create, 
                mkdir, mknod) which will result in the server setting the
                uid and gid to the default (usually the server uid of the
                user who mounted the share).  Letting the server (rather than
-               the client) set the uid and gid is the default. This
-               parameter has no effect if the CIFS Unix Extensions are not
-               negotiated.
+               the client) set the uid and gid is the default. If the CIFS
+               Unix Extensions are not negotiated then the uid and gid for
+               new files will appear to be the uid (gid) of the mounter or the
+               uid (gid) parameter specified on the mount.
   netbiosname   When mounting to servers via port 139, specifies the RFC1001
                source name to use to represent the client netbios machine 
                name when doing the RFC1001 netbios session initialize.
   direct        Do not do inode data caching on files opened on this mount.
-               This precludes mmaping files on this mount. In some cases
+               This precludes mmapping files on this mount. In some cases
                with fast networks and little or no caching benefits on the
                client (e.g. when the application is doing large sequential
                reads bigger than page size without rereading the same data) 
@@ -394,10 +436,11 @@ A partial list of the supported mount options follows:
   acl          Allow setfacl and getfacl to manage posix ACLs if server
                supports them.  (default)
   noacl        Do not allow setfacl and getfacl calls on this mount
-  user_xattr    Allow getting and setting user xattrs as OS/2 EAs (extended
-               attributes) to the server (default) e.g. via setfattr 
-               and getfattr utilities. 
-  nouser_xattr  Do not allow getfattr/setfattr to get/set xattrs 
+  user_xattr    Allow getting and setting user xattrs (those attributes whose
+               name begins with "user." or "os2.") as OS/2 EAs (extended
+               attributes) to the server.  This allows support of the
+               setfattr and getfattr utilities. (default)
+  nouser_xattr  Do not allow getfattr/setfattr to get/set/list xattrs 
   mapchars      Translate six of the seven reserved characters (not backslash)
                        *?<>|:
                to the remap range (above 0xF000), which also
@@ -411,14 +454,106 @@ A partial list of the supported mount options follows:
  nomapchars     Do not translate any of these seven characters (default).
  nocase         Request case insensitive path name matching (case
                sensitive is the default if the server suports it).
+               (mount option "ignorecase" is identical to "nocase")
+ posixpaths     If CIFS Unix extensions are supported, attempt to
+               negotiate posix path name support which allows certain
+               characters forbidden in typical CIFS filenames, without
+               requiring remapping. (default)
+ noposixpaths   If CIFS Unix extensions are supported, do not request
+               posix path name support (this may cause servers to
+               reject creatingfile with certain reserved characters).
+ nounix         Disable the CIFS Unix Extensions for this mount (tree
+               connection). This is rarely needed, but it may be useful
+               in order to turn off multiple settings all at once (ie
+               posix acls, posix locks, posix paths, symlink support
+               and retrieving uids/gids/mode from the server) or to
+               work around a bug in server which implement the Unix
+               Extensions.
  nobrl          Do not send byte range lock requests to the server.
                This is necessary for certain applications that break
                with cifs style mandatory byte range locks (and most
                cifs servers do not yet support requesting advisory
                byte range locks).
+ forcemandatorylock Even if the server supports posix (advisory) byte range
+               locking, send only mandatory lock requests.  For some
+               (presumably rare) applications, originally coded for
+               DOS/Windows, which require Windows style mandatory byte range
+               locking, they may be able to take advantage of this option,
+               forcing the cifs client to only send mandatory locks
+               even if the cifs server would support posix advisory locks.
+               "forcemand" is accepted as a shorter form of this mount
+               option.
+ nostrictsync   If this mount option is set, when an application does an
+               fsync call then the cifs client does not send an SMB Flush
+               to the server (to force the server to write all dirty data
+               for this file immediately to disk), although cifs still sends
+               all dirty (cached) file data to the server and waits for the
+               server to respond to the write.  Since SMB Flush can be
+               very slow, and some servers may be reliable enough (to risk
+               delaying slightly flushing the data to disk on the server),
+               turning on this option may be useful to improve performance for
+               applications that fsync too much, at a small risk of server
+               crash.  If this mount option is not set, by default cifs will
+               send an SMB flush request (and wait for a response) on every
+               fsync call.
+ nodfs          Disable DFS (global name space support) even if the
+               server claims to support it.  This can help work around
+               a problem with parsing of DFS paths with Samba server
+               versions 3.0.24 and 3.0.25.
  remount        remount the share (often used to change from ro to rw mounts
                or vice versa)
-               
+ cifsacl        Report mode bits (e.g. on stat) based on the Windows ACL for
+               the file. (EXPERIMENTAL)
+ servern        Specify the server 's netbios name (RFC1001 name) to use
+               when attempting to setup a session to the server. 
+               This is needed for mounting to some older servers (such
+               as OS/2 or Windows 98 and Windows ME) since they do not
+               support a default server name.  A server name can be up
+               to 15 characters long and is usually uppercased.
+ sfu            When the CIFS Unix Extensions are not negotiated, attempt to
+               create device files and fifos in a format compatible with
+               Services for Unix (SFU).  In addition retrieve bits 10-12
+               of the mode via the SETFILEBITS extended attribute (as
+               SFU does).  In the future the bottom 9 bits of the
+               mode also will be emulated using queries of the security
+               descriptor (ACL).
+ sign           Must use packet signing (helps avoid unwanted data modification
+               by intermediate systems in the route).  Note that signing
+               does not work with lanman or plaintext authentication.
+ seal           Must seal (encrypt) all data on this mounted share before
+               sending on the network.  Requires support for Unix Extensions.
+               Note that this differs from the sign mount option in that it
+               causes encryption of data sent over this mounted share but other
+               shares mounted to the same server are unaffected.
+ locallease     This option is rarely needed. Fcntl F_SETLEASE is
+               used by some applications such as Samba and NFSv4 server to
+               check to see whether a file is cacheable.  CIFS has no way
+               to explicitly request a lease, but can check whether a file
+               is cacheable (oplocked).  Unfortunately, even if a file
+               is not oplocked, it could still be cacheable (ie cifs client
+               could grant fcntl leases if no other local processes are using
+               the file) for cases for example such as when the server does not
+               support oplocks and the user is sure that the only updates to
+               the file will be from this client. Specifying this mount option
+               will allow the cifs client to check for leases (only) locally
+               for files which are not oplocked instead of denying leases
+               in that case. (EXPERIMENTAL)
+ sec            Security mode.  Allowed values are:
+                       none    attempt to connection as a null user (no name)
+                       krb5    Use Kerberos version 5 authentication
+                       krb5i   Use Kerberos authentication and packet signing
+                       ntlm    Use NTLM password hashing (default)
+                       ntlmi   Use NTLM password hashing with signing (if
+                               /proc/fs/cifs/PacketSigningEnabled on or if
+                               server requires signing also can be the default) 
+                       ntlmv2  Use NTLMv2 password hashing      
+                       ntlmv2i Use NTLMv2 password hashing with packet signing
+                       lanman  (if configured in kernel config) use older
+                               lanman hash
+hard           Retry file operations if server is not responding
+soft           Limit retries to unresponsive servers (usually only
+               one retry) before returning an error.  (default)
+
 The mount.cifs mount helper also accepts a few mount options before -o
 including:
 
@@ -427,7 +562,7 @@ including:
        -V      print mount.cifs version
        -?      display simple usage information
 
-With recent 2.6 kernel versions of modutils, the version of the cifs kernel
+With most 2.6 kernel versions of modutils, the version of the cifs kernel
 module can be displayed via modinfo.
 
 Misc /proc/fs/cifs Flags and Debug Info
@@ -450,14 +585,58 @@ PacketSigningEnabled      If set to one, cifs packet signing is enabled
                        it.  If set to two, cifs packet signing is
                        required even if the server considers packet
                        signing optional. (default 1)
-cifsFYI                        If set to one, additional debug information is
-                       logged to the system error log. (default 0)
-ExtendedSecurity       If set to one, SPNEGO session establishment
-                       is allowed which enables more advanced 
-                       secure CIFS session establishment (default 0)
-NTLMV2Enabled          If set to one, more secure password hashes
-                       are used when the server supports them and
-                       when kerberos is not negotiated (default 0)
+SecurityFlags          Flags which control security negotiation and
+                       also packet signing. Authentication (may/must)
+                       flags (e.g. for NTLM and/or NTLMv2) may be combined with
+                       the signing flags.  Specifying two different password
+                       hashing mechanisms (as "must use") on the other hand 
+                       does not make much sense. Default flags are 
+                               0x07007 
+                       (NTLM, NTLMv2 and packet signing allowed).  The maximum 
+                       allowable flags if you want to allow mounts to servers
+                       using weaker password hashes is 0x37037 (lanman,
+                       plaintext, ntlm, ntlmv2, signing allowed).  Some
+                       SecurityFlags require the corresponding menuconfig
+                       options to be enabled (lanman and plaintext require
+                       CONFIG_CIFS_WEAK_PW_HASH for example).  Enabling
+                       plaintext authentication currently requires also
+                       enabling lanman authentication in the security flags
+                       because the cifs module only supports sending
+                       laintext passwords using the older lanman dialect
+                       form of the session setup SMB.  (e.g. for authentication
+                       using plain text passwords, set the SecurityFlags
+                       to 0x30030):
+                       may use packet signing                          0x00001
+                       must use packet signing                         0x01001
+                       may use NTLM (most common password hash)        0x00002
+                       must use NTLM                                   0x02002
+                       may use NTLMv2                                  0x00004
+                       must use NTLMv2                                 0x04004
+                       may use Kerberos security                       0x00008
+                       must use Kerberos                               0x08008
+                       may use lanman (weak) password hash             0x00010
+                       must use lanman password hash                   0x10010
+                       may use plaintext passwords                     0x00020
+                       must use plaintext passwords                    0x20020
+                       (reserved for future packet encryption)         0x00040
+
+cifsFYI                        If set to non-zero value, additional debug information
+                       will be logged to the system error log.  This field
+                       contains three flags controlling different classes of
+                       debugging entries.  The maximum value it can be set
+                       to is 7 which enables all debugging points (default 0).
+                       Some debugging statements are not compiled into the
+                       cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the
+                       kernel configuration. cifsFYI may be set to one or
+                       nore of the following flags (7 sets them all):
+
+                       log cifs informational messages                 0x01
+                       log return codes from cifs entry points         0x02
+                       log slow responses (ie which take longer than 1 second)
+                         CONFIG_CIFS_STATS2 must be enabled in .config 0x04
+                               
+                               
 traceSMB               If set to one, debug information is logged to the
                        system error log with the start of smb requests
                        and responses (default 0)
@@ -476,22 +655,49 @@ LinuxExtensionsEnabled    If set to one then the client will attempt to
                        support and want to map the uid and gid fields 
                        to values supplied at mount (rather than the 
                        actual values, then set this to zero. (default 1)
+Experimental            When set to 1 used to enable certain experimental
+                       features (currently enables multipage writes
+                       when signing is enabled, the multipage write
+                       performance enhancement was disabled when
+                       signing turned on in case buffer was modified
+                       just before it was sent, also this flag will
+                       be used to use the new experimental directory change 
+                       notification code).  When set to 2 enables
+                       an additional experimental feature, "raw ntlmssp"
+                       session establishment support (which allows
+                       specifying "sec=ntlmssp" on mount). The Linux cifs
+                       module will use ntlmv2 authentication encapsulated
+                       in "raw ntlmssp" (not using SPNEGO) when
+                       "sec=ntlmssp" is specified on mount.
+                       This support also requires building cifs with
+                       the CONFIG_CIFS_EXPERIMENTAL configuration flag.
 
 These experimental features and tracing can be enabled by changing flags in 
 /proc/fs/cifs (after the cifs module has been installed or built into the 
 kernel, e.g.  insmod cifs).  To enable a feature set it to 1 e.g.  to enable 
 tracing to the kernel message log type: 
 
-       echo 1 > /proc/fs/cifs/cifsFYI
+       echo 7 > /proc/fs/cifs/cifsFYI
        
-and for more extensive tracing including the start of smb requests and responses
+cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel
+logging of various informational messages.  2 enables logging of non-zero
+SMB return codes while 4 enables logging of requests that take longer
+than one second to complete (except for byte range lock requests). 
+Setting it to 4 requires defining CONFIG_CIFS_STATS2 manually in the
+source code (typically by setting it in the beginning of cifsglob.h),
+and setting it to seven enables all three.  Finally, tracing
+the start of smb requests and responses can be enabled via:
 
        echo 1 > /proc/fs/cifs/traceSMB
 
-Two other experimental features are under development and to test 
-require enabling CONFIG_CIFS_EXPERIMENTAL
+Two other experimental features are under development. To test these
+requires enabling CONFIG_CIFS_EXPERIMENTAL
 
-       More efficient write operations
+       cifsacl support needed to retrieve approximated mode bits based on
+               the contents on the CIFS ACL.
+
+       lease support: cifs will check the oplock state before calling into
+       the vfs to see if we can grant a lease on a file.
 
        DNOTIFY fcntl: needed for support of directory change 
                            notification and perhaps later for file leases)
@@ -507,11 +713,31 @@ The statistics for the number of total SMBs and oplock breaks are different in
 that they represent all for that share, not just those for which the server
 returned success.
        
-Also note that "cat /proc/fs/cifs/DebugData" will display information about 
-the active sessions and the shares that are mounted.  Note: NTLMv2 enablement 
-will not work since its implementation is not quite complete yet. Do not alter
-the ExtendedSecurity configuration value unless you are doing specific testing.
-Enabling extended security works to Windows 2000 Workstations and XP but not to 
-Windows 2000 server or Samba since it does not usually send "raw NTLMSSP" 
-(instead it sends NTLMSSP encapsulated in SPNEGO/GSSAPI, which support is not 
-complete in the CIFS VFS yet).  
+Also note that "cat /proc/fs/cifs/DebugData" will display information about
+the active sessions and the shares that are mounted.
+
+Enabling Kerberos (extended security) works but requires version 1.2 or later
+of the helper program cifs.upcall to be present and to be configured in the
+/etc/request-key.conf file.  The cifs.upcall helper program is from the Samba
+project(http://www.samba.org). NTLM and NTLMv2 and LANMAN support do not
+require this helper. Note that NTLMv2 security (which does not require the
+cifs.upcall helper program), instead of using Kerberos, is sufficient for
+some use cases.
+
+DFS support allows transparent redirection to shares in an MS-DFS name space.
+In addition, DFS support for target shares which are specified as UNC
+names which begin with host names (rather than IP addresses) requires
+a user space helper (such as cifs.upcall) to be present in order to
+translate host names to ip address, and the user space helper must also
+be configured in the file /etc/request-key.conf.  Samba, Windows servers and
+many NAS appliances support DFS as a way of constructing a global name
+space to ease network configuration and improve reliability.
+
+To use cifs Kerberos and DFS support, the Linux keyutils package should be
+installed and something like the following lines should be added to the
+/etc/request-key.conf file:
+
+create cifs.spnego * * /usr/local/sbin/cifs.upcall %k
+create dns_resolver * * /usr/local/sbin/cifs.upcall %k
+
+