Thread View: sco.opendesktop
6 messages
6 total messages
Started by Ring Medical
Fri, 10 Jun 1994 18:47
Setting set-uid on a script
Author: Ring Medical
Date: Fri, 10 Jun 1994 18:47
Date: Fri, 10 Jun 1994 18:47
11 lines
1242 bytes
1242 bytes
Kind People, We are running SCO v3.2.4.2 and are trying to make a root owned script have a setuid attribute. We have done a chmod u+s to it has well as having it owned by root. All to no avail. I am sure this is in the FAQ but we couldn't find the FAQ. Could anybody give us a lead ? Many thanks, Tony
Re: Setting set-uid on a script
Author: Chris Gayler
Date: Fri, 10 Jun 1994 20:04
Date: Fri, 10 Jun 1994 20:04
14 lines
1461 bytes
1461 bytes
In article <Cr72uu.6Eo@world.std.com> rmedical@world.std.com (Ring Medical) writes: > > We are running SCO v3.2.4.2 and are trying to make a root >owned script have a setuid attribute. We have done a chmod u+s >to it has well as having it owned by root. All to no avail. I am sure >this is in the FAQ but we couldn't find the FAQ. Could anybody give >us a lead ? Setting the suid on a shell script doesn't have any effect, for security reasons. What you'll need to do, if possible, is rewrite it in C and compile it to an executable binary, then you can setuid. -- Chris
Re: Setting set-uid on a script
Author: Gary L. Burnore
Date: Fri, 10 Jun 1994 22:26
Date: Fri, 10 Jun 1994 22:26
19 lines
1918 bytes
1918 bytes
Ring Medical (rmedical@world.std.com) wrote:
: Kind People,
: We are running SCO v3.2.4.2 and are trying to make a root
: owned script have a setuid attribute. We have done a chmod u+s
: to it has well as having it owned by root. All to no avail. I am sure
: this is in the FAQ but we couldn't find the FAQ. Could anybody give
: us a lead ?
I may be wrong but I think you can't do an suid on a shell script and
have it work. v3.2.4.2 DOES have a command called asroot which as the
name implies, runs something "as root". Do man asroot to see how it
works. Basically root sets up what can/cant be done.
--
gburnore@netcom.com
-------------------------------------------------------------------------------
How you look depends on where you go.
-------------------------------------------------------------------------------
Re: Setting set-uid on a script
Author: Chris Frederick
Date: Sat, 11 Jun 1994 01:33
Date: Sat, 11 Jun 1994 01:33
39 lines
2449 bytes
2449 bytes
>: We are running SCO v3.2.4.2 and are trying to make a root
>: owned script have a setuid attribute. We have done a chmod u+s
>: to it has well as having it owned by root. All to no avail. I am sure
>: this is in the FAQ but we couldn't find the FAQ. Could anybody give
>: us a lead ?
To the best of my knowledge, a shell script cannot be run SUID. This
appears to be true in SCO as well as most other flavors of Unix. However,
if you have either the development system or the GCC compiler, simply
compile a short C program to call the shell script. Make the C program
SUID root, and for security purposes chmod the shell script itself to 700.
Another word of caution: be absolutely sure that you specify a full
pathname to each external command you execute from the script, and be sure
that none of them are writable by unprivileged users. If you don't do
these things, it's very simple for anyone who can execute the script to
run (as root) anything they like.
Also note that for execl() to work properly (on most systems), the
"#! /bin/sh" must exist as the first line of the shell script. Use
whatever shell name you've written the script for, of course.
Sample code follows:
myscript.sh:
#! /bin/sh
/bin/ls -l | /bin/more
myls:
int main()
{
execl ("/usr/local/bin/myscript.sh", "myscript.sh", 0);
}
--
Chris Frederick | All things considered, insanity | To excel at something,
f1rederc@iia.org | is the only logical alternative. | you must love doing it.
Re: Setting set-uid on a script
Author: Suresh Thennarangam - Research S...
Date: Sat, 11 Jun 1994 04:23
Date: Sat, 11 Jun 1994 04:23
15 lines
1767 bytes
1767 bytes
Chris Frederick (f1rederc@mary.iia.org) wrote: : >: We are running SCO v3.2.4.2 and are trying to make a root : >: owned script have a setuid attribute. We have done a chmod u+s : >: us a lead ? : To the best of my knowledge, a shell script cannot be run SUID. This : appears to be true in SCO as well as most other flavors of Unix. However, : if you have either the development system or the GCC compiler, simply Can't use the gcc compiler without the development system. If you don't have Dev. system, get Perl, write a perl program to do what you want and get perl to dump core. THen you have an executable. <Suresh> <Suresh@iss.nus.sg>
Re: Setting set-uid on a script
Author: Bill Davidsen
Date: Wed, 15 Jun 1994 03:53
Date: Wed, 15 Jun 1994 03:53
22 lines
2164 bytes
2164 bytes
In article <gburnoreCr7Czw.Jnz@netcom.com> gburnore@netcom.com (Gary L. Burnore) writes:
| I may be wrong but I think you can't do an suid on a shell script and
| have it work. v3.2.4.2 DOES have a command called asroot which as the
| name implies, runs something "as root". Do man asroot to see how it
| works. Basically root sets up what can/cant be done.
Well, actually ksh allows setuid shripts if you (1) compile with the
SUID_EXEC option on and (2) install the suid_exec binary in /etc. I see
no indication that SCO has done this, so the effective answer is "you
can, but someone didn't include the capability."
If you have the source you can compile and have a working ksh, but it
will lack the SCO value added of directory guessing when you do a 'cd'
and don't get it quite right. One of the few things value added which
actually add value IMHO, and I have not recompiled ksh under SCO to add
setuid scripts.
--
Bill Davidsen, davidsen@tmr.com | C programming, PC based UNIX, data
TMR Associates, +1 518-370-5654 | acquisition, device drivers.
_____________________________________|______________________________________
New England Winter 93-94: Many are cold but few are frozen
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads