aiosmtpd icon indicating copy to clipboard operation
aiosmtpd copied to clipboard

Selectively intuitive setuid behavior

Open strongholdmedia opened this issue 4 years ago • 1 comments
trafficstars

In my mediocre, pre-'90s universe, we use setuid to ascertain that we may drop privileges after binding the socket. This is necessary, as one does not simply bind a port below 1025 without doing so as root. In fact, that is the sole reason to run such stuff as root.

However, when set (left) as such, the software attempts to drop its privileges as soon as it evaluates the arguments.

To me, this makes somewhat limited sense.

Am I missing something? I would be glad to receive some pointers.

strongholdmedia avatar Jun 10 '21 19:06 strongholdmedia

Hmm... you have a point. It seems we invoked the process the wrong way around, and the tests did not catch this because they overrode os.setuid.

I'll see how I can fix this. Probably simple #KnockWood

pepoluan avatar Oct 19 '21 06:10 pepoluan