diff options
| author | Geoff Voelker | 1996-01-04 05:01:44 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1996-01-04 05:01:44 +0000 |
| commit | 03e123e7383ccd70f910a8176e11e965bf6860d4 (patch) | |
| tree | 358fd3d42214736c2e14f4c9641d2e24b88a2ccc /src | |
| parent | 3d7eead0b594494671cc29554dc170b918e1b3f2 (diff) | |
| download | emacs-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.c | 18 |
1 files changed, 16 insertions, 2 deletions
| @@ -628,13 +628,27 @@ request_sigio (void) | |||
| 628 | int | 628 | int |
| 629 | getuid () | 629 | getuid () |
| 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 | ||
| 634 | int | 645 | int |
| 635 | geteuid () | 646 | geteuid () |
| 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. |