Re: Shebang not working



On 03 Jan 2006 02:29:12 GMT, Abigail <abigail@xxxxxxxxxx> wrote:

>Sam CARMALT (scarmalt@xxxxxxxxxxxx) wrote on MMMMDVII September MCMXCIII
>in <URL:news:2hthr156j56j53ioc42hcjuq601qdlac09@xxxxxxx>:
>[] I'm having trouble launching a Perl script with the shebang operator.
>[] OS is SuSE 9.2 Professional. So far, I haven't had any helpful
>[] insights at comp.os.linux.suse, and hope this isn't too far from Perl
>[] to post here.
>[]
>[] Complete Perl script:
>[]
>[] #! /usr/bin/perl
>[]
>[] print "Hello, World\n";
>[]
>[] This is contained in a file of 3 lines, left-justified, created with
>[] vi. It is saved with a directory entry of
>[]
>[] -rwxrwxrwx 1 root root 44 Dec 31 15:32 hworld.pl
>[]
>[] In the /usr/bin directory, I find the following entry
>[]
>[] -rwxr-wr-w 3 root root 1160321 Oct 2 2004 perl
>[]
>[] which leads me to believe that permissions are OK.
>
>If your permissions read '-rwxr-wr-w' you have a serious problem.
>That shouldn't be possible. My guess is that the permission is
>'-rwxrw-rw-', which is also a serious problem - but one that's
>entirely your fault. It means you have a perl binary that's only
>executable by root, but that's writable by everyone! Can you say
>security hole large enough to drive a truck through?
>
>[] Now, here is how things work:
>[]
>[] #perl hworld.pl
>[] Hello, World
>[] #hworld.pl
>[] bash: hworld.pl: command not found
>[] #./hworld.pl
>[] bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
>[] # ./hworld.pl
>[] bash: ./hworld.pl: /usr/bin/perl: bad interpreter: Permission denied
>[] #. hworld
>[] bash: hworld: No such file or directory
>[] #. hworld.pl
>[] bash: print: command not found
>[] #
>
>Yup. Consistent with a permission of '-rwxrw-rw-'.
>
>The permission ought to be '-rwxr-xr-x'.
>
>[] From these I conclude that there is something going wrong with the
>[] shebang line and getting started. Any pointers as to what I need to
>[] change will be appreciated. (Obviously, I need to fix this in order
>[] to use Perl in a CGI environment :)].
>
>Perhaps you should hand in your super user licence, and first learn
>Unix before continueing.
>
>
>Abigail

Just a typo - should have been -rwxr-xr-x.

Problem was that disk was mounted rw instead of acl.

Regards
.