# HG changeset patch # User Geoff Voelker # Date 820731704 0 # Node ID de785168889053ec4d2d38aff7160ec1eaaa2d27 # Parent c80fb27c183ba1dcc6de3ccdf90304cdba06bd97 (getuid): Only return root uid if Administrator. (geteuid): Return getuid. diff -r c80fb27c183b -r de7851688890 src/w32.c --- a/src/w32.c Thu Jan 04 03:07:38 1996 +0000 +++ b/src/w32.c Thu Jan 04 05:01:44 1996 +0000 @@ -628,13 +628,27 @@ int getuid () { - return 0; + char buffer[256]; + int size = 256; + + if (!GetUserName (buffer, &size)) + /* Assume all powers upon failure. */ + return 0; + + if (!stricmp ("administrator", buffer)) + return 0; + else + /* A complete fabrication...is there anything to base it on? */ + return 123; } int geteuid () { - return 0; + /* I could imagine arguing for checking to see whether the user is + in the Administrators group and returning a UID of 0 for that + case, but I don't know how wise that would be in the long run. */ + return getuid (); } /* Remove all CR's that are followed by a LF.