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

Commit 6faf9a54 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  cifs: don't allow mmap'ed pages to be dirtied while under writeback (try #3)
  [CIFS] Warn on requesting default security (ntlm) on mount
  [CIFS] cifs: clarify the meaning of tcpStatus == CifsGood
  cifs: wrap received signature check in srv_mutex
  cifs: clean up various nits in unicode routines (try #2)
  cifs: clean up length checks in check2ndT2
  cifs: set ra_pages in backing_dev_info
  cifs: fix broken BCC check in is_valid_oplock_break
  cifs: always do is_path_accessible check in cifs_mount
  various endian fixes to cifs
  Elminate sparse __CHECK_ENDIAN__ warnings on port conversion
  Max share size is too small
  Allow user names longer than 32 bytes
  cifs: replace /proc/fs/cifs/Experimental with a module parm
  cifs: check for private_data before trying to put it
parents d77d9597 ca83ce3d
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -685,22 +685,6 @@ 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 
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ void cifs_fscache_unregister(void)
 */
struct cifs_server_key {
	uint16_t	family;		/* address family */
	uint16_t	port;		/* IP port */
	__be16		port;		/* IP port */
	union {
		struct in_addr	ipv4_addr;
		struct in6_addr	ipv6_addr;
+0 −43
Original line number Diff line number Diff line
@@ -423,7 +423,6 @@ static const struct file_operations cifs_lookup_cache_proc_fops;
static const struct file_operations traceSMB_proc_fops;
static const struct file_operations cifs_multiuser_mount_proc_fops;
static const struct file_operations cifs_security_flags_proc_fops;
static const struct file_operations cifs_experimental_proc_fops;
static const struct file_operations cifs_linux_ext_proc_fops;

void
@@ -441,8 +440,6 @@ cifs_proc_init(void)
	proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops);
	proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops);
	proc_create("OplockEnabled", 0, proc_fs_cifs, &cifs_oplock_proc_fops);
	proc_create("Experimental", 0, proc_fs_cifs,
		    &cifs_experimental_proc_fops);
	proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs,
		    &cifs_linux_ext_proc_fops);
	proc_create("MultiuserMount", 0, proc_fs_cifs,
@@ -469,7 +466,6 @@ cifs_proc_clean(void)
	remove_proc_entry("OplockEnabled", proc_fs_cifs);
	remove_proc_entry("SecurityFlags", proc_fs_cifs);
	remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs);
	remove_proc_entry("Experimental", proc_fs_cifs);
	remove_proc_entry("LookupCacheEnabled", proc_fs_cifs);
	remove_proc_entry("fs/cifs", NULL);
}
@@ -550,45 +546,6 @@ static const struct file_operations cifs_oplock_proc_fops = {
	.write		= cifs_oplock_proc_write,
};

static int cifs_experimental_proc_show(struct seq_file *m, void *v)
{
	seq_printf(m, "%d\n", experimEnabled);
	return 0;
}

static int cifs_experimental_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, cifs_experimental_proc_show, NULL);
}

static ssize_t cifs_experimental_proc_write(struct file *file,
		const char __user *buffer, size_t count, loff_t *ppos)
{
	char c;
	int rc;

	rc = get_user(c, buffer);
	if (rc)
		return rc;
	if (c == '0' || c == 'n' || c == 'N')
		experimEnabled = 0;
	else if (c == '1' || c == 'y' || c == 'Y')
		experimEnabled = 1;
	else if (c == '2')
		experimEnabled = 2;

	return count;
}

static const struct file_operations cifs_experimental_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= cifs_experimental_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
	.write		= cifs_experimental_proc_write,
};

static int cifs_linux_ext_proc_show(struct seq_file *m, void *v)
{
	seq_printf(m, "%d\n", linuxExtEnabled);
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
		   MAX_MECH_STR_LEN +
		   UID_KEY_LEN + (sizeof(uid_t) * 2) +
		   CREDUID_KEY_LEN + (sizeof(uid_t) * 2) +
		   USER_KEY_LEN + strlen(sesInfo->userName) +
		   USER_KEY_LEN + strlen(sesInfo->user_name) +
		   PID_KEY_LEN + (sizeof(pid_t) * 2) + 1;

	spnego_key = ERR_PTR(-ENOMEM);
@@ -153,7 +153,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
	sprintf(dp, ";creduid=0x%x", sesInfo->cred_uid);

	dp = description + strlen(description);
	sprintf(dp, ";user=%s", sesInfo->userName);
	sprintf(dp, ";user=%s", sesInfo->user_name);

	dp = description + strlen(description);
	sprintf(dp, ";pid=0x%x", current->pid);
+17 −18
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ cifs_mapchar(char *target, const __u16 src_char, const struct nls_table *cp,
	case UNI_COLON:
		*target = ':';
		break;
	case UNI_ASTERIK:
	case UNI_ASTERISK:
		*target = '*';
		break;
	case UNI_QUESTION:
@@ -264,40 +264,40 @@ cifs_strndup_from_ucs(const char *src, const int maxlen, const bool is_unicode,
 * names are little endian 16 bit Unicode on the wire
 */
int
cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
cifsConvertToUCS(__le16 *target, const char *source, int srclen,
		 const struct nls_table *cp, int mapChars)
{
	int i, j, charlen;
	int len_remaining = maxlen;
	char src_char;
	__u16 temp;
	__le16 dst_char;
	wchar_t tmp;

	if (!mapChars)
		return cifs_strtoUCS(target, source, PATH_MAX, cp);

	for (i = 0, j = 0; i < maxlen; j++) {
	for (i = 0, j = 0; i < srclen; j++) {
		src_char = source[i];
		switch (src_char) {
		case 0:
			put_unaligned_le16(0, &target[j]);
			put_unaligned(0, &target[j]);
			goto ctoUCS_out;
		case ':':
			temp = UNI_COLON;
			dst_char = cpu_to_le16(UNI_COLON);
			break;
		case '*':
			temp = UNI_ASTERIK;
			dst_char = cpu_to_le16(UNI_ASTERISK);
			break;
		case '?':
			temp = UNI_QUESTION;
			dst_char = cpu_to_le16(UNI_QUESTION);
			break;
		case '<':
			temp = UNI_LESSTHAN;
			dst_char = cpu_to_le16(UNI_LESSTHAN);
			break;
		case '>':
			temp = UNI_GRTRTHAN;
			dst_char = cpu_to_le16(UNI_GRTRTHAN);
			break;
		case '|':
			temp = UNI_PIPE;
			dst_char = cpu_to_le16(UNI_PIPE);
			break;
		/*
		 * FIXME: We can not handle remapping backslash (UNI_SLASH)
@@ -305,17 +305,17 @@ cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
		 * as they use backslash as separator.
		 */
		default:
			charlen = cp->char2uni(source+i, len_remaining,
						&temp);
			charlen = cp->char2uni(source + i, srclen - i, &tmp);
			dst_char = cpu_to_le16(tmp);

			/*
			 * if no match, use question mark, which at least in
			 * some cases serves as wild card
			 */
			if (charlen < 1) {
				temp = 0x003f;
				dst_char = cpu_to_le16(0x003f);
				charlen = 1;
			}
			len_remaining -= charlen;
			/*
			 * character may take more than one byte in the source
			 * string, but will take exactly two bytes in the
@@ -324,9 +324,8 @@ cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
			i += charlen;
			continue;
		}
		put_unaligned_le16(temp, &target[j]);
		put_unaligned(dst_char, &target[j]);
		i++; /* move to next char in source string */
		len_remaining--;
	}

ctoUCS_out:
Loading