aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Voelker1996-01-04 05:01:44 +0000
committerGeoff Voelker1996-01-04 05:01:44 +0000
commit03e123e7383ccd70f910a8176e11e965bf6860d4 (patch)
tree358fd3d42214736c2e14f4c9641d2e24b88a2ccc /src
parent3d7eead0b594494671cc29554dc170b918e1b3f2 (diff)
downloademacs-03e123e7383ccd70f910a8176e11e965bf6860d4.tar.gz
emacs-03e123e7383ccd70f910a8176e11e965bf6860d4.zip
(getuid): Only return root uid if Administrator.
(geteuid): Return getuid.
Diffstat (limited to 'src')
-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)
628int 628int
629getuid () 629getuid ()
630{ 630{
631 return 0; 631 char buffer[256];
632 int size = 256;
633
634 if (!GetUserName (buffer, &size))
635 /* Assume all powers upon failure. */
636 return 0;
637
638 if (!stricmp ("administrator", buffer))
639 return 0;
640 else
641 /* A complete fabrication...is there anything to base it on? */
642 return 123;
632} 643}
633 644
634int 645int
635geteuid () 646geteuid ()
636{ 647{
637 return 0; 648 /* I could imagine arguing for checking to see whether the user is
649 in the Administrators group and returning a UID of 0 for that
650 case, but I don't know how wise that would be in the long run. */
651 return getuid ();
638} 652}
639 653
640/* Remove all CR's that are followed by a LF. 654/* Remove all CR's that are followed by a LF.