hello, On 25 March 2016 at 10:27, Robert C. Helling <[email protected]> wrote: > + if ((getegid() == 0) && !verbose) { > + printf("You are running Subsurface as root. This is not > recommended.\n"); > + printf("If you insist to do so, run with option -v.\n"); > + exit(0); > + }
there is no WINAPI (Windows) wrapper for the POSIX function getegid(), as the SIDs on Windows work slightly differently that the Unix GIDs. i'd suggest the following function in all the platform specific files (linux.c, windows.c...): subsurface_user_is_root() where getegid() == 0 is used on Unix OSes and possibly IsUserAnAdmin() on Windows. i can send a patch later for that. lubomir -- _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
