Also this is what ktrace says:
31688 ktrace RET ktrace 0
31688 ktrace CALL execve(0xcfbdb6fb,0xcfbdb674,0xcfbdb67c)
31688 ktrace NAMI "./exec1.sh"
31688 ktrace NAMI "/tmp/exec1.pl"
31688 ktrace RET execve -1 errno 8 Exec format error
at this stage I think this behaviour is OpenBSD specific, the only
question to the mailing list I have, can you confirm this?
Thanks.
On Tue, Nov 01, 2011 at 12:08:04AM +0000, Mikolaj Kucharski wrote:
> Dear all, before you reply to this thread please check the scripts first
> and read carefully the output.
>
> There is no permission denied, nor file not found errors, but execution
> of a script with wrong interpreter.
>
> The issue I'm reporting here maybe tricky for some of you, so please
> read carefuly before posting a reply.
>
> Also in terms of subject line, I'm talking about *script* in shebang
> line, not a *binary* in shebang line. /bin/sh or /usr/bin/perl is a
> binary, where exec1.sh and exec2.pl have *scripts* in shebang line.
>
> Thank you.
>
> On Mon, Oct 31, 2011 at 11:25:22PM +0000, Mikolaj Kucharski wrote:
> > Hi,
> >
> > Attached archive has small testing scripts to be extracted in /tmp.
> > There are 2 tests (exec1 and exec2) with 2 scripts each (4 scripts
> > total):
> >
> > test#1, openbsd:
> > $ /tmp/exec1.sh
> > exec1.sh executed
> >
> > test#1, linux:
> > # /tmp/exec1.sh
> > /tmp/exec1.pl executed
> > exec1.sh executed
> >
> >
> > test#2, openbsd:
> > $ /tmp/exec2.pl
> > /tmp/exec2.pl[3]: use: not found
> > /tmp/exec2.pl[4]: use: not found
> > /tmp/exec2.pl[6]: syntax error: `(' unexpected
> >
> > test#2, linux:
> > # /tmp/exec2.pl
> > exec2.sh executed
> > exec2.sh executed
> > exec2.sh executed
> > ^C
> >
> >
> > What I see is that OpenBSD doesn't support scripts in shebang line and
> > executes /bin/sh instead. Am I correct here?
> >
> >
> > PS. Please CC me in replies. Thanks.
> >
> > --
> > best regards
> > q#
>
> > -rwxr-xr-x 1 root wheel 129 Oct 31 23:10 exec1.pl
> > -rwxr-xr-x 1 root wheel 49 Oct 31 23:10 exec1.sh
> > -rwxr-xr-x 1 root wheel 161 Oct 31 23:10 exec2.pl
> > -rwxr-xr-x 1 root wheel 67 Oct 31 23:10 exec2.sh
>
>
> --
> best regards
> q#
--
best regards
q#