diff options
author | Jiri Kosina <jkosina@suse.cz> | 2013-01-29 04:48:30 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-01-29 04:48:30 -0500 |
commit | 617677295b53a40d0e54aac4cbbc216ffbc755dd (patch) | |
tree | 51b9e87213243ed5efff252c8e8d8fec4eebc588 /fs/binfmt_script.c | |
parent | 5c8d1b68e01a144813e38795fe6dbe7ebb506131 (diff) | |
parent | 6abb7c25775b7fb2225ad0508236d63ca710e65f (diff) |
Merge branch 'master' into for-next
Conflicts:
drivers/devfreq/exynos4_bus.c
Sync with Linus' tree to be able to apply patches that are
against newer code (mvneta).
Diffstat (limited to 'fs/binfmt_script.c')
-rw-r--r-- | fs/binfmt_script.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c index d3b8c1f63155..5027a3e14922 100644 --- a/fs/binfmt_script.c +++ b/fs/binfmt_script.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
16 | 16 | ||
17 | static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) | 17 | static int load_script(struct linux_binprm *bprm) |
18 | { | 18 | { |
19 | const char *i_arg, *i_name; | 19 | const char *i_arg, *i_name; |
20 | char *cp; | 20 | char *cp; |
@@ -22,15 +22,13 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) | |||
22 | char interp[BINPRM_BUF_SIZE]; | 22 | char interp[BINPRM_BUF_SIZE]; |
23 | int retval; | 23 | int retval; |
24 | 24 | ||
25 | if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || | 25 | if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) |
26 | (bprm->recursion_depth > BINPRM_MAX_RECURSION)) | ||
27 | return -ENOEXEC; | 26 | return -ENOEXEC; |
28 | /* | 27 | /* |
29 | * This section does the #! interpretation. | 28 | * This section does the #! interpretation. |
30 | * Sorta complicated, but hopefully it will work. -TYT | 29 | * Sorta complicated, but hopefully it will work. -TYT |
31 | */ | 30 | */ |
32 | 31 | ||
33 | bprm->recursion_depth++; | ||
34 | allow_write_access(bprm->file); | 32 | allow_write_access(bprm->file); |
35 | fput(bprm->file); | 33 | fput(bprm->file); |
36 | bprm->file = NULL; | 34 | bprm->file = NULL; |
@@ -82,7 +80,9 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) | |||
82 | retval = copy_strings_kernel(1, &i_name, bprm); | 80 | retval = copy_strings_kernel(1, &i_name, bprm); |
83 | if (retval) return retval; | 81 | if (retval) return retval; |
84 | bprm->argc++; | 82 | bprm->argc++; |
85 | bprm->interp = interp; | 83 | retval = bprm_change_interp(interp, bprm); |
84 | if (retval < 0) | ||
85 | return retval; | ||
86 | 86 | ||
87 | /* | 87 | /* |
88 | * OK, now restart the process with the interpreter's dentry. | 88 | * OK, now restart the process with the interpreter's dentry. |
@@ -95,7 +95,7 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) | |||
95 | retval = prepare_binprm(bprm); | 95 | retval = prepare_binprm(bprm); |
96 | if (retval < 0) | 96 | if (retval < 0) |
97 | return retval; | 97 | return retval; |
98 | return search_binary_handler(bprm,regs); | 98 | return search_binary_handler(bprm); |
99 | } | 99 | } |
100 | 100 | ||
101 | static struct linux_binfmt script_format = { | 101 | static struct linux_binfmt script_format = { |