summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-05-13 03:51:57 +0000
committermidipix <writeonce@midipix.org>2020-05-14 07:18:54 +0000
commitde8f1c50cdd48b3f06226de300e9d2cfb440f484 (patch)
tree73d7efbb715a6575f61ae3beaef66cf4a72096fe /src
parent5e0c62a54d4fca82bca0abfb08b9eac4d201ddfe (diff)
downloadntux-de8f1c50cdd48b3f06226de300e9d2cfb440f484.tar.bz2
ntux-de8f1c50cdd48b3f06226de300e9d2cfb440f484.tar.xz
driver: chmod: added --owner and --group support.
Diffstat (limited to 'src')
-rw-r--r--src/driver/ntux_driver_ctx.c8
-rw-r--r--src/internal/ntux_driver_impl.h2
-rw-r--r--src/skin/ntux_skin_chmod.c6
3 files changed, 16 insertions, 0 deletions
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,"<OWNER>",
+ "also set the owner to %s"},
+
+ {"group", 'G',TAG_GROUP,ARGV_OPTARG_REQUIRED,0,0,"<GROUP>",
+ "also set the group to %s"},
+
{"preserve-root", 0,TAG_ROOTED,ARGV_OPTARG_NONE,0,0,0,
"disallow operating on the root folder /"},