exec.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff -u --recursive --new-file --show-c-function linux-2.6.1-01-fix_commit/fs/exec.c linux-2.6.1-02-fix_intent/fs/exec.c --- linux-2.6.1-01-fix_commit/fs/exec.c 2004-01-01 21:17:10.000000000 -0500 +++ linux-2.6.1-02-fix_intent/fs/exec.c 2004-01-03 12:27:16.000000000 -0500 @@ -121,7 +121,7 @@ asmlinkage long sys_uselib(const char __ struct nameidata nd; int error; - nd.intent.open.flags = O_RDONLY; + nd.intent.open.flags = FMODE_READ; error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd); if (error) goto out; @@ -471,8 +471,12 @@ static inline void free_arg_pages(struct struct file *open_exec(const char *name) { struct nameidata nd; - int err = path_lookup(name, LOOKUP_FOLLOW, &nd); - struct file *file = ERR_PTR(err); + int err; + struct file *file; + + nd.intent.open.flags = FMODE_READ; + err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd); + file = ERR_PTR(err); if (!err) { struct inode *inode = nd.dentry->d_inode;