Red Hat Bugzilla – Bug 155104
"bad interpreter" error running script
Last modified: 2007-11-30 17:11:04 EST
Description of problem:
When trying to execute any shell script, it fails with "bad interpreter" error:
[ricardo@hal musica]$ ./listas.sh
bash: ./listas.sh: /bin/sh: bad interpreter: Permission denied
However, if i copy the very same script to another directory (like /tmp or ~/),
The only difference that occurs to me between the two dirrectories is that the
one which fails is on an external usb harddrive.
Version-Release number of selected component (if applicable):
[ricardo@hal musica]$ rpm -q bash kernel
What does 'mount' say?
[ricardo@hal ~]$ mount
/dev/hda3 on / type ext3 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /boot type ext3 (rw)
/dev/hda4 on /mnt/aux5 type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/hdc1 on /mnt/aux8 type ext3 (rw)
/dev/sda1 on /mnt/ext1 type ext3 (rw,noexec,nosuid,nodev)
/dev/sda2 on /mnt/ext2 type vfat (rw,noexec,nosuid,nodev,dmask=000,fmask=111)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
Now I see it says "noexec" as an option. But why? In /etc/fstab I don't have it:
/dev/sda1 /mnt/ext1 auto user,defaults 0 0
If I add "exec" after defaults, it works. So now I'm not sure if this is a bug
or the intended behavior, but if it is intended, it is very confusing (why
should this act this way?).
Also, the error message is really wrong and misleading.
Thank you for looking at this.
The error message is entirely correct: you don't have permission to execute the
External storage is intended to be mounted noexec.