Mercurial > hg > early-roguelike
changeset 175:10c273a62228
srogue: remove md_droppriv() and md_resetpriv().
These partial privilege-dropping functions are no longer needed.
author | John "Elwin" Edwards |
---|---|
date | Sat, 01 Aug 2015 16:31:03 -0400 |
parents | 1863409c44cf |
children | db1c9a21a7c3 |
files | srogue/mdport.c srogue/rogue.h |
diffstat | 2 files changed, 0 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/srogue/mdport.c Sat Aug 01 16:23:24 2015 -0400 +++ b/srogue/mdport.c Sat Aug 01 16:31:03 2015 -0400 @@ -1533,41 +1533,6 @@ #endif } -void -md_droppriv(void) -{ -#if defined(HAVE_GETUID) - uid_t realuid = getuid(); - -#if defined(HAVE_SETRESUID) - if (setresuid(-1, realuid, realuid) != 0) { -#elif defined (HAVE_SETREUID) - if (setreuid(realuid, realuid) != 0) { -#elif defined (HAVE_SETUID) - if (setuid(realuid) != 0) { -#else - if (0) { -#endif - printf("Cannot change to effective uid: %d\n", realuid); - exit(1); - } -#endif -} - -extern uid_t playuid; -extern gid_t playgid; - -void -md_resetpriv(void) -{ -#if defined (HAVE_SETUID) - setuid(playuid); -#endif -#if defined (HAVE_SETGID) - setgid(playgid); -#endif -} - int md_random(void) {
--- a/srogue/rogue.h Sat Aug 01 16:23:24 2015 -0400 +++ b/srogue/rogue.h Sat Aug 01 16:31:03 2015 -0400 @@ -69,8 +69,6 @@ void md_onsignal_default(void); int md_issymlink(char *sp); long md_memused(void); -void md_droppriv(void); -void md_resetpriv(void); int md_random(void); void md_srandom(unsigned int seed); char *xcrypt(const char *key, const char *setting);