[Linuxcommand-discuss] security_check
Brought to you by:
bshotts
|
From: root <ro...@te...> - 2000-06-18 17:26:22
|
Here's a small function that may want to be included into the the
new_script program:
--CUT--
function security_check
{
#####
# check to make sure the person running this is root or
# equivalent
#####
if [ `id -u` != 0 ]; then
echo "ERROR: Only Superuser may use this program."
exit 1
fi
}
--CUT--
possibly add this in when the questioin is asked about security
information? Soo... just in case the 'installee' chmod's the program 755
or something and others have access to it, just a quick little way to add
some backup protection :)
ø(ju...@ge...)--------ooOo---oOoo-----------------------------ø
| Systems Administrator . technolust.cx irc.spamnet.org 6667 |
| http://www.technolust.cx/~jura http://www.spamnet.org |
| |
| Geek Pit Labs http://www.geekpitlabs.com AIM: geekpitlabs |
| Geek Admins dot org http://www.geekadmins.org |
°----------------------------------------------------------------------°
For-pay Internet distributed processing.
http://www.ProcessTree.com/?sponsor=31381
|