Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / smbfs / dir.c
index c6c33e1..70d9c5a 100644 (file)
@@ -34,7 +34,7 @@ static int smb_rename(struct inode *, struct dentry *,
 static int smb_make_node(struct inode *,struct dentry *,int,dev_t);
 static int smb_link(struct dentry *, struct inode *, struct dentry *);
 
-struct file_operations smb_dir_operations =
+const struct file_operations smb_dir_operations =
 {
        .read           = generic_read_dir,
        .readdir        = smb_readdir,
@@ -209,6 +209,8 @@ init_cache:
        ctl.valid  = 1;
 read_really:
        result = server->ops->readdir(filp, dirent, filldir, &ctl);
+       if (result == -ERESTARTSYS && page)
+               ClearPageUptodate(page);
        if (ctl.idx == -1)
                goto invalid_cache;     /* retry */
        ctl.head.end = ctl.fpos - 1;
@@ -217,7 +219,8 @@ finished:
        if (page) {
                cache->head = ctl.head;
                kunmap(page);
-               SetPageUptodate(page);
+               if (result != -ERESTARTSYS)
+                       SetPageUptodate(page);
                unlock_page(page);
                page_cache_release(page);
        }
@@ -431,6 +434,11 @@ smb_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
        if (dentry->d_name.len > SMB_MAXNAMELEN)
                goto out;
 
+       /* Do not allow lookup of names with backslashes in */
+       error = -EINVAL;
+       if (memchr(dentry->d_name.name, '\\', dentry->d_name.len))
+               goto out;
+
        lock_kernel();
        error = smb_proc_getattr(dentry, &finfo);
 #ifdef SMBFS_PARANOIA