Ethereal-dev: Re: [Ethereal-dev] Setuid() patch to allow tethereal to run as nobody during cap

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 30 Oct 2003 12:02:01 -0800

On Oct 30, 2003, at 9:57 AM, Bryan Henderson wrote:

Is the intent here to support running it as a daemon, or something such
as that, where the user ID you want it to run as isn't available to it
unless you tell it?

If that's the intent, then -u still isn't the best way to do it.

...especially if Tethereal is set-UID root.

In that
case, one should invoke tethereal through a shell such as 'su' so as to
say, "run tethereal as real UID X" and then tethereal would switch to
effective=real at the appropriate time.  It's simpler that way.

...and, at least with "sudo", the fact that it's been done can get syslogged.

And I agree that tethereal shouldn't wait to be asked before dropping
unneeded superuser privilege.

I've checked in a change to give up set-UID and set-GID privileges before opening capture files and immediately after opening a capture device. (On systems that support saved set-user ID and "seteuid()", Tethereal *and* Ethereal could give up those privileges at the beginning of "main()", and temporarily reclaim them when getting the list of network interfaces and when opening the interface, and relinquish them immediately afterwards.)