]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- (tim) [platform.c session.c] Fix bug affecting SVR5 platforms introduced
authorTim Rice <tim@multitalents.net>
Tue, 21 Jan 2014 01:59:28 +0000 (17:59 -0800)
committerTim Rice <tim@multitalents.net>
Tue, 21 Jan 2014 01:59:28 +0000 (17:59 -0800)
   with sftp chroot support. Move set_id call after chroot.

ChangeLog
platform.c
session.c

index 9ebe5a6398578d7c416f8c2a1ae9993bb3dca3b7..5c26fa9f4d3efc4f66f8dc73ae229211440188e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
    -ftrapv (it seems to work but fails when trying to link ssh).  ok djm@
  - (dtucker) [aclocal.m4] Differentiate between compile-time and link-time
    tests in the configure output.  ok djm.
+ - (tim) [platform.c session.c] Fix bug affecting SVR5 platforms introduced
+   with sftp chroot support. Move set_id call after chroot.
 
 20140120
  - (dtucker) [gss-serv-krb5.c] Fall back to krb5_cc_gen_new if the Kerberos
index 6d896c2293f6cf416b3ed44ca80cf9d9dc9d4319..30fc60909c8b49fb214bdd91efd31ca1933220f5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: platform.c,v 1.20 2013/09/22 09:02:40 dtucker Exp $ */
+/* $Id: platform.c,v 1.21 2014/01/21 01:59:29 tim Exp $ */
 
 /*
  * Copyright (c) 2006 Darren Tucker.  All rights reserved.
@@ -164,12 +164,6 @@ platform_setusercontext_post_groups(struct passwd *pw)
        aix_usrinfo(pw);
 #endif /* _AIX */
 
-#if !defined(HAVE_LOGIN_CAP) && defined(USE_LIBIAF)
-       if (set_id(pw->pw_name) != 0) {
-               exit(1);
-       }
-# endif /* USE_LIBIAF */
-
 #ifdef HAVE_SETPCRED
        /*
         * If we have a chroot directory, we set all creds except real
index 924c11bcc556cfe5efbca8817bb142c0ae36ff6d..6be16ca86ce0497aec58a2fcd9b9f3a2c5121bc3 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1552,6 +1552,11 @@ do_setusercontext(struct passwd *pw)
                 */
                (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUMASK);
 #else
+# ifdef USE_LIBIAF
+       if (set_id(pw->pw_name) != 0) {
+               exit(1);
+       }
+# endif /* USE_LIBIAF */
                /* Permanently switch to the desired uid. */
                permanently_set_uid(pw);
 #endif