patch-2.1.45 linux/fs/binfmt_script.c
Next file: linux/fs/buffer.c
Previous file: linux/fs/binfmt_misc.c
Back to the patch index
Back to the overall index
- Lines: 45
- Date:
Sun Jul 13 21:20:10 1997
- Orig file:
v2.1.44/linux/fs/binfmt_script.c
- Orig date:
Wed Apr 23 19:01:22 1997
diff -u --recursive --new-file v2.1.44/linux/fs/binfmt_script.c linux/fs/binfmt_script.c
@@ -15,8 +15,10 @@
static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs)
{
char *cp, *i_name, *i_name_start, *i_arg;
+ struct dentry * dentry;
char interp[128];
int retval;
+
if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang))
return -ENOEXEC;
/*
@@ -25,8 +27,8 @@
*/
bprm->sh_bang++;
- iput(bprm->inode);
- bprm->dont_iput=1;
+ dput(bprm->dentry);
+ bprm->dentry = NULL;
bprm->buf[127] = '\0';
if ((cp = strchr(bprm->buf, '\n')) == NULL)
@@ -75,14 +77,15 @@
if (!bprm->p)
return -E2BIG;
/*
- * OK, now restart the process with the interpreter's inode.
+ * OK, now restart the process with the interpreter's dentry.
*/
- retval = open_namei(interp, 0, 0, &bprm->inode, NULL);
- if (retval)
- return retval;
- bprm->dont_iput=0;
- retval=prepare_binprm(bprm);
- if(retval<0)
+ dentry = open_namei(interp, 0, 0);
+ if (IS_ERR(dentry))
+ return PTR_ERR(dentry);
+
+ bprm->dentry = dentry;
+ retval = prepare_binprm(bprm);
+ if (retval < 0)
return retval;
return search_binary_handler(bprm,regs);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov