summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1996-01-04 05:01:44 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1996-01-04 05:01:44 +0000
commit659523aa63845099d987c67b3647b2b1b05e9165 (patch)
tree65d95e7bcf034e774b489fe828c75c0ce257f663
parent790079705cae9731b49b55e1c6993d772967f5e1 (diff)
downloademacs-659523aa63845099d987c67b3647b2b1b05e9165.tar.gz
(getuid): Only return root uid if Administrator.
(geteuid): Return getuid.
-rw-r--r--src/w32.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/w32.c b/src/w32.c
index ae7f299dd03..486c7080d66 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -628,13 +628,27 @@ request_sigio (void)
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.