Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2001 08:33:15 -0500
From:      Bill Moran <wmoran@iowna.com>
To:        freebsd-questions@freebsd.org
Subject:   setuid root and shell scripts
Message-ID:  <3ABB509B.3510E21D@iowna.com>

next in thread | raw e-mail | index | archive | help
Wrote a quick shell script the other day and made it setuid root because
there were some commands in the script that needed to run as root.
Unfortunately, that doesn't seem to work. Regardless of the setuid bit
being set and the owner of the file being root, the script and ever
command in it runs as the calling user. I'm using the default FreeBSD
shell (/bin/sh) using FreeBSD 4.2-STABLE (cvsupped around the end of
Feb)
I'm not sure exactly what question I'm asking. I guess I'm just curious
about this behaviour. Is it the intended behaviour? If so, I guess I'll
just have to use sudo to run the command as I want. I just thought it
was weird that a setuid root script didn't execute that way.

TIA,
Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3ABB509B.3510E21D>