srogue: remove md_droppriv() and md_resetpriv().
These partial privilege-dropping functions are no longer needed.
This commit is contained in:
parent
2e4f161e40
commit
3c781f89fe
2 changed files with 0 additions and 37 deletions
|
|
@ -1533,41 +1533,6 @@ md_memused(void)
|
||||||
#endif
|
#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
|
int
|
||||||
md_random(void)
|
md_random(void)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,6 @@ void md_onsignal_exit(void);
|
||||||
void md_onsignal_default(void);
|
void md_onsignal_default(void);
|
||||||
int md_issymlink(char *sp);
|
int md_issymlink(char *sp);
|
||||||
long md_memused(void);
|
long md_memused(void);
|
||||||
void md_droppriv(void);
|
|
||||||
void md_resetpriv(void);
|
|
||||||
int md_random(void);
|
int md_random(void);
|
||||||
void md_srandom(unsigned int seed);
|
void md_srandom(unsigned int seed);
|
||||||
char *xcrypt(const char *key, const char *setting);
|
char *xcrypt(const char *key, const char *setting);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue