Mitch Capper wrote: > *Windows Security / Permissions* > The no-op permissions/getuser/group branch is poor. Windows permissions are > not considered at all, and all permission calls just silently succeed. Any > user calls return the current user and group calls return a generic string. > In addition to return the current user it uses getlogin which gnulib > uses GetUserName native api call but that requires linking with Advapi32 > and I don't know how to properly add that requirement with gnulib. There > is getenv("username") but clearly that is not a great choice too.
The Windows security model and the Unix security model are different enough that applications typically will work with #ifdef here. Especially since the Windows security model is based on SIDs, which are strings and don't fit into a 64-bit integer, one cannot expect to have a good correspondence. The current state is an attempt to make code compile if it doesn't use <pwd.h> or <grp.h>. I don't know whether this state can be significantly improved. But if you have reasonable suggestions, please show them! Bruno