RE: [suse-programming-e] bash script
Actually, I'm wrong. You were able to do so because you were root. If you do it as a non-root user, then it will fail: jonathan@jaguar:~/public_html> l total 20 drwxr-xr-x 4 jonathan users 4096 2003-03-18 17:08 ./ drwxr-xr-x 56 jonathan users 4096 2003-03-18 18:32 ../ -rw-r--r-- 1 jonathan users 48 2002-11-09 11:50 .directory drw-r--r-- 2 jonathan users 4096 2003-03-18 18:32 cgi-bin/ drwxr-xr-x 3 jonathan users 4096 2002-11-25 15:15 slugtalk/ jonathan@jaguar:~/public_html> ./cgi-bin/test.sh -bash: ./cgi-bin/test.sh: Permission denied jonathan@jaguar:~/public_html> sudo ./cgi-bin/test.sh Password: execute. jonathan@jaguar:~/public_html> Jonathan Paul Cowherd Linux and Java Administrator Genscape, Inc. Email: jonathan.cowherd@genscape.com Office: (502) 583-3730 Mobile: (502) 314-0444
-----Original Message----- From: Christopher Mahmood [mailto:ckm@suse.com] Sent: Tuesday, March 18, 2003 6:36 PM To: 'suse-programming-e@suse.com' Subject: Re: [suse-programming-e] bash script
Yes, but the directory also needs to be executable to execute. Try creating a file in a directory that has the execute bit on
* Jesse Marlin (jlm@compgen.com) [030318 15:25]: then turn
it off.
No, Jonathan is correct. E.g.,
hades:/tmp # whoami root hades:/tmp # mkdir test hades:/tmp # echo -e '#!/bin/sh\necho hello\n' > test/1 hades:/tmp # chmod +x test/1 hades:/tmp # chmod 600 test hades:/tmp # l -d test drw------- 2 root root 72 Mar 18 15:34 test/ hades:/tmp # test/1 hello
--
-ckm
-- To unsubscribe, email: suse-programming-e-unsubscribe@suse.com For additional commands, email: suse-programming-e-help@suse.com Archives can be found at: http://lists/archive/suse-programming-e
* Jonathan Cowherd (jonathan.cowherd@genscape.com) [030318 15:36]:
Actually, I'm wrong. You were able to do so because you were root. If you do it as a non-root user, then it will fail:
No, you're right for the reasons you pointed out early. You can't step into a directory if it's not executable. I did that as root to show that it has nothing to do with making files "executable". -- -ckm
participants (2)
-
Christopher Mahmood
-
Jonathan Cowherd