Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154974205
D56699.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56699.diff
View Options
diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c
--- a/usr.sbin/jail/config.c
+++ b/usr.sbin/jail/config.c
@@ -335,16 +335,17 @@
*pid = -1;
/* The configuration must be readable. */
- read_fd = open(cfname, O_RDONLY|O_CLOEXEC);
+ read_fd = open(cfname, O_RDONLY);
if (read_fd < 0)
err(1, "open(): %s", cfname);
/* Try to open the configuration for execution (to parse its standard output config instead). */
- exec_fd = openat(read_fd, "", O_EMPTY_PATH|O_EXEC);
+ exec_fd = open(cfname, O_RDONLY | O_EXEC);
if (exec_fd < 0) {
if (errno != EACCES)
err(1, "openat(): %s", cfname);
} else {
+ close(exec_fd);
const size_t cfname_size = strlen(cfname) + 1;
char dir_buf[PATH_MAX], base_buf[PATH_MAX];
if (cfname_size > PATH_MAX) {
@@ -395,8 +396,8 @@
}
/* Replace the forked child with the configuration command. */
- fexecve(exec_fd, argv, environ);
- err(1, "fexecve(): %s", cfname);
+ execve(argv[0], argv, environ);
+ err(1, "execve(): %s", cfname);
break;
/* After successful fork() inside the parent process. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 9:59 AM (12 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32369060
Default Alt Text
D56699.diff (1 KB)
Attached To
Mode
D56699: Use execve(2) instead of fexecve(2).
Attached
Detach File
Event Timeline
Log In to Comment