Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26138
b: refs/heads/master
c: 296034f
h: refs/heads/master
v: v3
  • Loading branch information
Steve French committed Apr 21, 2006
1 parent ef551ec commit 3e88a2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0bd4fa977f81c914eb8bada00284d0933825900e
refs/heads/master: 296034f7de8bdf111984ce1630ac598a9c94a253
14 changes: 14 additions & 0 deletions trunk/fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,20 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
pTcon = cifs_sb->tcon;

/*
* Don't allow the separator character in a path component.
* The VFS will not allow "/", but "\" is allowed by posix.
*/
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
int i;
for (i = 0; i < direntry->d_name.len; i++)
if (direntry->d_name.name[i] == '\\') {
cFYI(1, ("Invalid file name"));
FreeXid(xid);
return ERR_PTR(-EINVAL);
}
}

/* can not grab the rename sem here since it would
deadlock in the cases (beginning of sys_rename itself)
in which we already have the sb rename sem */
Expand Down

0 comments on commit 3e88a2f

Please sign in to comment.