Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2009 21:03:45 -0700
From:      Michael David Crawford <mdc@prgmr.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: SUID permission on Bash script
Message-ID:  <4A98A8A1.7070305@prgmr.com>
In-Reply-To: <20090829022431.5841d4de@gumby.homeunix.com>
References:  <beaf3aa50908280124pbd2c760v8d51eb4ae965dedc@mail.gmail.com>	<87y6p4pbd0.fsf@kobe.laptop> <20090829022431.5841d4de@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
RW wrote:
> So are scripts actually incapable of running setuid?

They aren't on Linux.  I learned about that a while back when I 
investigated setuid scripts for a coworker.

It's not that setuid shell scripts are really more inherently insecure 
than programs written in C.  The problem is more that those who write 
such scripts tend not to observe the proper precautions.

For example if you don't set the PATH explicitly, and you don't give 
absolute pathnames to all the subprograms you run, then a trojan that 
has the same name as some standard program can get run as root.

If a program is going to be setuid at all, you really have to know what 
you're doing when you write it or else you'll find yourself opening a 
can of worms.

Mike
-- 
Michael David Crawford
mdc@prgmr.com

    prgmr.com - We Don't Assume You Are Stupid.

       Xen-Powered Virtual Private Servers: http://prgmr.com/xen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A98A8A1.7070305>