Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155104 - "bad interpreter" error running script
Summary: "bad interpreter" error running script
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-04-16 10:32 UTC by Ricardo Fernández Pascual
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-25 11:59:16 UTC


Attachments (Terms of Use)

Description Ricardo Fernández Pascual 2005-04-16 10:32:49 UTC
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 ~/),
it works! 

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
bash-3.0-17
kernel-2.6.11-1.14_FC3

How reproducible:
Always.

Comment 1 Tim Waugh 2005-04-17 11:27:23 UTC
What does 'mount' say?

Comment 2 Ricardo Fernández Pascual 2005-04-22 19:06:29 UTC
It says:

[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)
[ricardo@hal ~]$

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.

Comment 3 Tim Waugh 2005-04-25 11:59:16 UTC
The error message is entirely correct: you don't have permission to execute the
interpreted script.

External storage is intended to be mounted noexec.


Note You need to log in before you can comment on or make changes to this bug.