From: Robert Swiecki Date: Sat, 7 Oct 2017 22:36:13 +0000 (+0200) Subject: common: less const argv X-Git-Tag: 1.9~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d29c196ac61da0c15d923703640c0958d07cb47;p=platform%2Fupstream%2Fnsjail.git common: less const argv --- diff --git a/cmdline.c b/cmdline.c index 74c9351..1189702 100644 --- a/cmdline.c +++ b/cmdline.c @@ -644,7 +644,8 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) dst = dst ? dst : optarg; if (!mountAddMountPtTail (nsjconf, /* src= */ optarg, dst, /* fs_type= */ "", - /* options= */ "", MS_BIND | MS_REC | MS_RDONLY, /* isDir= */ + /* options= */ "", MS_BIND | MS_REC | MS_RDONLY, + /* isDir= */ NS_DIR_MAYBE, /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */ false)) { return false; @@ -657,7 +658,8 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) if (!mountAddMountPtTail (nsjconf, /* src= */ optarg, dst, /* fs_type= */ "", /* options= */ "", MS_BIND | MS_REC, /* isDir= */ NS_DIR_MAYBE, - /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */ + /* mandatory= */ true, NULL, NULL, NULL, 0, + /* is_symlink= */ false)) { return false; } @@ -745,10 +747,10 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) } if (nsjconf->mount_proc == true) { - if (!mountAddMountPtHead - (nsjconf, /* src= */ NULL, "/proc", "proc", "", - nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true, - NULL, NULL, NULL, 0, /* is_symlink= */ false)) { + if (!mountAddMountPtHead(nsjconf, /* src= */ NULL, "/proc", "proc", "", + nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, + /* mandatory= */ true, + NULL, NULL, NULL, 0, /* is_symlink= */ false)) { return false; } } @@ -761,10 +763,10 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) return false; } } else { - if (!mountAddMountPtHead - (nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "", - nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true, - NULL, NULL, NULL, 0, /* is_symlink= */ false)) { + if (!mountAddMountPtHead(nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "", + nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, + /* mandatory= */ true, + NULL, NULL, NULL, 0, /* is_symlink= */ false)) { return false; } } @@ -791,7 +793,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf) } if (argv[optind]) { - nsjconf->argv = (const char *const *)&argv[optind]; + nsjconf->argv = (const char **)&argv[optind]; } if (nsjconf->argv == NULL || nsjconf->argv[0] == NULL) { cmdlineUsage(argv[0]); diff --git a/common.h b/common.h index 632b2af..047df76 100644 --- a/common.h +++ b/common.h @@ -122,7 +122,7 @@ struct nsjconf_t { const char *exec_file; const char *hostname; const char *cwd; - const char *const *argv; + const char **argv; int port; const char *bindhost; int log_fd; diff --git a/contain.h b/contain.h index edba108..31c8714 100644 --- a/contain.h +++ b/contain.h @@ -26,7 +26,7 @@ #include "common.h" -bool containSetupFD(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_err); +bool containSetupFD(struct nsjconf_t * nsjconf, int fd_in, int fd_out, int fd_err); bool containContain(struct nsjconf_t *nsjconf); #endif /* NS_CONTAIN_H */