--- linux-2.1.46/fs/namei.c.~1~ Mon Jul 21 20:19:34 1997
+++ linux-2.1.46/fs/namei.c Wed Jul 23 00:22:24 1997
@@ -391,6 +391,9 @@
dentry = ERR_PTR(-ENOENT);
if (!base->d_inode)
break;
+ dentry = ERR_PTR(-ENOTDIR);
+ if (!S_ISDIR(base->d_inode->i_mode))
+ break;
this.name = name;
hash = init_name_hash();
len = 0;
@@ -421,9 +424,18 @@
break;
base = do_follow_link(base, dentry);
- if (c && !IS_ERR(base))
+ if (IS_ERR(base))
+ goto return_base;
+ if (c)
continue;
-
+ if (name[-1] == '/') {
+ dentry = ERR_PTR(-ENOENT);
+ if (!base->d_inode)
+ break;
+ dentry = ERR_PTR(-ENOTDIR);
+ if (!S_ISDIR(base->d_inode->i_mode))
+ break;
+ }
return_base:
return base;
}
-- Andreas Schwab "And now for something schwab@issan.informatik.uni-dortmund.de completely different"