Index: usr/src/uts/common/exec/shbin/shbin.c =================================================================== --- usr/src/uts/common/exec/shbin/shbin.c (revision 1632) +++ usr/src/uts/common/exec/shbin/shbin.c (working copy) @@ -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. */ @@ -216,6 +216,16 @@ 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 */