[pre4-4] Paper bag: chdir does not follow symlinks

From: Chip Salzenberg (chip@valinux.com)
Date: Wed Apr 05 2000 - 02:35:02 EST


According to Tony Lofthouse:
> linux/fs/open.c:
> - dentry = lookup_dentry(name, NULL, 0);
> + dentry = lookup_dentry(name, NULL, LOOKUP_FOLLOW);

My experiments indicate that LOOKUP_DIRECTORY is also needed:

Index: linux/fs/open.c
@@ -344,5 +344,5 @@ asmlinkage long sys_chdir(const char * f
                 goto out;
 
- dentry = lookup_dentry(name, NULL, LOOKUP_FOLLOW);
+ dentry = lookup_dentry(name, NULL, LOOKUP_DIRECTORY | LOOKUP_FOLLOW);
         putname(name);
         error = PTR_ERR(dentry);

-- 
Chip Salzenberg              - a.k.a. -              <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:14 EST