[mosh-devel] [TOOL RELEASE] Killing Stale Mosh Sessions: Mosh Cleaner

Jason A. Donenfeld Jason at zx2c4.com
Mon Jan 27 11:21:12 EST 2014


On Mon, Jan 27, 2014 at 4:58 PM, Jann Horn <jann at thejh.net> wrote:
> One problem I can see: You're doing setegid and seteuid to prevent a race causing
> you to kill the process of the wrong user, right? Well, have a look at the kill(2)
> manpage: "[...]to have permission[...] or the real or effective user ID of the
> sending process must equal the real or saved set-user-ID of the target process".
> Looks like you're changing exactly the wrong UID and this should be
> "setresuid(sbuf.st_uid, sbuf.st_uid, -1)" instead?

Nice catch! Thanks. I made an update -- look okay now?



More information about the mosh-devel mailing list