Mailing List
Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Installation - Getting started with Red Hat Linux
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 8.0 - Discussion of Red Hat Linux 8.0 (Psyche)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.1 - Discussion of Red Hat Linux 7.1 (Seawolf)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Question about suid on Redhat 7.3

Question about suid on Redhat 7.3

2002-08-28       - By Web Admin Team

 Back
Reply:     1     2     3  

Here is the question.
I create a shell script (script.bash), chown user1:user1
script.bash; chmod u+s script.bash; then execute it. It
doesvalhalla-list@(protected)
not appear to execute as user1. (Script just does "mail $1 <
$2 ", where $1 is person I want to send mail to, and $2 is the
file containing the message. But - does not send mail as if it
were user1, it sends the mail as me.
So...I see after searching that perhaps Linux has disabled
suid for shell scripts. Therefore, I create a C program:
#include <stdlib.h >
main()
{
setuid(503); /* Assume 503 is the uid of user1 */
system( "mail me@(protected) < /tmp/jk "); /* Assume me@(protected)
is valid test address */
}
Then I do gcc prog.c -o prog; chown user1:user1 prog; chmod u+s prog;
Then I execute prog. Does the mail show as being sent by
user1? Nope - shows as being sent by me.
So what the heck?
On unix systems I have used these should work. So what is up
with RedHat 7.3 that I cannot get either a script or a program
to act as a suid in this case?
Reason I need this - in my Apache web site sometimes I need to
respond to user input by sending them an email. That works
fine, but it sends it as user Apache. I want to send it as a
different user. Thought I would just use a suid script to do
that, but no go. So - in the specific case, why is this not
working? And in the general case, is there an alternative
approach that I can have my httpd process send an email as a
user other than Apache (i.e., something like 'CustomerService '). ???

Thanks,
webteam@(protected)