1 $NetBSD: patch-al,v 1.8 2009/05/21 03:22:29 taca Exp $
3 --- auth1.c.orig 2008-07-09 19:54:05.000000000 +0900
5 @@ -320,7 +320,7 @@ do_authloop(Authctxt *authctxt)
8 /* Special handling for root */
9 - if (authenticated && authctxt->pw->pw_uid == 0 &&
10 + if (authenticated && authctxt->pw->pw_uid == ROOTUID &&
11 !auth_root_allowed(meth->name)) {
13 # ifdef SSH_AUDIT_EVENTS
14 @@ -418,8 +418,8 @@ do_authentication(Authctxt *authctxt)
15 * If we are not running as root, the user must have the same uid as
19 - if (!use_privsep && getuid() != 0 && authctxt->pw &&
20 +#if !defined(HAVE_CYGWIN) && !defined(HAVE_INTERIX)
21 + if (!use_privsep && getuid() != ROOTUID && authctxt->pw &&
22 authctxt->pw->pw_uid != getuid())
23 packet_disconnect("Cannot change user when server not running as root.");