mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-05 18:58:55 -04:00
27 lines
943 B
C
27 lines
943 B
C
$NetBSD: patch-auth1.c,v 1.4 2016/01/18 12:53:26 jperkin Exp $
|
|
|
|
Replace uid 0 with ROOTUID macro
|
|
|
|
--- auth1.c.orig 2015-08-21 04:49:03.000000000 +0000
|
|
+++ auth1.c
|
|
@@ -322,7 +322,7 @@ do_authloop(Authctxt *authctxt)
|
|
|
|
#ifndef HAVE_CYGWIN
|
|
/* Special handling for root */
|
|
- if (authenticated && authctxt->pw->pw_uid == 0 &&
|
|
+ if (authenticated && authctxt->pw->pw_uid == ROOTUID &&
|
|
!auth_root_allowed(meth->name)) {
|
|
authenticated = 0;
|
|
# ifdef SSH_AUDIT_EVENTS
|
|
@@ -423,8 +423,8 @@ do_authentication(Authctxt *authctxt)
|
|
* If we are not running as root, the user must have the same uid as
|
|
* the server.
|
|
*/
|
|
-#ifndef HAVE_CYGWIN
|
|
- if (!use_privsep && getuid() != 0 && authctxt->pw &&
|
|
+#if !defined(HAVE_CYGWIN) && !defined(HAVE_INTERIX)
|
|
+ if (!use_privsep && getuid() != ROOTUID && authctxt->pw &&
|
|
authctxt->pw->pw_uid != getuid())
|
|
packet_disconnect("Cannot change user when server not running as root.");
|
|
#endif
|