in reply to suidperl/sudo function-alike on Win32
I wrote this in C once to try it out. I have the source code at work which I can send you if you're interested. I don't think all the functions I used have been implemented in the Win32 modules.
For some time I have wanted to write a module which would perform this kind of automatically-authenticated IPC connection, with variants for different OSes. On some *nix systems there is a SO_PEERCRED socket option to identify a local connection. You can also use a convoluted protocol where the client proves his identity by performing some actions in the file system. But, alas, I haven't gotten around to doing it.
This style of programming is somewhat more secure than setuid or sudo. E.g. it's less susceptible to manipulation of environment variables. Also, with setuid programs, if you want to use a cryptographic key you have to store it in the file system and hope that file system security and obfuscation protect it. With the authenticated-IPC style, the (trusted) person who starts the process can type in a password once and the key can be kept in memory.
|
|---|