aboutgitcodelistschat:MatrixIRC
path: root/demo
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-08-29 11:50:00 +0200
committerAlice Frosi <afrosi@redhat.com>2023-08-30 10:48:59 +0200
commitd3917582873df723aa2a3ddbb6116950292e114c (patch)
tree778089680e396cf9bf86c201476952f0870e93de /demo
parent0e8806838763655f5f35822e19a20cb21e8d4747 (diff)
downloadseitan-d3917582873df723aa2a3ddbb6116950292e114c.tar
seitan-d3917582873df723aa2a3ddbb6116950292e114c.tar.gz
seitan-d3917582873df723aa2a3ddbb6116950292e114c.tar.bz2
seitan-d3917582873df723aa2a3ddbb6116950292e114c.tar.lz
seitan-d3917582873df723aa2a3ddbb6116950292e114c.tar.xz
seitan-d3917582873df723aa2a3ddbb6116950292e114c.tar.zst
seitan-d3917582873df723aa2a3ddbb6116950292e114c.zip
cooker: simplify tag and add caller metadata
Group the metadata information: - simplify the json by removing the 'tag' and only using 'get' and 'set' keys - get uid and gid at runtime for the target ('caller'). This can be useful when the the UID and GID of the target are only known at runtime and they need to be used for setting the permissions of files - updated example demo/mknod.hjson Signed-off-by: Alice Frosi <afrosi@redhat.com>
Diffstat (limited to 'demo')
-rw-r--r--demo/mknod.hjson37
1 files changed, 23 insertions, 14 deletions
diff --git a/demo/mknod.hjson b/demo/mknod.hjson
index 1936eb8..98715ec 100644
--- a/demo/mknod.hjson
+++ b/demo/mknod.hjson
@@ -2,32 +2,41 @@
{
"match": [
{ "mknodat":
- { "path": { "tag": "path" },
- "mode": { "tag": "mode" },
- "type": { "tag": "type" },
+ { "path": { "set": "path" },
+ "mode": { "set": "mode" },
+ "type": { "set": "type" },
"major": 1,
- "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "tag": "minor" }
+ "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "set": "minor" }
}
},
{ "mknod":
- { "path": { "tag": "path" },
- "mode": { "tag": "mode" },
- "type": { "tag": "type" },
+ { "path": { "set": "path" },
+ "mode": { "set": "mode" },
+ "type": { "set": "type" },
"major": 1,
- "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "tag": "minor" }
+ "minor": { "value": { "in": [ 3, 5, 7, 8, 9 ] }, "set": "minor" }
}
}
],
- "call":
+ "call": [
{ "mknod":
- { "path": { "tag": { "get": "path" } },
- "mode": { "tag": { "get": "mode" } },
- "type": { "tag": { "get": "type" } },
+ { "path": { "get": "path" },
+ "mode": { "get": "mode" },
+ "type": { "get": "type" },
"major": 1,
- "minor": { "tag": { "get": "minor" } }
+ "minor": { "get": "minor" }
},
- "context": { "mnt": "caller", "uid": "caller", "gid": "caller" }
+ "context": { "mnt": "caller" }
},
+ {
+ "lchown": {
+ "path": { "get": "path" },
+ "uid" : { "caller": "uid" },
+ "gid" : { "caller": "gid" }
+ },
+ "context": { "mnt": "caller" }
+ }
+ ],
"return": { "value": 0, "error": 0 }
}
]