patch-2.1.22 linux/fs/namei.c

Next file: linux/fs/ncpfs/inode.c
Previous file: linux/fs/fat/misc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.21/linux/fs/namei.c linux/fs/namei.c
@@ -17,6 +17,7 @@
 #include <linux/mm.h>
 
 #include <asm/uaccess.h>
+#include <asm/unaligned.h>
 
 #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE])
 
@@ -162,7 +163,7 @@
 		return -ENOENT;
 /* check permissions before traversing mount-points */
 	perm = permission(dir,MAY_EXEC);
-	if (len==2 && name[0] == '.' && name[1] == '.') {
+	if (len==2 && get_unaligned((u16 *) name) == 0x2e2e) {
 		if (dir == current->fs->root) {
 			*result = dir;
 			return 0;
@@ -215,7 +216,7 @@
 static int dir_namei(const char *pathname, int *namelen, const char **name,
                      struct inode * base, struct inode **res_inode)
 {
-	char c;
+	unsigned char c;
 	const char * thisname;
 	int len,error;
 	struct inode * inode;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov