Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153471581
D46226.id141817.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
838 B
Referenced Files
None
Subscribers
None
D46226.id141817.diff
View Options
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c
--- a/usr.sbin/jail/command.c
+++ b/usr.sbin/jail/command.c
@@ -788,7 +788,7 @@
setenv("HOME", pwd->pw_dir, 1);
setenv("SHELL",
*pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1);
- if (clean && chdir(pwd->pw_dir) < 0) {
+ if (clean && username && chdir(pwd->pw_dir) < 0) {
jail_warnx(j, "chdir %s: %s",
pwd->pw_dir, strerror(errno));
exit(1);
diff --git a/usr.sbin/jexec/jexec.c b/usr.sbin/jexec/jexec.c
--- a/usr.sbin/jexec/jexec.c
+++ b/usr.sbin/jexec/jexec.c
@@ -129,7 +129,7 @@
setenv("HOME", pwd->pw_dir, 1);
setenv("SHELL",
*pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1);
- if (clean && chdir(pwd->pw_dir) < 0)
+ if (clean && username && chdir(pwd->pw_dir) < 0)
err(1, "chdir: %s", pwd->pw_dir);
endpwent();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 8:49 AM (5 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31966164
Default Alt Text
D46226.id141817.diff (838 B)
Attached To
Mode
D46226: Restrict jail(8) and jexec(8) to chdir to the user's directory only when the user is expicitly specified
Attached
Detach File
Event Timeline
Log In to Comment