Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / security / openssh / patches / patch-al
blob60ab7e63018cb6b679f131df741e35471ba346ef
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
4 +++ auth1.c
5 @@ -320,7 +320,7 @@ do_authloop(Authctxt *authctxt)
6  
7  #ifndef HAVE_CYGWIN
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)) {
12                         authenticated = 0;
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
16          * the server.
17          */
18 -#ifndef HAVE_CYGWIN
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.");
24  #endif