Bugzilla – Attachment 1525 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 (portable)
opensshp-suppress-chdir.diff (text/plain), 1.12 KB, created by
Damien Miller
on 2008-06-15 04:21:42 AEST
(
hide
)
Description:
suppress chdir failure warning when ChrootDirectory set (portable)
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2008-06-15 04:21:42 AEST
Size:
1.12 KB
patch
obsolete
>Index: session.c >=================================================================== >RCS file: /var/cvs/openssh/session.c,v >retrieving revision 1.373 >diff -u -p -r1.373 session.c >--- session.c 19 May 2008 06:04:56 -0000 1.373 >+++ session.c 14 Jun 2008 18:17:46 -0000 >@@ -1647,6 +1647,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(); >@@ -1762,12 +1763,15 @@ 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)); > #ifdef HAVE_LOGIN_CAP >- if (login_getcapbool(lc, "requirehome", 0)) >- exit(1); >+ r = login_getcapbool(lc, "requirehome", 0); > #endif >+ 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); > } > > closefrom(STDERR_FILENO + 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