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

Commit 26c5e98e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] fix build warning
  [CIFS] Fixed build warning in is_ip
  [CIFS] cleanup cifsd completion
  [CIFS] Remove over-indented code in find_unc().
  [CIFS] fix typo
  [CIFS] Remove duplicate call to mode_to_acl
  [CIFS] convert usage of implicit booleans to bool
  [CIFS] fixed compatibility issue with samba refferal request
  [CIFS] Fix statfs formatting
  [CIFS] Adds to dns_resolver checking if the server name is an IP addr and skipping upcall in this case.
  [CIFS] Fix spelling mistake
  [CIFS] Update cifs version number
parents a9545ee3 af4b3c35
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
Version 1.53
------------

Version 1.52
Version 1.52
------------
------------
Fix oops on second mount to server when null auth is used.
Fix oops on second mount to server when null auth is used.
+5 −5
Original line number Original line Diff line number Diff line
@@ -460,8 +460,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
	unsigned char *sequence_end;
	unsigned char *sequence_end;
	unsigned long *oid = NULL;
	unsigned long *oid = NULL;
	unsigned int cls, con, tag, oidlen, rc;
	unsigned int cls, con, tag, oidlen, rc;
	int use_ntlmssp = FALSE;
	bool use_ntlmssp = false;
	int use_kerberos = FALSE;
	bool use_kerberos = false;


	*secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/
	*secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/


@@ -561,15 +561,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
					if (compare_oid(oid, oidlen,
					if (compare_oid(oid, oidlen,
							MSKRB5_OID,
							MSKRB5_OID,
							MSKRB5_OID_LEN))
							MSKRB5_OID_LEN))
						use_kerberos = TRUE;
						use_kerberos = true;
					else if (compare_oid(oid, oidlen,
					else if (compare_oid(oid, oidlen,
							     KRB5_OID,
							     KRB5_OID,
							     KRB5_OID_LEN))
							     KRB5_OID_LEN))
						use_kerberos = TRUE;
						use_kerberos = true;
					else if (compare_oid(oid, oidlen,
					else if (compare_oid(oid, oidlen,
							     NTLMSSP_OID,
							     NTLMSSP_OID,
							     NTLMSSP_OID_LEN))
							     NTLMSSP_OID_LEN))
						use_ntlmssp = TRUE;
						use_ntlmssp = true;


					kfree(oid);
					kfree(oid);
				}
				}
+14 −11
Original line number Original line Diff line number Diff line
@@ -93,15 +93,11 @@ static char *cifs_get_share_name(const char *node_name)
	/* find sharename end */
	/* find sharename end */
	pSep++;
	pSep++;
	pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC));
	pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC));
	if (!pSep) {
	if (pSep) {
		cERROR(1, ("%s:2 cant find share name in node name: %s",
			__func__, node_name));
		kfree(UNC);
		return NULL;
	}
		/* trim path up to sharename end
		/* trim path up to sharename end
	 *          * now we have share name in UNC */
		 * now we have share name in UNC */
		*pSep = 0;
		*pSep = 0;
	}


	return UNC;
	return UNC;
}
}
@@ -188,7 +184,7 @@ static char *compose_mount_options(const char *sb_mountdata,
		tkn_e = strchr(tkn_e+1, '\\');
		tkn_e = strchr(tkn_e+1, '\\');
		if (tkn_e) {
		if (tkn_e) {
			strcat(mountdata, ",prefixpath=");
			strcat(mountdata, ",prefixpath=");
			strcat(mountdata, tkn_e);
			strcat(mountdata, tkn_e+1);
		}
		}
	}
	}


@@ -244,7 +240,8 @@ static char *build_full_dfs_path_from_dentry(struct dentry *dentry)
		return NULL;
		return NULL;


	if (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS) {
	if (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS) {
		/* we should use full path name to correct working with DFS */
		int i;
		/* we should use full path name for correct working with DFS */
		l_max_len = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE+1) +
		l_max_len = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE+1) +
					strnlen(search_path, MAX_PATHCONF) + 1;
					strnlen(search_path, MAX_PATHCONF) + 1;
		tmp_path = kmalloc(l_max_len, GFP_KERNEL);
		tmp_path = kmalloc(l_max_len, GFP_KERNEL);
@@ -253,8 +250,14 @@ static char *build_full_dfs_path_from_dentry(struct dentry *dentry)
			return NULL;
			return NULL;
		}
		}
		strncpy(tmp_path, cifs_sb->tcon->treeName, l_max_len);
		strncpy(tmp_path, cifs_sb->tcon->treeName, l_max_len);
		strcat(tmp_path, search_path);
		tmp_path[l_max_len-1] = 0;
		tmp_path[l_max_len-1] = 0;
		if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
			for (i = 0; i < l_max_len; i++) {
				if (tmp_path[i] == '\\')
					tmp_path[i] = '/';
			}
		strncat(tmp_path, search_path, l_max_len - strlen(tmp_path));

		full_path = tmp_path;
		full_path = tmp_path;
		kfree(search_path);
		kfree(search_path);
	} else {
	} else {
+8 −8
Original line number Original line Diff line number Diff line
@@ -559,7 +559,7 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
				       const char *path, const __u16 *pfid)
				       const char *path, const __u16 *pfid)
{
{
	struct cifsFileInfo *open_file = NULL;
	struct cifsFileInfo *open_file = NULL;
	int unlock_file = FALSE;
	bool unlock_file = false;
	int xid;
	int xid;
	int rc = -EIO;
	int rc = -EIO;
	__u16 fid;
	__u16 fid;
@@ -586,10 +586,10 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
	cifs_sb = CIFS_SB(sb);
	cifs_sb = CIFS_SB(sb);


	if (open_file) {
	if (open_file) {
		unlock_file = TRUE;
		unlock_file = true;
		fid = open_file->netfid;
		fid = open_file->netfid;
	} else if (pfid == NULL) {
	} else if (pfid == NULL) {
		int oplock = FALSE;
		int oplock = 0;
		/* open file */
		/* open file */
		rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
		rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
				READ_CONTROL, 0, &fid, &oplock, NULL,
				READ_CONTROL, 0, &fid, &oplock, NULL,
@@ -604,7 +604,7 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,


	rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen);
	rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen);
	cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen));
	cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen));
	if (unlock_file == TRUE) /* find_readable_file increments ref count */
	if (unlock_file == true) /* find_readable_file increments ref count */
		atomic_dec(&open_file->wrtPending);
		atomic_dec(&open_file->wrtPending);
	else if (pfid == NULL) /* if opened above we have to close the handle */
	else if (pfid == NULL) /* if opened above we have to close the handle */
		CIFSSMBClose(xid, cifs_sb->tcon, fid);
		CIFSSMBClose(xid, cifs_sb->tcon, fid);
@@ -619,7 +619,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
				struct inode *inode, const char *path)
				struct inode *inode, const char *path)
{
{
	struct cifsFileInfo *open_file;
	struct cifsFileInfo *open_file;
	int unlock_file = FALSE;
	bool unlock_file = false;
	int xid;
	int xid;
	int rc = -EIO;
	int rc = -EIO;
	__u16 fid;
	__u16 fid;
@@ -640,10 +640,10 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,


	open_file = find_readable_file(CIFS_I(inode));
	open_file = find_readable_file(CIFS_I(inode));
	if (open_file) {
	if (open_file) {
		unlock_file = TRUE;
		unlock_file = true;
		fid = open_file->netfid;
		fid = open_file->netfid;
	} else {
	} else {
		int oplock = FALSE;
		int oplock = 0;
		/* open file */
		/* open file */
		rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
		rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
				WRITE_DAC, 0, &fid, &oplock, NULL,
				WRITE_DAC, 0, &fid, &oplock, NULL,
@@ -658,7 +658,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,


	rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen);
	rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen);
	cFYI(DBG2, ("SetCIFSACL rc = %d", rc));
	cFYI(DBG2, ("SetCIFSACL rc = %d", rc));
	if (unlock_file == TRUE)
	if (unlock_file)
		atomic_dec(&open_file->wrtPending);
		atomic_dec(&open_file->wrtPending);
	else
	else
		CIFSSMBClose(xid, cifs_sb->tcon, fid);
		CIFSSMBClose(xid, cifs_sb->tcon, fid);
+36 −36
Original line number Original line Diff line number Diff line
@@ -222,50 +222,50 @@ static int
cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
{
{
	struct super_block *sb = dentry->d_sb;
	struct super_block *sb = dentry->d_sb;
	int xid;
	struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
	struct cifsTconInfo *tcon = cifs_sb->tcon;
	int rc = -EOPNOTSUPP;
	int rc = -EOPNOTSUPP;
	struct cifs_sb_info *cifs_sb;
	int xid;
	struct cifsTconInfo *pTcon;


	xid = GetXid();
	xid = GetXid();


	cifs_sb = CIFS_SB(sb);
	pTcon = cifs_sb->tcon;

	buf->f_type = CIFS_MAGIC_NUMBER;
	buf->f_type = CIFS_MAGIC_NUMBER;


	/* instead could get the real value via SMB_QUERY_FS_ATTRIBUTE_INFO */
	/*
	buf->f_namelen = PATH_MAX; /* PATH_MAX may be too long - it would
	 * PATH_MAX may be too long - it would presumably be total path,
				      presumably be total path, but note
	 * but note that some servers (includinng Samba 3) have a shorter
				      that some servers (includinng Samba 3)
	 * maximum path.
				      have a shorter maximum path */
	 *
	 * Instead could get the real value via SMB_QUERY_FS_ATTRIBUTE_INFO.
	 */
	buf->f_namelen = PATH_MAX;
	buf->f_files = 0;	/* undefined */
	buf->f_files = 0;	/* undefined */
	buf->f_ffree = 0;	/* unlimited */
	buf->f_ffree = 0;	/* unlimited */


/* BB we could add a second check for a QFS Unix capability bit */
	/*
/* BB FIXME check CIFS_POSIX_EXTENSIONS Unix cap first FIXME BB */
	 * We could add a second check for a QFS Unix capability bit
    if ((pTcon->ses->capabilities & CAP_UNIX) && (CIFS_POSIX_EXTENSIONS &
	 */
			le64_to_cpu(pTcon->fsUnixInfo.Capability)))
	if ((tcon->ses->capabilities & CAP_UNIX) &&
	    rc = CIFSSMBQFSPosixInfo(xid, pTcon, buf);
	    (CIFS_POSIX_EXTENSIONS & le64_to_cpu(tcon->fsUnixInfo.Capability)))
		rc = CIFSSMBQFSPosixInfo(xid, tcon, buf);


    /* Only need to call the old QFSInfo if failed
	/*
    on newer one */
	 * Only need to call the old QFSInfo if failed on newer one,
    if (rc)
	 * e.g. by OS/2.
	if (pTcon->ses->capabilities & CAP_NT_SMBS)
	 **/
		rc = CIFSSMBQFSInfo(xid, pTcon, buf); /* not supported by OS2 */
	if (rc && (tcon->ses->capabilities & CAP_NT_SMBS))
		rc = CIFSSMBQFSInfo(xid, tcon, buf);


	/* Some old Windows servers also do not support level 103, retry with
	/*
	   older level one if old server failed the previous call or we
	 * Some old Windows servers also do not support level 103, retry with
	   bypassed it because we detected that this was an older LANMAN sess */
	 * older level one if old server failed the previous call or we
	 * bypassed it because we detected that this was an older LANMAN sess
	 */
	if (rc)
	if (rc)
		rc = SMBOldQFSInfo(xid, pTcon, buf);
		rc = SMBOldQFSInfo(xid, tcon, buf);
	/* int f_type;

	   __fsid_t f_fsid;
	   int f_namelen;  */
	/* BB get from info in tcon struct at mount time call to QFSAttrInfo */
	FreeXid(xid);
	FreeXid(xid);
	return 0;		/* always return success? what if volume is no
	return 0;
				   longer available? */
}
}


static int cifs_permission(struct inode *inode, int mask, struct nameidata *nd)
static int cifs_permission(struct inode *inode, int mask, struct nameidata *nd)
@@ -306,8 +306,8 @@ cifs_alloc_inode(struct super_block *sb)
	/* Until the file is open and we have gotten oplock
	/* Until the file is open and we have gotten oplock
	info back from the server, can not assume caching of
	info back from the server, can not assume caching of
	file data or metadata */
	file data or metadata */
	cifs_inode->clientCanCacheRead = FALSE;
	cifs_inode->clientCanCacheRead = false;
	cifs_inode->clientCanCacheAll = FALSE;
	cifs_inode->clientCanCacheAll = false;
	cifs_inode->vfs_inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */
	cifs_inode->vfs_inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */


	/* Can not set i_flags here - they get immediately overwritten
	/* Can not set i_flags here - they get immediately overwritten
@@ -940,7 +940,7 @@ static int cifs_oplock_thread(void *dummyarg)
				    rc = CIFSSMBLock(0, pTcon, netfid,
				    rc = CIFSSMBLock(0, pTcon, netfid,
					    0 /* len */ , 0 /* offset */, 0,
					    0 /* len */ , 0 /* offset */, 0,
					    0, LOCKING_ANDX_OPLOCK_RELEASE,
					    0, LOCKING_ANDX_OPLOCK_RELEASE,
					    0 /* wait flag */);
					    false /* wait flag */);
					cFYI(1, ("Oplock release rc = %d", rc));
					cFYI(1, ("Oplock release rc = %d", rc));
				}
				}
			} else
			} else
Loading