diff options
author | Roland Mainz <roland.mainz@nrubsig.org> | 2009-07-29 13:13:08 -0700 |
---|---|---|
committer | Roland Mainz <roland.mainz@nrubsig.org> | 2009-07-29 13:13:08 -0700 |
commit | ce67301fa82625f5594913e8ab6abf9e0aa461d0 (patch) | |
tree | fa6f357cae5e5f12109ab01b75c11a99647cf39f /usr/src | |
parent | f4b94bde302dc950da6b4ec29936dd9a7b9d61ab (diff) | |
download | illumos-gate-ce67301fa82625f5594913e8ab6abf9e0aa461d0.tar.gz |
6862121 shbinexec kernel module defunct
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/exec/shbin/shbin.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/usr/src/uts/common/exec/shbin/shbin.c b/usr/src/uts/common/exec/shbin/shbin.c index 7720f9ea34..7fdd45793b 100644 --- a/usr/src/uts/common/exec/shbin/shbin.c +++ b/usr/src/uts/common/exec/shbin/shbin.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -46,8 +46,8 @@ */ #include <sys/modctl.h> -/* Prototype */ -int +/* Local prototypes */ +static int shbinexec( struct vnode *vp, struct execa *uap, @@ -151,7 +151,7 @@ checkshbinmagic(struct vnode *vp) return (0); } -int +static int shbinexec( struct vnode *vp, struct execa *uap, @@ -175,8 +175,6 @@ shbinexec( int fd = -1; int i; - (void) memset(&idata, 0, sizeof (idata)); - if (level) { /* Can't recurse */ error = ENOEXEC; goto bad; @@ -216,6 +214,16 @@ shbinexec( goto fail; } + /* + * Setup interpreter data + * "--" is passed to mark the end-of-arguments before adding + * the scripts file name, preventing problems when a + * a script's name starts with a '-' character. + */ + idata.intp = NULL; + idata.intp_name = shell_list[i]; + idata.intp_arg = "--"; + opath = args->pathname; args->pathname = resolvepn.pn_path; /* don't free resolvepn until we are done with args */ |