Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / security / openssh / patches / patch-ao
blobe828729a867064c982725527df92599075f10084
1 $NetBSD: patch-ao,v 1.16 2010/06/11 20:41:42 martti Exp $
3 One more replacing 0 with ROOTUID is handled by using SUBST framework
4 because patch can't handle it when hpn-patch option is enabled.
5 So, don't simply update this file with mkpatch command.
7 --- session.c.orig      2011-02-16 01:25:58.000000000 +0000
8 +++ session.c
9 @@ -1075,7 +1075,7 @@ read_etc_default_login(char ***env, u_in
10         if (tmpenv == NULL)
11                 return;
13 -       if (uid == 0)
14 +       if (uid == ROOTUID)
15                 var = child_get_env(tmpenv, "SUPATH");
16         else
17                 var = child_get_env(tmpenv, "PATH");
18 @@ -1184,7 +1184,7 @@ do_setup_env(Session *s, const char *she
19  #  endif /* HAVE_ETC_DEFAULT_LOGIN */
20                 if (path == NULL || *path == '\0') {
21                         child_set_env(&env, &envsize, "PATH",
22 -                           s->pw->pw_uid == 0 ?
23 +                           s->pw->pw_uid == ROOTUID ?
24                                 SUPERUSER_PATH : _PATH_STDPATH);
25                 }
26  # endif /* HAVE_CYGWIN */
27 @@ -1298,6 +1298,18 @@ do_setup_env(Session *s, const char *she
28                     strcmp(pw->pw_dir, "/") ? pw->pw_dir : "");
29                 read_environment_file(&env, &envsize, buf);
30         }
32 +#ifdef HAVE_INTERIX
33 +       {
34 +               /* copy standard Windows environment, then apply changes */
35 +               env_t *winenv = env_login(pw);
36 +               env_putarray(winenv, env, ENV_OVERRIDE);
38 +               /* swap over to altered environment as a traditional array */
39 +               env = env_array(winenv);
40 +       }
41 +#endif
43         if (debug_flag) {
44                 /* dump the environment */
45                 fprintf(stderr, "Environment:\n");
46 @@ -1488,11 +1500,13 @@ do_setusercontext(struct passwd *pw)
47                         perror("setgid");
48                         exit(1);
49                 }
50 +# if !defined(HAVE_INTERIX)
51                 /* Initialize the group list. */
52                 if (initgroups(pw->pw_name, pw->pw_gid) < 0) {
53                         perror("initgroups");
54                         exit(1);
55                 }
56 +# endif /* !HAVE_INTERIX */
57                 endgrent();
58  #endif
60 @@ -2305,7 +2319,7 @@ session_pty_cleanup2(Session *s)
61                 record_logout(s->pid, s->tty, s->pw->pw_name);
63         /* Release the pseudo-tty. */
64 -       if (getuid() == 0)
65 +       if (getuid() == ROOTUID)
66                 pty_release(s->tty);
68         /*