https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277210

--- Comment #22 from commit-h...@freebsd.org ---
A commit in branch stable/14 references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=1ff3118d72b15fb4c02ee156a5073e3e40528587

commit 1ff3118d72b15fb4c02ee156a5073e3e40528587
Author:     Jamie Gritton <ja...@freebsd.org>
AuthorDate: 2024-08-12 22:23:28 +0000
Commit:     Jamie Gritton <ja...@freebsd.org>
CommitDate: 2024-08-16 17:12:24 +0000

    MFC jail: only chdir to user's home directory when user is specified

    jail(8) with the "exec.clean" parameter not only cleans the enviromnent
    variables before running commands, but also changes to the user's home
    directory.  While this makes sense when auser is specified (via one of
    the exec.*_user parameters), it leads to all commands being run in the
    jail's /root directory even in the absence of an explicitly specified
    user.  This can lead to problems when e.g. rc scripts are run from that
    non-world-readable directory, and run counter to expectations that jail
    startup is analogous to system startup.

    Restrict this behvaiour to only users exlicitly specified, either via
    the command line or jail parameters, but not the implicit root user.
    While this changes long-stand practice, it's the more intuitive action.

    jexec(8) has the same problem, and the same fix.

    PR:             277210
    Reported by:    johannes.kunde at gmail
    Differential Revision:  https://reviews.freebsd.org/D46226

    (cherry picked from commit 5cf705491727dd963485f9911ee3d52c3bf148db)

 usr.sbin/jail/command.c | 2 +-
 usr.sbin/jail/jail.8    | 7 ++++++-
 usr.sbin/jexec/jexec.8  | 7 ++++++-
 usr.sbin/jexec/jexec.c  | 2 +-
 4 files changed, 14 insertions(+), 4 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to