Bugzilla – Attachment 1524 Details for
Bug 1461
session.c: don't chdir() after chroot() if chroot_path==pw->pw_dir
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
suppress chdir failure warning when ChrootDirectory set
openssh-suppress-chdir.diff (text/plain), 1.10 KB, created by
Damien Miller
on 2008-06-15 04:20:30 AEST
(
hide
)
Description:
suppress chdir failure warning when ChrootDirectory set
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2008-06-15 04:20:30 AEST
Size:
1.10 KB
patch
obsolete
>Index: session.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/session.c,v >retrieving revision 1.238 >diff -u -p -r1.238 session.c >--- session.c 9 May 2008 16:16:06 -0000 1.238 >+++ session.c 14 Jun 2008 18:18:19 -0000 >@@ -1276,6 +1276,7 @@ do_child(Session *s, const char *command > char *argv[ARGV_MAX]; > const char *shell, *shell0, *hostname = NULL; > struct passwd *pw = s->pw; >+ int r = 0; > > /* remove hostkey from the child's memory */ > destroy_sensitive_data(); >@@ -1362,9 +1363,13 @@ do_child(Session *s, const char *command > > /* Change current directory to the user's home directory. */ > if (chdir(pw->pw_dir) < 0) { >- fprintf(stderr, "Could not chdir to home directory %s: %s\n", >- pw->pw_dir, strerror(errno)); >- if (login_getcapbool(lc, "requirehome", 0)) >+ /* Suppress missing homdir warning for chroot case */ >+ r = login_getcapbool(lc, "requirehome", 0); >+ if (r || options.chroot_directory == NULL) >+ fprintf(stderr, "Could not chdir to home " >+ "directory %s: %s\n", pw->pw_dir, >+ strerror(errno)); >+ if (r) > exit(1); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1461
: 1524 |
1525