Bugzilla – Attachment 2696 Details for
Bug 2458
do not print warning about missing home directory in chroot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
do not print warning about missing home directory in chroot
0001-do-not-print-warning-about-missing-home-directory-in.patch (text/plain), 1.76 KB, created by
Christian Hesse
on 2015-09-07 23:17:36 AEST
(
hide
)
Description:
do not print warning about missing home directory in chroot
Filename:
MIME Type:
Creator:
Christian Hesse
Created:
2015-09-07 23:17:36 AEST
Size:
1.76 KB
patch
obsolete
>From 6ff224db72af61f9aa10326c89af44a407194e14 Mon Sep 17 00:00:00 2001 >From: Christian Hesse <mail@eworm.de> >Date: Mon, 7 Sep 2015 15:07:10 +0200 >Subject: [PATCH 1/1] do not print warning about missing home directory in > chroot > >Since setting options.chroot_directory to NULL after successful chroot >the following error message is back: > >Could not chdir to home directory /home/user: No such file or >directory > >Remember that we are inside a chroot and do not print error message >about missing home directory. > >Signed-off-by: Christian Hesse <mail@eworm.de> >--- > session.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > >diff --git a/session.c b/session.c >index 5a64715..35790cf 100644 >--- a/session.c >+++ b/session.c >@@ -160,6 +160,7 @@ login_cap_t *lc; > #endif > > static int is_child = 0; >+static int in_chroot = 0; > > /* Name and directory of socket for authentication agent forwarding. */ > static char *auth_sock_name = NULL; >@@ -1529,6 +1530,14 @@ do_setusercontext(struct passwd *pw) > safely_chroot(chroot_path, pw->pw_uid); > free(tmp); > free(chroot_path); >+ >+ /* >+ * Remember we are inside a chroot. We need this later >+ * to know whether or not to print a warning about >+ * missing home directory. >+ */ >+ in_chroot = 1; >+ > /* Make sure we don't attempt to chroot again */ > free(options.chroot_directory); > options.chroot_directory = NULL; >@@ -1790,8 +1799,7 @@ do_child(Session *s, const char *command) > #ifdef HAVE_LOGIN_CAP > r = login_getcapbool(lc, "requirehome", 0); > #endif >- if (r || options.chroot_directory == NULL || >- strcasecmp(options.chroot_directory, "none") == 0) >+ if (r || in_chroot == 0) > fprintf(stderr, "Could not chdir to home " > "directory %s: %s\n", pw->pw_dir, > strerror(errno)); >-- >2.5.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
Actions:
View
|
Diff
Attachments on
bug 2458
:
2695
|
2696
|
2737