bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chmod g+w on directory causes script not to execute anymore


From: Markus Wahl
Subject: Re: chmod g+w on directory causes script not to execute anymore
Date: Sat, 31 May 2003 20:00:10 +0200

Hi

19:53:16 markus ~/test>\ls -ld /bin/sh ./myTest /bin/bash
-rwxr-xr-x    1 root     root       625516 Jan 14 20:33 /bin/bash
lrwxrwxrwx    1 root     root            4 May 23 21:52 /bin/sh -> bash
-rwxr-xr-x    1 root     users          24 May 30 10:09 ./myTest
19:53:26 markus ~/test>which bash
/bin/bash
19:53:31 markus ~/test>


I am using security-level 4 for mandrake msec. Hmmm.. maybe that has something 
to do with it. I will look into the msec proram...

-----Original Message-----
From: address@hidden (Bob Proulx) 
To: address@hidden
Date: Sat, 31 May 2003 11:47:04 -0600
Subject: Re: chmod g+w on directory causes script not to execute anymore

Markus Wahl wrote:
> Hello. I am really thrilled to get help this quick.
> Thanks a lot. I am including an expanded test run
> here:

Thank you for the much expanded report of information.  Unfortunately
I am at a loss to see what is going on or why it is behaving this
way.  It seems to be a very strange case.

> -rwxr-xr-x    1 root     root           24 May 29 20:44 myTest*
> 9:43:50 markus ~/test>cat myTest
> #!/bin/sh
> echo testing
> 9:43:53 markus ~/test>./myTest
> testing

First off, this looks fine.

> Then I do the change in another terminal as user root:
> 
> 9:43:14 root ~markus>echo $USER
> root
> 9:44:19 root ~markus>chmod g+w test/
> 9:44:25 root ~markus>which chmod
> /bin/chmod
> 9:44:27 root ~markus>
> 
> Then I continue in the first terminal as user markus:
> 
> 9:44:07 markus ~/test>echo $USER
> markus
> 9:44:40 markus ~/test>l .. | grep test
> drwxrwxr-x    2 root     users        4096 May 29 20:44 test/
> 9:44:49 markus ~/test>l
> total 4
> -rwxr-xr-x    1 root     root           24 May 29 20:44 myTest*
> 9:44:52 markus ~/test>./myTest
> ./myTest: Permission denied.
> 9:45:06 markus ~/test>

A wild guess.  Right here in your test what is the permissions of
/bin/sh?
  
  ls -ld /bin/sh ./myTest

> I might add that the user root has no problem
> executing the script:
> 
> 9:51:21 root ~markus/test>echo $USER
> root
> 9:51:22 root ~markus/test>l .. | grep test
> drwxrwxr-x    2 root     users        4096 May 30 09:50 test/
> 9:51:25 root ~markus/test>l
> total 4
> -rwxr-xr-x    1 root     root           24 May 30 09:50 myTest*
> 9:51:28 root ~markus/test>./myTest
> testing
> 9:51:34 root ~markus/test>

This is what led me to ask what the permissions of /bin/sh were.

> The user markus is in the group users. So I thought
> the script might execute if I removed the user from
> that group with the command:
> 
> usermod -G markus,adm,wheel,rpm,xgrp,ntools,ctools markus

I think this is not related.

> -rwxr-xr-x    1 root     root           24 May 30 09:50 myTest*
> 9:56:54 markus ~/test>./myTest
> ./myTest: Permission denied.
> 9:56:56 markus ~/test>

If you can read the file, the file I executable, the #!/bin/sh is
readable and executable then your script should run.

This is almost sounding like you are running in some "security
enhanced" mode such as se-linux or some such.  Personally I am not
very familiar with those and can't comment upon them.  But the
behavior is suggestion something which is not traditional behavior.

> So... can I blame microsoft? :)

:-)

Sorry I am unable to suggest anything further.  This is a problem for
which if someone were sitting at your keyboard they could probably
debug the questions much more easily than by remote email.  I suggest
that if you can find a friend who is knowledgeable and trustworthy
that they might be able to help you more directly.  This is something
that a local linux users group would be wonderful for.  Perhaps there
is one in your area and you find a community in which to share ideas
and problems?

Bob


Mvh,
Markus






reply via email to

[Prev in Thread] Current Thread [Next in Thread]