All of lore.kernel.org
 help / color / mirror / Atom feed
* Executability problem
@ 2005-08-30 13:28 Kris Van Bruwaene
  2005-08-30 13:48 ` Sander
  2005-08-30 18:21 ` michael chang
  0 siblings, 2 replies; 8+ messages in thread
From: Kris Van Bruwaene @ 2005-08-30 13:28 UTC (permalink / raw)
  To: reiserfs-list

I recently discovered that scripts have become non-executable on my reiserfs share, even though the -x flags are set:
root@A00012344:/home/kris# cat tst
#! /usr/bin/perl -w
print "Hello world\n";
root@A00012344:/home/kris# ./tst
bash: ./tst: /usr/bin/perl: bad interpreter: Toegang geweigerd #(=Access denied)
root@A00012344:/home/kris# perl tst
Hello world
root@A00012344:/home/kris# cp tst /tmp
root@A00012344:/home/kris# cd /tmp
root@A00012344:/tmp# ./tst
Hello world
root@A00012344:/tmp# ls tst -l
-rwxr-xr-x  1 root root 43 2005-08-30 15:19 tst
root@A00012344:/tmp# ls /home/kris/tst -l
-rwxrwxr-x  1 kris users 43 2005-08-25 11:00 /home/kris/tst
root@A00012344:/tmp# file tst
tst: perl script text executable
root@A00012344:/tmp# file /home/kris/tst
/home/kris/tst: perl script text executable

/tmp is on an ext3 share (same machine). The perl help unable to help, looks like a reiserfs problem. Some other info:
root@A00012344:/tmp# cat /etc/fstab | grep home
/dev/hda3 /home reiserfs defaults,exec,user,auto 0 0

(I just added the exec and did a remount to try but it didn't help, it's not really necessary)

root@A00012344:/tmp# uname -a
Linux A00012344 2.6.7 #2 SMP Wed Jul 28 04:25:36 CEST 2004 i686 GNU/Linux

Thx

Kris
*** Disclaimer ***

Deze e-mail, met eventuele bijlagen, is alleen bestemd voor de persoon of organisatie aan wie hij gericht is en, in voorkomend geval, alleen voor het daarin opgegeven doel of gebruik. Hij kan vertrouwelijke informatie bevatten en/of persoonlijke standpunten die niet noodzakelijk met die van de VRT stroken. Elk gebruik van deze informatie (zoals bewerken, doorsturen, geheel of gedeeltelijk reproduceren of verspreiden in welke vorm ook) door anderen dan de geadresseerde, is verboden. Hebt U deze e-mail per vergissing ontvangen, meld dat dan a.u.b. aan de VRT en wis de e-mail.
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Executability problem
  2005-08-30 13:28 Executability problem Kris Van Bruwaene
@ 2005-08-30 13:48 ` Sander
  2005-08-30 18:21 ` michael chang
  1 sibling, 0 replies; 8+ messages in thread
From: Sander @ 2005-08-30 13:48 UTC (permalink / raw)
  To: Kris Van Bruwaene; +Cc: reiserfs-list

Kris, please linewrap after 72 chars and refrain from posting
non-relevant signatures.

Kris Van Bruwaene wrote (ao):
> I recently discovered that scripts have become non-executable on my reiserfs share, even though the -x flags are set:
> root@A00012344:/home/kris# cat tst
> #! /usr/bin/perl -w
> print "Hello world\n";
> root@A00012344:/home/kris# ./tst
> bash: ./tst: /usr/bin/perl: bad interpreter: Toegang geweigerd #(=Access denied)
> root@A00012344:/home/kris# perl tst
> Hello world
> root@A00012344:/home/kris# cp tst /tmp
> root@A00012344:/home/kris# cd /tmp
> root@A00012344:/tmp# ./tst
> Hello world
> root@A00012344:/tmp# ls tst -l
> -rwxr-xr-x  1 root root 43 2005-08-30 15:19 tst
> root@A00012344:/tmp# ls /home/kris/tst -l
> -rwxrwxr-x  1 kris users 43 2005-08-25 11:00 /home/kris/tst

Can you try:
which perl
ls -l `which perl`
perl -wc /home/kris/tst
/home/kris/tst

and send the output?

-- 
Humilis IT Services and Solutions
http://www.humilis.net

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Executability problem
  2005-08-30 13:28 Executability problem Kris Van Bruwaene
  2005-08-30 13:48 ` Sander
@ 2005-08-30 18:21 ` michael chang
       [not found]   ` <43155434.3030408@vrt.be>
  2005-09-01  7:13   ` Nikita
  1 sibling, 2 replies; 8+ messages in thread
From: michael chang @ 2005-08-30 18:21 UTC (permalink / raw)
  To: Kris.VanBruwaene; +Cc: reiserfs-list

On 8/30/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> I recently discovered that scripts have become non-executable on my reiserfs share, even though the -x flags are set:
> root@A00012344:/home/kris# cat tst
> #! /usr/bin/perl -w
> print "Hello world\n";
> root@A00012344:/home/kris# ./tst
> bash: ./tst: /usr/bin/perl: bad interpreter: Toegang geweigerd #(=Access denied)

I believe the line should read
#!/usr/bin/perl -w
not 
#! /usr/bin/perl -w

[no space between "!" and first "/"]

unless that's a typo between output and your file.

-- 
~Mike
 - Just my two cents
 - No man is an island, and no man is unable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Executability problem
       [not found]     ` <b14e81f0050831063950019e67@mail.gmail.com>
@ 2005-08-31 13:40       ` michael chang
  0 siblings, 0 replies; 8+ messages in thread
From: michael chang @ 2005-08-31 13:40 UTC (permalink / raw)
  To: reiserfs-list

On 8/31/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> Both work for me, except on the reiserfs share...

I don't suppose your reiserfs share is mounted with noexec, is it?

Because that would explain the issue...

Check your fstab.

--
~Mike
 - Just my two cents
 - No man is an island, and no man is unable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Executability problem
  2005-08-30 18:21 ` michael chang
       [not found]   ` <43155434.3030408@vrt.be>
@ 2005-09-01  7:13   ` Nikita
       [not found]     ` <20050901133725.06b5d3c5.Kris.VanBruwaene@vrt.be>
  1 sibling, 1 reply; 8+ messages in thread
From: Nikita @ 2005-09-01  7:13 UTC (permalink / raw)
  To: michael chang; +Cc: reiserfs-list, Kris Van Bruwaene

michael chang writes:
 > On 8/30/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
 > > I recently discovered that scripts have become non-executable on my reiserfs share, even though the -x flags are set:
 > > root@A00012344:/home/kris# cat tst
 > > #! /usr/bin/perl -w
 > > print "Hello world\n";
 > > root@A00012344:/home/kris# ./tst
 > > bash: ./tst: /usr/bin/perl: bad interpreter: Toegang geweigerd #(=Access denied)
 > 
 > I believe the line should read
 > #!/usr/bin/perl -w
 > not 
 > #! /usr/bin/perl -w
 > 
 > [no space between "!" and first "/"]
 > 
 > unless that's a typo between output and your file.

Actually, space between shell-bang and the path to the interpreter is
perfectly legal in Linux.

Kris, what is the output of

$ cat /proc/mounts

?

 > 
 > -- 
 > ~Mike
 >  - Just my two cents
 >  - No man is an island, and no man is unable.
 > 

Nikita.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Executability problem
       [not found]         ` <20050901162300.6516ac34.Kris.VanBruwaene@vrt.be>
@ 2005-09-01 14:31           ` michael chang
       [not found]             ` <20050901163621.51d70dd1.Kris.VanBruwaene@vrt.be>
  0 siblings, 1 reply; 8+ messages in thread
From: michael chang @ 2005-09-01 14:31 UTC (permalink / raw)
  To: Kris Van Bruwaene, Reiserfs List

On 9/1/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> michael chang <thenewme91@gmail.com> schreef:
> 
> > On 9/1/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> > > Looks like you've hit it. How come it's noexec here and exec/defaults in /etc/fstab ??
> >
> > How are you mounting the filesystem? E.g. from a command line, or from
> > an init script; as root or as a user, etc.
> 
> It usually gets mounted at boot time, I suppose by an init script
> (I'm using Knoppix). But I just did (as root):
> root@A00012344:/home/kris# mount -o remount /home
> root@A00012344:/home/kris# cat /etc/fstab | grep home
> /dev/hda3 /home reiserfs defaults,exec,user,auto 0 0
> root@A00012344:/home/kris# cat /etc/mtab | grep home
> /dev/hda3 /home reiserfs rw,noexec,nosuid,nodev 0 0
> 
> ...and it's still noexec!?

try
"mount -o remount,exec /home"
or 
"umount /home; mount /home;"
(or both)

As for the knoppix init scripts... they're pretty restrictive.  Like
mounting things read only, AFAIK.

-- 
~Mike
 - Just my two cents
 - No man is an island, and no man is unable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Executability problem
       [not found]             ` <20050901163621.51d70dd1.Kris.VanBruwaene@vrt.be>
@ 2005-09-02  2:34               ` michael chang
       [not found]                 ` <4317F778.4010104@vrt.be>
  0 siblings, 1 reply; 8+ messages in thread
From: michael chang @ 2005-09-02  2:34 UTC (permalink / raw)
  To: Kris Van Bruwaene, Reiserfs List

On 9/1/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> michael chang <thenewme91@gmail.com> schreef:
> > "mount -o remount,exec /home"
> Bingo:
> root@A00012344:/home/kris# mount -o remount,exec /home
> root@A00012344:/home/kris# cat /etc/mtab | grep home
> /dev/hda3 /home reiserfs rw,nosuid,nodev 0 0
> exit
> [~]# ./tst
> Hello world

Of course, that still doesn't answer why Knoppix is mounting a
reiserfs partition as noexec even when the fstab says otherwise...
unless you changed the fstab and then not reboot afterwards?

But at least that's a decent "workaround", for lack of a better wording.

-- 
~Mike
 - Just my two cents
 - No man is an island, and no man is unable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Executability problem
       [not found]                 ` <4317F778.4010104@vrt.be>
@ 2005-09-02 15:45                   ` michael chang
  0 siblings, 0 replies; 8+ messages in thread
From: michael chang @ 2005-09-02 15:45 UTC (permalink / raw)
  To: Kris Van Bruwaene, Reiserfs List

On 9/2/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> michael chang wrote:
> >On 9/1/05, Kris Van Bruwaene <Kris.VanBruwaene@vrt.be> wrote:
> >>michael chang <thenewme91@gmail.com> schreef:
> >>>"mount -o remount,exec /home"
> >>>
> >>Bingo:
> >>root@A00012344:/home/kris# mount -o remount,exec /home
> >>root@A00012344:/home/kris# cat /etc/mtab | grep home
> >>/dev/hda3 /home reiserfs rw,nosuid,nodev 0 0
> >>exit
> >>[~]# ./tst
> >>Hello world
> >
> >Of course, that still doesn't answer why Knoppix is mounting a
> >reiserfs partition as noexec even when the fstab says otherwise...
> >unless you changed the fstab and then not reboot afterwards?
> >
> Of course not. All I did was add "exec" to the /home line in fstab without
> rebooting, but the "defaults" was there all the time.

IIRC, options in fstab are only read on boot, unless you're a regular
user mounting a partition with the "user"/"users" thingie...

> Another thing that puzzles me is: shouldn't "mount -o remount"
> read fstab as well?

AFAIK, no. "umount /mountpoint;mount /mountpoint" might. Logically,
you'd want to change fstab, and have the distro boot off that fstab. 
But then again, KNOPPIX is a live-cd -- this'd be painful.  Not to
mention AFAIK Knoppix autodetects partitions and creates a fstab on
boot; meaning that changes usually don't survive reboots.  Knoppix may
have modified defaults to mount noexec by default.  It might be easier
to use a different distro, installed on a HD, if possible (maybe
Ubuntu or Debian?).

Someone want to go verify and complain to the Knoppix people?  I think
the noexec thing, if enabled, is a security feature, though, and so
partitions are mounted ro/noexec/etc. by default.  Basically to
prevent idiotism, I suppose.

> >But at least that's a decent "workaround", for lack of a better wording.
> Right. Thanks again!
No problem.

-- 
~Mike
 - Just my two cents
 - No man is an island, and no man is unable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-09-02 15:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-30 13:28 Executability problem Kris Van Bruwaene
2005-08-30 13:48 ` Sander
2005-08-30 18:21 ` michael chang
     [not found]   ` <43155434.3030408@vrt.be>
     [not found]     ` <b14e81f0050831063950019e67@mail.gmail.com>
2005-08-31 13:40       ` michael chang
2005-09-01  7:13   ` Nikita
     [not found]     ` <20050901133725.06b5d3c5.Kris.VanBruwaene@vrt.be>
     [not found]       ` <b14e81f0050901071269f9a23c@mail.gmail.com>
     [not found]         ` <20050901162300.6516ac34.Kris.VanBruwaene@vrt.be>
2005-09-01 14:31           ` michael chang
     [not found]             ` <20050901163621.51d70dd1.Kris.VanBruwaene@vrt.be>
2005-09-02  2:34               ` michael chang
     [not found]                 ` <4317F778.4010104@vrt.be>
2005-09-02 15:45                   ` michael chang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.