mirror of
https://github.com/MidnightCommander/mc
synced 2025-02-02 16:35:29 +03:00
setuid()/setreuid() in mcserv.c
Mon Feb 1 01:45:08 1999 Timur I. Bakeyev <mc@bat.ru> * mcserv.c: If setuid() is avaliable, use it, even, streuid() also present. (BTW, bsdi uses it's own auth system..)
This commit is contained in:
parent
351aa95e12
commit
4dce2ac60a
@ -1,3 +1,8 @@
|
||||
Mon Feb 1 01:45:08 1999 Timur I. Bakeyev <mc@bat.ru>
|
||||
|
||||
* mcserv.c: If setuid() is avaliable, use it, even, streuid() also
|
||||
present. (BTW, bsdi uses it's own auth system..)
|
||||
|
||||
Sun Jan 31 20:51:17 1999 Alexander Savelyev <fano@vcom.kiev.ua>
|
||||
|
||||
* mcserv.c (do_auth): mcserv never auth properly on bsdi.
|
||||
|
@ -912,12 +912,13 @@ do_auth (char *username, char *password)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(BSD) || defined(__bsdi__)
|
||||
#if defined (HAVE_SETUID)
|
||||
if (setuid (this->pw_uid))
|
||||
#else
|
||||
if (setreuid (this->pw_uid, this->pw_uid))
|
||||
#endif
|
||||
return 0;
|
||||
#elif defined (HAVE_SETREUID)
|
||||
if (setreuid (this->pw_uid, this->pw_uid))
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
/* If the setuid call failed, then deny access */
|
||||
/* This should fix the problem on those machines with strange setups */
|
||||
|
Loading…
x
Reference in New Issue
Block a user