Bug 1564 - non-accessible user's home directory not reported when ChrootDirectory=none
Summary: non-accessible user's home directory not reported when ChrootDirectory=none
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 5.2p1
Hardware: All Solaris
: P3 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_6
  Show dependency treegraph
 
Reported: 2009-02-26 23:21 AEDT by Jan Pechanec
Modified: 2011-01-24 12:33 AEDT (History)
1 user (show)

See Also:


Attachments
suggested patch (449 bytes, patch)
2009-02-26 23:21 AEDT, Jan Pechanec
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pechanec 2009-02-26 23:21:07 AEDT
Created attachment 1608 [details]
suggested patch

ChrootDirectory=none is the same as not specifying ChrootDirectory at all. In both cases, sshd should report when the user's directory can't be cd into. It does that only when chroot_directory is NULL. There is a missing check for "none" in session.c:

                /* Suppress missing homedir warning for chroot case */
#ifdef HAVE_LOGIN_CAP
                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));

all other checks with chroot_directory has that "none" part. The patch to fix this is very simple and attached. Tested against 5.2p1.
Comment 1 Damien Miller 2010-06-18 13:16:15 AEST
Fix applied - thanks. This will be in OpenSSH-5.6
Comment 2 Damien Miller 2011-01-24 12:33:53 AEDT
Move resolved bugs to CLOSED after 5.7 release