Bug 10259

Summary: scripts are not run by their owners rights
Product: [Retired] Red Hat Linux Reporter: janne.mikkola
Component: filesystemAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-03-20 15:47:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description janne.mikkola 2000-03-20 11:02:41 UTC
goal: script is owned by root and everybody can run it with root
permissions.

problem: eaven if i do 'chmod 4755 script.sh' script is run with user
permissions.

script sample:
#!/bin/sh
ls -l /dir/not/readable/by/user

when script is run by root it runs fine, when run as some user it fails.

-rwsr-xr-x   1 root     root           31 Mar 20 13:05 tt.sh
[root@spargate jmikkola]# cat tt.sh
#!/bin/sh
ls -l /home/skaisanl
[root@spargate jmikkola]#
[root@spargate jmikkola]# ./tt.sh
total 0

[root@spargate jmikkola]#

[jmikkola@spargate jmikkola]$ ./tt.sh
ls: /home/skaisanl: Permission denied
[jmikkola@spargate jmikkola]$

         janne mikkola

Comment 1 Bill Nottingham 2000-03-20 15:47:59 UTC
You cannot run setuid shell scripts, period. It's a security risk.