From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Thomas Leitner Newsgroups: gmane.os.tru64.managers Subject: setreuid/setregid without SUID bit set. Date: Fri, 10 Jan 2003 11:44:48 +0100 (MET) Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1042195451 32497 80.91.224.249 (10 Jan 2003 10:44:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2003 10:44:11 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18Wwe1-0008Rs-00 for ; Fri, 10 Jan 2003 11:44:10 +0100 Original-Received: (qmail 18444 invoked by uid 5); 10 Jan 2003 10:45:05 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 18426 invoked by uid 49493); 10 Jan 2003 10:45:05 -0000 Original-Received: from tom@radar.tu-graz.ac.at by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-3.9/5.0):. Processed in 0.748459 secs); 10 Jan 2003 10:45:05 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 10 Jan 2003 10:45:04 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H8H005FOV73U4@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 10 Jan 2003 05:45:04 -0500 (EST) Original-Received: from mailrelay.tugraz.at (mailrelay.tu-graz.ac.at [129.27.3.7]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTPS id <0H8H00796V6WJF@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 10 Jan 2003 05:44:58 -0500 (EST) Original-Received: from ds01.radar.tugraz.at (ns1.radar.tugraz.at [129.27.147.2]) by mailrelay.tugraz.at (8.12.7/8.12.7) with ESMTP id h0AAinSZ000426 for ; Fri, 10 Jan 2003 11:44:49 +0100 (MET) Original-Received: from al01.radar.tugraz.at (al01.radar.tugraz.at [129.27.147.21]) by ds01.radar.tugraz.at (Postfix) with ESMTP id 7928B827F for ; Fri, 10 Jan 2003 11:44:48 +0100 (MET) Original-To: TRU64 Unix Managers X-Virus-Scanned: by amavisd-milter (http://amavis.org/) Xref: main.gmane.org gmane.os.tru64.managers:2916 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2916 Hi, I need to have the ability to run a certain program started by root under a different user account. I know that "su" is able to do that but su leaves a shell hanging around which I want to avoid. So I wrote my own "runas" program which basically does a setreuid/setregid to the desired uid/gid and execs the required program. Another constraint is that the "runas" program is not created with root permissions. Now the problem I'm struggling with is, that my runas program needs to have the GUID bit set (chmod 2755) in order to work. Here's what happens (all commands executed as root): # ls -l runas -rwxr-xr-x 1 optamos users 32768 Jan 10 10:53 runas # ./runas optamos /bin/ls ** ERROR: : Not owner # chmod 4755 runas # ./runas optamos /bin/ls ** ERROR: : Not owner # chmod 2755 runas # ./runas optamos /bin/ls test.dat test1.dat test2.dat ...... Is there any way I can get this going without having to set the "runas" program to mode 2755 ? I've tried to put the respective user into the "system" group but this does not work either. Any other ways? Thanks // Tom -- -------------------------------------------------------------------------- Dr. Tom Leitner Dept. of Communications Graz University of Technology, e-mail : tom@radar.tu-graz.ac.at Inffeldgasse 12 Phone : +43-316-873-7455 A-8010 Graz / Austria / Europe Fax : +43-316-463-697 Home page : http://www.radar.tugraz.at/people/tom.html PGP public key on : ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send mail with subject "get Thomas Leitner" to pgp-public-keys@keys.pgp.net -------------------------------------------------------------------------- Before we have the paperless office, we have the paperless toilet!