summaryrefslogtreecommitdiffstats
path: root/src/home/homed-manager-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-11-27 17:05:54 +0100
committerLennart Poettering <lennart@poettering.net>2024-02-14 15:04:15 +0100
commit336b1f1936ffbc62fa2cb189d8f86fbd982dcf15 (patch)
tree6a2c5959f775804cefb027482ce927fd8575b797 /src/home/homed-manager-bus.c
parenthomed: add bus call that allows referencing a home without activating it (diff)
downloadsystemd-336b1f1936ffbc62fa2cb189d8f86fbd982dcf15.tar.xz
systemd-336b1f1936ffbc62fa2cb189d8f86fbd982dcf15.zip
homed: add a ActivateHomeIfReferenced() bus call
This is very similar to ActivateHome() but will fail if the home directory is not referenced yet. Or in other words, this doesn't add any new reference, but simply is the other side of RefUnrestricted(): if we allowed a home dir to be referenced without it actually being active, then this can catch up with things and activated what was previously referenced already. This also relaxes access rights to that users can always activate their own home dirs. This is useful once we allow user code to run without the home dir being activated.
Diffstat (limited to 'src/home/homed-manager-bus.c')
-rw-r--r--src/home/homed-manager-bus.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/home/homed-manager-bus.c b/src/home/homed-manager-bus.c
index c484ef7ac2..c8e232f425 100644
--- a/src/home/homed-manager-bus.c
+++ b/src/home/homed-manager-bus.c
@@ -737,7 +737,12 @@ static const sd_bus_vtable manager_vtable[] = {
SD_BUS_ARGS("s", user_name, "s", secret),
SD_BUS_NO_RESULT,
method_activate_home,
- SD_BUS_VTABLE_SENSITIVE),
+ SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
+ SD_BUS_METHOD_WITH_ARGS("ActivateHomeIfReferenced",
+ SD_BUS_ARGS("s", user_name, "s", secret),
+ SD_BUS_NO_RESULT,
+ method_activate_home,
+ SD_BUS_VTABLE_UNPRIVILEGED|SD_BUS_VTABLE_SENSITIVE),
SD_BUS_METHOD_WITH_ARGS("DeactivateHome",
SD_BUS_ARGS("s", user_name),
SD_BUS_NO_RESULT,