Comment

Comment by cryptonector

Not sure I'll look for the other "easteregg", though I noticed that you set the new thread's impersonation token, which is presumably how you implement setuid() and friends [yes, that is how you implement them] -- is that the other easteregg? I also see that you use the last RID of SIDs as the UID/GID, and that you have hardcoded passwd(4)/group(4) entries, so you only support local users (which is fine).

Oh, ah, _task_copy(). You swap stacks... I think because of course.

Your execve() is real though, since you use CreateProcessAsUser(), which is good.

The compromise you made is pretty neat, though obviously some things might not work well. Though I'm guessing this is working quite well for you.

Your file names are weird; they often tell me nothing about what to expect to find in them.

I looked for fork() because that's the difficult one to implement on WIN32. What Cygwin does is some crazy gymnastics that sometimes fails. You might know that I think fork() is "evil" [0], or if you hadn't, you do now, and I guess you're likely to agree with that take, but I'd love to hear your thoughts on that, because clearly you've thought about fork().

I've to say that you've clearly thought a lot about this, and though I've not tried it (and probably won't) you seem to have done an excellent job.

[0] https://gist.github.com/nicowilliams/a8a07b0fc75df05f684c23c...

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton