Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 849c9caa authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] Update readme to reflect forceuid mount parms
  cifs: Read buffer overflow
  cifs: show noforceuid/noforcegid mount options (try #2)
  cifs: reinstate original behavior when uid=/gid= options are specified
  [CIFS] Updates fs/cifs/CHANGES
  cifs: fix error handling in mount-time DFS referral chasing code
parents a33a052f d098564f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
Version 1.60
-------------
Fix memory leak in reconnect.  Fix oops in DFS mount error path.
Set s_maxbytes to smaller (the max that vfs can handle) so that
sendfile will now work over cifs mounts again.  Add noforcegid
and noforceuid mount parameters.

Version 1.59
------------
Client uses server inode numbers (which are persistent) rather than
+12 −13
Original line number Diff line number Diff line
@@ -262,8 +262,8 @@ A partial list of the supported mount options follows:
		mount.	
  domain	Set the SMB/CIFS workgroup name prepended to the
		username during CIFS session establishment
  forceuid	Set the default uid for inodes based on the uid
		passed in. For mounts to servers
  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
@@ -278,11 +278,7 @@ A partial list of the supported mount options follows:
		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 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
@@ -290,10 +286,13 @@ 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.  Note that the mount.cifs helper must be
		at version 1.10 or higher to support specifying the uid
		(or gid) in non-numeric form.
  forcegid	(similar to above but for the groupid instead of uid)
		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
+9 −3
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ void cifs_dfs_release_automount_timer(void)
 * i.e. strips from UNC trailing path that is not part of share
 * name and fixup missing '\' in the begining of DFS node refferal
 * if neccessary.
 * Returns pointer to share name on success or NULL on error.
 * Returns pointer to share name on success or ERR_PTR on error.
 * Caller is responsible for freeing returned string.
 */
static char *cifs_get_share_name(const char *node_name)
@@ -68,7 +68,7 @@ static char *cifs_get_share_name(const char *node_name)
	UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */,
			 GFP_KERNEL);
	if (!UNC)
		return NULL;
		return ERR_PTR(-ENOMEM);

	/* get share name and server name */
	if (node_name[1] != '\\') {
@@ -87,7 +87,7 @@ static char *cifs_get_share_name(const char *node_name)
		cERROR(1, ("%s: no server name end in node name: %s",
			__func__, node_name));
		kfree(UNC);
		return NULL;
		return ERR_PTR(-EINVAL);
	}

	/* find sharename end */
@@ -133,6 +133,12 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
		return ERR_PTR(-EINVAL);

	*devname = cifs_get_share_name(ref->node_name);
	if (IS_ERR(*devname)) {
		rc = PTR_ERR(*devname);
		*devname = NULL;
		goto compose_mount_options_err;
	}

	rc = dns_resolve_server_name_to_ip(*devname, &srvIP);
	if (rc != 0) {
		cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d",
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
	int maxwords = maxbytes / 2;
	char tmp[NLS_MAX_CHARSET_SIZE];

	for (i = 0; from[i] && i < maxwords; i++) {
	for (i = 0; i < maxwords && from[i]; i++) {
		charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,
					     NLS_MAX_CHARSET_SIZE);
		if (charlen > 0)
+4 −0
Original line number Diff line number Diff line
@@ -376,10 +376,14 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m)
	seq_printf(s, ",uid=%d", cifs_sb->mnt_uid);
	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)
		seq_printf(s, ",forceuid");
	else
		seq_printf(s, ",noforceuid");

	seq_printf(s, ",gid=%d", cifs_sb->mnt_gid);
	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)
		seq_printf(s, ",forcegid");
	else
		seq_printf(s, ",noforcegid");

	cifs_show_address(s, tcon->ses->server);

Loading