diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | session.c | 15 |
2 files changed, 15 insertions, 6 deletions
@@ -7,6 +7,10 @@ | |||
7 | - dtucker@cvs.openbsd.org 2008/06/14 17:07:11 | 7 | - dtucker@cvs.openbsd.org 2008/06/14 17:07:11 |
8 | [sshd.c] | 8 | [sshd.c] |
9 | ensure default umask disallows at least group and world write; ok djm@ | 9 | ensure default umask disallows at least group and world write; ok djm@ |
10 | - djm@cvs.openbsd.org 2008/06/14 18:33:43 | ||
11 | [session.c] | ||
12 | suppress the warning message from chdir(homedir) failures | ||
13 | when chrooted (bz#1461); ok dtucker | ||
10 | 14 | ||
11 | 20080614 | 15 | 20080614 |
12 | - (djm) [openbsd-compat/sigact.c] Avoid NULL derefs in ancient sigaction | 16 | - (djm) [openbsd-compat/sigact.c] Avoid NULL derefs in ancient sigaction |
@@ -4379,4 +4383,4 @@ | |||
4379 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4383 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4380 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4384 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4381 | 4385 | ||
4382 | $Id: ChangeLog,v 1.5014 2008/06/15 21:50:58 djm Exp $ | 4386 | $Id: ChangeLog,v 1.5015 2008/06/15 21:53:16 djm Exp $ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: session.c,v 1.238 2008/05/09 16:16:06 markus Exp $ */ | 1 | /* $OpenBSD: session.c,v 1.239 2008/06/14 18:33:43 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 3 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
4 | * All rights reserved | 4 | * All rights reserved |
@@ -1647,6 +1647,7 @@ do_child(Session *s, const char *command) | |||
1647 | char *argv[ARGV_MAX]; | 1647 | char *argv[ARGV_MAX]; |
1648 | const char *shell, *shell0, *hostname = NULL; | 1648 | const char *shell, *shell0, *hostname = NULL; |
1649 | struct passwd *pw = s->pw; | 1649 | struct passwd *pw = s->pw; |
1650 | int r = 0; | ||
1650 | 1651 | ||
1651 | /* remove hostkey from the child's memory */ | 1652 | /* remove hostkey from the child's memory */ |
1652 | destroy_sensitive_data(); | 1653 | destroy_sensitive_data(); |
@@ -1762,12 +1763,16 @@ do_child(Session *s, const char *command) | |||
1762 | 1763 | ||
1763 | /* Change current directory to the user's home directory. */ | 1764 | /* Change current directory to the user's home directory. */ |
1764 | if (chdir(pw->pw_dir) < 0) { | 1765 | if (chdir(pw->pw_dir) < 0) { |
1765 | fprintf(stderr, "Could not chdir to home directory %s: %s\n", | 1766 | /* Suppress missing homedir warning for chroot case */ |
1766 | pw->pw_dir, strerror(errno)); | ||
1767 | #ifdef HAVE_LOGIN_CAP | 1767 | #ifdef HAVE_LOGIN_CAP |
1768 | if (login_getcapbool(lc, "requirehome", 0)) | 1768 | r = login_getcapbool(lc, "requirehome", 0); |
1769 | exit(1); | ||
1770 | #endif | 1769 | #endif |
1770 | if (r || options.chroot_directory == NULL) | ||
1771 | fprintf(stderr, "Could not chdir to home " | ||
1772 | "directory %s: %s\n", pw->pw_dir, | ||
1773 | strerror(errno)); | ||
1774 | if (r) | ||
1775 | exit(1); | ||
1771 | } | 1776 | } |
1772 | 1777 | ||
1773 | closefrom(STDERR_FILENO + 1); | 1778 | closefrom(STDERR_FILENO + 1); |