diff --git a/include/ntux/ntux.h b/include/ntux/ntux.h index 9c0c373..3e9782e 100644 --- a/include/ntux/ntux.h +++ b/include/ntux/ntux.h @@ -105,6 +105,8 @@ struct ntux_common_ctx { const char * logfile; const char * refmode; const char * strmode; + const char * owner; + const char * group; uint32_t sysmask[16]; uint32_t dbgmask[16]; uint32_t osmask [32]; diff --git a/src/driver/ntux_driver_ctx.c b/src/driver/ntux_driver_ctx.c index 8445b3e..efb1c37 100644 --- a/src/driver/ntux_driver_ctx.c +++ b/src/driver/ntux_driver_ctx.c @@ -232,6 +232,14 @@ static int ntux_cctx_update( cctx->drvflags |= NTUX_DRIVER_CHANGES; break; + case TAG_OWNER: + cctx->owner = entry->arg; + break; + + case TAG_GROUP: + cctx->group = entry->arg; + break; + case TAG_ROOTED: cctx->drvflags &= ~(uint64_t)NTUX_DRIVER_ROOTLESS; cctx->drvflags |= NTUX_DRIVER_ROOTED; diff --git a/src/internal/ntux_driver_impl.h b/src/internal/ntux_driver_impl.h index 06a5c8f..6a7e070 100644 --- a/src/internal/ntux_driver_impl.h +++ b/src/internal/ntux_driver_impl.h @@ -31,6 +31,8 @@ enum app_tags { TAG_STRMODE, TAG_REFMODE, TAG_CHANGES, + TAG_OWNER, + TAG_GROUP, TAG_ROOTED, TAG_ROOTLESS, }; diff --git a/src/skin/ntux_skin_chmod.c b/src/skin/ntux_skin_chmod.c index cb300a6..1aab9c0 100644 --- a/src/skin/ntux_skin_chmod.c +++ b/src/skin/ntux_skin_chmod.c @@ -29,6 +29,12 @@ const struct argv_option ntux_chmod_options[] = { {"changes", 'c',TAG_CHANGES,ARGV_OPTARG_NONE,0,0,0, "a synonym for --refmode"}, + {"owner", 'O',TAG_OWNER,ARGV_OPTARG_REQUIRED,0,0,"", + "also set the owner to %s"}, + + {"group", 'G',TAG_GROUP,ARGV_OPTARG_REQUIRED,0,0,"", + "also set the group to %s"}, + {"preserve-root", 0,TAG_ROOTED,ARGV_OPTARG_NONE,0,0,0, "disallow operating on the root folder /"},