printk(KERN_WARNING "CIFS: netbiosname longer than 15 and was truncated.\n"); 
printk(KERN_WARNING "CIFS: netbiosname longer than 15 truncated.\n"); } } else if (strnicmp(data, "servern", 7) == 0) { /* servernetbiosname specified override *SMBSERVER */ if (!value || !*value || (*value == ' ')) { cFYI(1,("empty server netbiosname specified")); } else { /* last byte, type, is 0x20 for servr type */ memset(vol->target_rfc1001_name,0x20,16);  for(i=0;i<15;i++) { /* BB are there cases in which a comma can be valid in this workstation netbios name (and need special handling)? */  /* user or mount helper must uppercase netbiosname */ if (value[i]==0) break; else vol->target_rfc1001_name[i] = value[i]; } /* The string has 16th byte zero still from set at top of the function  */ if((i==15) && (value[i] != 0)) printk(KERN_WARNING "CIFS: server netbiosname longer than 15 truncated.\n"); 
cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol){	char *value;	char *data;	unsigned int  temp_len, i, j;	char separator[2];	separator[0] = ',';	separator[1] = 0; 	memset(vol->source_rfc1001_name,0x20,15);	for(i=0;i < strnlen(system_utsname.nodename,15);i++) {		/* does not have to be a perfect mapping since the field is		informational, only used for servers that do not support		port 445 and it can be overridden at mount time */		vol->source_rfc1001_name[i] = 			toupper(system_utsname.nodename[i]);	}	vol->source_rfc1001_name[15] = 0;	vol->linux_uid = current->uid;	/* current->euid instead? */	vol->linux_gid = current->gid;	vol->dir_mode = S_IRWXUGO;	/* 2767 perms indicate mandatory locking support */	vol->file_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP);	/* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */	vol->rw = TRUE;	/* default is always to request posix paths. */	vol->posix_paths = 1;	if (!options)		return 1;	if(strncmp(options,"sep=",4) == 0) {		if(options[4] != 0) {			separator[0] = options[4];			options += 5;		} else {			cFYI(1,("Null separator not allowed"));		}	}			while ((data = strsep(&options, separator)) != NULL) {		if (!*data)			continue;		if ((value = strchr(data, '=')) != NULL)			*value++ = '\0';		if (strnicmp(data, "user_xattr",10) == 0) {/*parse before user*/			vol->no_xattr = 0;		} else if (strnicmp(data, "nouser_xattr",12) == 0) {			vol->no_xattr = 1;		} else if (strnicmp(data, "user", 4) == 0) {			if (!value || !*value) {				printk(KERN_WARNING				       "CIFS: invalid or missing username\n");				return 1;	/* needs_arg; */			}			if (strnlen(value, 200) < 200) {				vol->username = value;			} else {				printk(KERN_WARNING "CIFS: username too long\n");				return 1;			}		} else if (strnicmp(data, "pass", 4) == 0) {			if (!value) {				vol->password = NULL;				continue;			} else if(value[0] == 0) {				/* check if string begins with double comma				   since that would mean the password really				   does start with a comma, and would not				   indicate an empty string */				if(value[1] != separator[0]) {					vol->password = NULL;					continue;				}			}			temp_len = strlen(value);			/* removed password length check, NTLM passwords				can be arbitrarily long */			/* if comma in password, the string will be 			prematurely null terminated.  Commas in password are			specified across the cifs mount interface by a double			comma ie ,, and a comma used as in other cases ie ','			as a parameter delimiter/separator is single and due			to the strsep above is temporarily zeroed. */			/* NB: password legally can have multiple commas and			the only illegal character in a password is null */			if ((value[temp_len] == 0) && 			    (value[temp_len+1] == separator[0])) {				/* reinsert comma */				value[temp_len] = separator[0];				temp_len+=2;  /* move after the second comma */				while(value[temp_len] != 0)  {					if (value[temp_len] == separator[0]) {						if (value[temp_len+1] == 						     separator[0]) {						/* skip second comma */							temp_len++;						} else { 						/* single comma indicating start							 of next parm */							break;						}					}					temp_len++;				}				if(value[temp_len] == 0) {					options = NULL;				} else {					value[temp_len] = 0;					/* point option to start of next parm */					options = value + temp_len + 1;				}				/* go from value to value + temp_len condensing 				double commas to singles. Note that this ends up				allocating a few bytes too many, which is ok */				vol->password = kcalloc(1, temp_len, GFP_KERNEL);				if(vol->password == NULL) {					printk("CIFS: no memory for pass\n");					return 1;				}				for(i=0,j=0;i<temp_len;i++,j++) {					vol->password[j] = value[i];					if(value[i] == separator[0]						&& value[i+1] == separator[0]) {						/* skip second comma */						i++;					}				}				vol->password[j] = 0;			} else {				vol->password = kcalloc(1, temp_len+1, GFP_KERNEL);				if(vol->password == NULL) {					printk("CIFS: no memory for pass\n");					return 1;				}				strcpy(vol->password, value);			}		} else if (strnicmp(data, "ip", 2) == 0) {			if (!value || !*value) {				vol->UNCip = NULL;			} else if (strnlen(value, 35) < 35) {				vol->UNCip = value;			} else {				printk(KERN_WARNING "CIFS: ip address too long\n");				return 1;			}		} else if ((strnicmp(data, "unc", 3) == 0)			   || (strnicmp(data, "target", 6) == 0)			   || (strnicmp(data, "path", 4) == 0)) {			if (!value || !*value) {				printk(KERN_WARNING				       "CIFS: invalid path to network resource\n");				return 1;	/* needs_arg; */			}			if ((temp_len = strnlen(value, 300)) < 300) {				vol->UNC = kmalloc(temp_len+1,GFP_KERNEL);				if(vol->UNC == NULL)					return 1;				strcpy(vol->UNC,value);				if (strncmp(vol->UNC, "//", 2) == 0) {					vol->UNC[0] = '\\';					vol->UNC[1] = '\\';				} else if (strncmp(vol->UNC, "\\\\", 2) != 0) {	                   					printk(KERN_WARNING					       "CIFS: UNC Path does not begin with // or \\\\ \n");					return 1;				}			} else {				printk(KERN_WARNING "CIFS: UNC name too long\n");				return 1;			}		} else if ((strnicmp(data, "domain", 3) == 0)			   || (strnicmp(data, "workgroup", 5) == 0)) {			if (!value || !*value) {				printk(KERN_WARNING "CIFS: invalid domain name\n");				return 1;	/* needs_arg; */			}			/* BB are there cases in which a comma can be valid in			a domain name and need special handling? */			if (strnlen(value, 65) < 65) {				vol->domainname = value;				cFYI(1, ("Domain name set"));			} else {				printk(KERN_WARNING "CIFS: domain name too long\n");				return 1;			}		} else if (strnicmp(data, "iocharset", 9) == 0) {			if (!value || !*value) {				printk(KERN_WARNING "CIFS: invalid iocharset specified\n");				return 1;	/* needs_arg; */			}			if (strnlen(value, 65) < 65) {				if(strnicmp(value,"default",7))					vol->iocharset = value;				/* if iocharset not set load_nls_default used by caller */				cFYI(1, ("iocharset set to %s",value));			} else {				printk(KERN_WARNING "CIFS: iocharset name too long.\n");				return 1;			}		} else if (strnicmp(data, "uid", 3) == 0) {			if (value && *value) {				vol->linux_uid =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "gid", 3) == 0) {			if (value && *value) {				vol->linux_gid =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "file_mode", 4) == 0) {			if (value && *value) {				vol->file_mode =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "dir_mode", 4) == 0) {			if (value && *value) {				vol->dir_mode =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "dirmode", 4) == 0) {			if (value && *value) {				vol->dir_mode =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "port", 4) == 0) {			if (value && *value) {				vol->port =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "rsize", 5) == 0) {			if (value && *value) {				vol->rsize =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "wsize", 5) == 0) {			if (value && *value) {				vol->wsize =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "sockopt", 5) == 0) {			if (value && *value) {				vol->sockopt =					simple_strtoul(value, &value, 0);			}		} else if (strnicmp(data, "netbiosname", 4) == 0) {			if (!value || !*value || (*value == ' ')) {				cFYI(1,("invalid (empty) netbiosname specified"));			} else {				memset(vol->source_rfc1001_name,0x20,15);				for(i=0;i<15;i++) {				/* BB are there cases in which a comma can be 				valid in this workstation netbios name (and need				special handling)? */				/* We do not uppercase netbiosname for user */					if (value[i]==0)						break;					else 						vol->source_rfc1001_name[i] = value[i];				}				/* The string has 16th byte zero still from				set at top of the function  */				if((i==15) && (value[i] != 0))					printk(KERN_WARNING "CIFS: netbiosname longer than 15 and was truncated.\n");			}		} else if (strnicmp(data, "credentials", 4) == 0) {			/* ignore */		} else if (strnicmp(data, "version", 3) == 0) {			/* ignore */		} else if (strnicmp(data, "guest",5) == 0) {			/* ignore */		} else if (strnicmp(data, "rw", 2) == 0) {			vol->rw = TRUE;		} else if ((strnicmp(data, "suid", 4) == 0) ||				   (strnicmp(data, "nosuid", 6) == 0) ||				   (strnicmp(data, "exec", 4) == 0) ||				   (strnicmp(data, "noexec", 6) == 0) ||				   (strnicmp(data, "nodev", 5) == 0) ||				   (strnicmp(data, "noauto", 6) == 0) ||				   (strnicmp(data, "dev", 3) == 0)) {			/*  The mount tool or mount.cifs helper (if present)				uses these opts to set flags, and the flags are read				by the kernel vfs layer before we get here (ie				before read super) so there is no point trying to				parse these options again and set anything and it				is ok to just ignore them */			continue;		} else if (strnicmp(data, "ro", 2) == 0) {			vol->rw = FALSE;		} else if (strnicmp(data, "hard", 4) == 0) {			vol->retry = 1;		} else if (strnicmp(data, "soft", 4) == 0) {			vol->retry = 0;		} else if (strnicmp(data, "perm", 4) == 0) {			vol->noperm = 0;		} else if (strnicmp(data, "noperm", 6) == 0) {			vol->noperm = 1;		} else if (strnicmp(data, "mapchars", 8) == 0) {			vol->remap = 1;		} else if (strnicmp(data, "nomapchars", 10) == 0) {			vol->remap = 0;                } else if (strnicmp(data, "sfu", 3) == 0) {                        vol->sfu_emul = 1;                } else if (strnicmp(data, "nosfu", 5) == 0) {                        vol->sfu_emul = 0;		} else if (strnicmp(data, "posixpaths", 10) == 0) {			vol->posix_paths = 1;		} else if (strnicmp(data, "noposixpaths", 12) == 0) {			vol->posix_paths = 0;                } else if (strnicmp(data, "nocase", 6) == 0) {                        vol->nocase = 1;		} else if (strnicmp(data, "brl", 3) == 0) {			vol->nobrl =  0;		} else if (strnicmp(data, "nobrl", 5) == 0) {			vol->nobrl =  1;			/* turn off mandatory locking in mode			if remote locking is turned off since the			local vfs will do advisory */			if(vol->file_mode == (S_IALLUGO & ~(S_ISUID | S_IXGRP)))				vol->file_mode = S_IALLUGO;		} else if (strnicmp(data, "setuids", 7) == 0) {			vol->setuids = 1;		} else if (strnicmp(data, "nosetuids", 9) == 0) {			vol->setuids = 0;		} else if (strnicmp(data, "nohard", 6) == 0) {			vol->retry = 0;		} else if (strnicmp(data, "nosoft", 6) == 0) {			vol->retry = 1;		} else if (strnicmp(data, "nointr", 6) == 0) {			vol->intr = 0;		} else if (strnicmp(data, "intr", 4) == 0) {			vol->intr = 1;		} else if (strnicmp(data, "serverino",7) == 0) {			vol->server_ino = 1;		} else if (strnicmp(data, "noserverino",9) == 0) {			vol->server_ino = 0;		} else if (strnicmp(data, "acl",3) == 0) {			vol->no_psx_acl = 0;		} else if (strnicmp(data, "noacl",5) == 0) {			vol->no_psx_acl = 1;		} else if (strnicmp(data, "direct",6) == 0) {			vol->direct_io = 1;		} else if (strnicmp(data, "forcedirectio",13) == 0) {			vol->direct_io = 1;		} else if (strnicmp(data, "in6_addr",8) == 0) {			if (!value || !*value) {				vol->in6_addr = NULL;			} else if (strnlen(value, 49) == 48) {				vol->in6_addr = value;			} else {				printk(KERN_WARNING "CIFS: ip v6 address not 48 characters long\n");				return 1;			}		} else if (strnicmp(data, "noac", 4) == 0) {			printk(KERN_WARNING "CIFS: Mount option noac not supported. Instead set /proc/fs/cifs/LookupCacheEnabled to 0\n");		} else			printk(KERN_WARNING "CIFS: Unknown mount option %s\n",data);	}	if (vol->UNC == NULL) {		if(devname == NULL) {			printk(KERN_WARNING "CIFS: Missing UNC name for mount target\n");			return 1;		}		if ((temp_len = strnlen(devname, 300)) < 300) {			vol->UNC = kmalloc(temp_len+1,GFP_KERNEL);			if(vol->UNC == NULL)				return 1;			strcpy(vol->UNC,devname);			if (strncmp(vol->UNC, "//", 2) == 0) {				vol->UNC[0] = '\\';				vol->UNC[1] = '\\';			} else if (strncmp(vol->UNC, "\\\\", 2) != 0) {				printk(KERN_WARNING "CIFS: UNC Path does not begin with // or \\\\ \n");				return 1;			}		} else {			printk(KERN_WARNING "CIFS: UNC name too long\n");			return 1;		}	}	if(vol->UNCip == NULL)		vol->UNCip = &vol->UNC[2];	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a10faeb2a3e266385cc334fe9af76e08e5e4330f/connect.c/clean/fs/cifs/connect.c