Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161318530
D56701.id176750.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D56701.id176750.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
@@ -331,15 +331,15 @@
int read_fd, write_fd, exec_fd, pipes[2];
FILE *file;
- /* Invalidate the child PID. */
+ // Invalidate the child PID.
*pid = -1;
- /* The configuration must be readable. */
+ // The configuration must be readable.
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). */
+ // Try to open the configuration for execution (to parse its standard output config instead).
exec_fd = open(cfname, O_RDONLY | O_EXEC);
if (exec_fd < 0) {
if (errno != EACCES)
@@ -353,7 +353,7 @@
err(1, "open_config(): %s", cfname);
}
- /* Set the argument list: <jail_conf> <jail_conf> <jail_dir> <jail_base> <jail_name>. */
+ // Set the argument list: <jail_conf> <jail_conf> <jail_dir> <jail_base> <jail_name>.
const struct cfjail *const current_jail = TAILQ_LAST(&cfjails, cfjails);
char *const jail_conf = __DECONST(char *, cfname);
char *const jail_dir = dirname(memcpy(dir_buf, cfname, cfname_size));
@@ -361,24 +361,24 @@
char *const jail_name = current_jail && current_jail->name ? current_jail->name : __DECONST(char *, "");
char *argv[] = { jail_conf, jail_conf, jail_dir, jail_base, jail_name, NULL };
- /* Read from the pipe instead of the configuration. */
+ // Read from the pipe instead of the configuration.
close(read_fd);
if (pipe(pipes))
err(1, "pipe(): %s", cfname);
read_fd = pipes[0];
write_fd = pipes[1];
- /* Run the configuration as child process. */
+ // Run the configuration as child process.
switch ((*pid = fork())) {
- /* Failed to fork(). */
+ // Failed to fork().
case -1:
err(1, "fork(): %s", cfname);
break;
- /* After successful fork() inside the child process. */
+ // After successful fork() inside the child process.
case 0:
- /* Export the arguments to the executable configuration. */
+ // Export the arguments to the executable configuration.
if (setenv("JAIL_CONF", cfname, 1))
err(1, "setenv(\"JAIL_CONF\", \"%s\"): %s", cfname, cfname);
if (setenv("JAIL_DIR", jail_dir, 1))
@@ -388,28 +388,28 @@
if (setenv("JAIL_NAME", jail_name, 1))
err(1, "setenv(\"JAIL_NAME\", \"%s\"): %s", jail_name, cfname);
- /* Redirect the child's standard output into the pipe. */
+ // Redirect the child's standard output into the pipe.
if (write_fd != STDOUT_FILENO) {
if (dup2(write_fd, STDOUT_FILENO) != STDOUT_FILENO)
err(1, "dup2(): %s", cfname);
close(write_fd);
}
- /* Replace the forked child with the configuration command. */
+ // Replace the forked child with the configuration command.
execve(argv[0], argv, environ);
err(1, "execve(): %s", cfname);
break;
- /* After successful fork() inside the parent process. */
+ // After successful fork() inside the parent process.
default:
- /* Close the write end of the pipe and the executable file descriptor in the parent. */
+ // Close the write end of the pipe and the executable file descriptor in the parent.
close(write_fd); write_fd = -1;
close(exec_fd); exec_fd = -1;
break;
}
}
- /* Wrap a FILE handle around the read-only file descriptor. */
+ // Wrap a FILE handle around the read-only file descriptor.
file = fdopen(read_fd, "r");
if (file == NULL)
err(1, "fdopen(): %s", cfname);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 3, 6:32 PM (14 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32369063
Default Alt Text
D56701.id176750.diff (3 KB)
Attached To
Mode
D56701: Use single line comments in open_file() where appropriate.
Attached
Detach File
Event Timeline
Log In to Comment