diff options
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/ntux_amain.c | 3 | ||||
-rw-r--r-- | src/driver/ntux_driver_ctx.c | 44 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/driver/ntux_amain.c b/src/driver/ntux_amain.c index 0a24125..5b6587e 100644 --- a/src/driver/ntux_amain.c +++ b/src/driver/ntux_amain.c @@ -55,6 +55,9 @@ static void ntux_perform_unit_actions( { if (dctx->cctx->cmd == NTUX_CMD_STAT) ntux_cmd_stat(dctx,unit); + + else if (dctx->cctx->cmd == NTUX_CMD_CHMOD) + ntux_cmd_chmod(dctx,unit); } static int ntux_exit(struct ntux_driver_ctx * dctx, int ret) diff --git a/src/driver/ntux_driver_ctx.c b/src/driver/ntux_driver_ctx.c index 47718ce..370c69b 100644 --- a/src/driver/ntux_driver_ctx.c +++ b/src/driver/ntux_driver_ctx.c @@ -35,6 +35,7 @@ static const char * const ntux_cmd_name[NTUX_CMD_CAP] = { [NTUX_CMD_STAT] = "stat", [NTUX_CMD_SPAWN] = "spawn", [NTUX_CMD_STRACE] = "strace", + [NTUX_CMD_CHMOD] = "chmod", }; /* ntux command options */ @@ -43,6 +44,7 @@ static const struct argv_option * ntux_cmd_options[NTUX_CMD_CAP] = { [NTUX_CMD_STAT] = ntux_default_options, [NTUX_CMD_SPAWN] = ntux_spawn_options, [NTUX_CMD_STRACE] = ntux_strace_options, + [NTUX_CMD_CHMOD] = ntux_chmod_options, }; /* package info */ @@ -179,6 +181,14 @@ static int ntux_cctx_update( cctx->drvflags |= NTUX_DRIVER_VERSION; break; + case TAG_VERBOSE: + cctx->drvflags |= NTUX_DRIVER_VERBOSE; + break; + + case TAG_SILENT: + cctx->drvflags |= NTUX_DRIVER_SILENT; + break; + case TAG_CMD: if (*nunits) return ntux_driver_usage( @@ -195,6 +205,9 @@ static int ntux_cctx_update( else if (!strcmp(entry->arg,"strace")) cctx->cmd = NTUX_CMD_STRACE; + else if (!strcmp(entry->arg,"chmod")) + cctx->cmd = NTUX_CMD_CHMOD; + break; case TAG_LOADER: @@ -204,6 +217,32 @@ static int ntux_cctx_update( case TAG_LOGFILE: cctx->logfile = entry->arg; break; + + case TAG_REFMODE: + cctx->refmode = entry->arg; + break; + + case TAG_STRMODE: + cctx->strmode = entry->arg; + break; + + case TAG_RECURSIVE: + cctx->drvflags |= NTUX_DRIVER_RECURSIVE; + break; + + case TAG_CHANGES: + cctx->drvflags |= NTUX_DRIVER_CHANGES; + break; + + case TAG_ROOTED: + cctx->drvflags &= ~(uint64_t)NTUX_DRIVER_ROOTLESS; + cctx->drvflags |= NTUX_DRIVER_ROOTED; + break; + + case TAG_ROOTLESS: + cctx->drvflags &= ~(uint64_t)NTUX_DRIVER_ROOTED; + cctx->drvflags |= NTUX_DRIVER_ROOTLESS; + break; } } else { (*nunits)++; @@ -241,6 +280,8 @@ static int ntux_cmd_from_program(const char * program) return NTUX_CMD_SPAWN; else if (!strcmp(mark,"strace")) return NTUX_CMD_STRACE; + else if (!strcmp(mark,"chmod")) + return NTUX_CMD_CHMOD; return NTUX_CMD_DEFAULT; } @@ -380,6 +421,9 @@ int ntux_get_driver_ctx( else if (cctx.cmd == NTUX_CMD_STRACE) argv_optv_init(ntux_strace_options,optv); + else if (cctx.cmd == NTUX_CMD_CHMOD) + argv_optv_init(ntux_chmod_options,optv); + /* spawn, strace */ if ((cctx.cmd == NTUX_CMD_SPAWN) || (cctx.cmd == NTUX_CMD_STRACE)) { argv_scan(argv,optv,&ctx,0); |