Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 38610

Summary: strange behavior with suid perl programs
Product: [Retired] Red Hat Linux Reporter: Need Real Name <robertk>
Component: perlAssignee: Chip Turner <cturner>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: low    
Version: 7.1   
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: 2006-02-21 18:47:58 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 Need Real Name 2001-05-01 17:41:06 UTC
This is a very minor bug with an easy workaround but it points to
strangeness that should probably be investigated.

# pwd
/home
# ls -l perltest
-rwsr-xr-x    1 root     root          241 May  1 10:24 perltest
# cat perltest
#!/usr/bin/perl -wT

# required for SUID programs
$ENV{PATH}="/bin:/usr/bin";
$ENV{BASH_ENV}="";

print "1\n";
print `whoami`;
print "2\n";
print `whoami ; whoami`;
print "3\n";
print `whoami ; whoami ; whoami`;
print "4\n";
print `whoami`;
# --- end of perl listing

# su nobody
$ ./perltest
1
root
2
nobody
nobody
3
nobody
nobody
nobody
4
root

The above output is in rh 7.0 and 7.1  Note that whoami incorrectly returns
nobody instead of root when there are semicolons in the command.  rh 6.2
works correctly with the following output:

# su nobody
$ ./perltest
1
root
2
root
root
3
root
root
root
4
root

Comment 1 Radu Greab 2001-11-27 12:10:39 UTC
This is a duplicate of bug 44001, or the other way around :-)


Comment 2 Chip Turner 2003-04-11 20:36:11 UTC

*** This bug has been marked as a duplicate of 56537 ***

Comment 3 Red Hat Bugzilla 2006-02-21 18:47:58 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.