diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-11-05 18:03:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-11-05 18:35:28 +0100 |
commit | 005daeed2bcf665a5bdf268b4a18ea923c9de527 (patch) | |
tree | 7f59fb7197c8ecbc6ae58fcde471bf8a40b01707 /src/home/homed-home.c | |
parent | test: Add test for flag macros (diff) | |
download | systemd-005daeed2bcf665a5bdf268b4a18ea923c9de527.tar.xz systemd-005daeed2bcf665a5bdf268b4a18ea923c9de527.zip |
homed: add env var to override dir where we fine stored user records
This adds an env var which we can use to redirect where homed stores and
looks for user records kept on the host. This is useful for debugging
purposes so that one can easily run another homed instnce that doesn't
interfere with the main instance.
Diffstat (limited to 'src/home/homed-home.c')
-rw-r--r-- | src/home/homed-home.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/home/homed-home.c b/src/home/homed-home.c index c111bfa782..10bb96a797 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -300,9 +300,9 @@ int home_save_record(Home *h) { return r; (void) mkdir("/var/lib/systemd/", 0755); - (void) mkdir("/var/lib/systemd/home/", 0700); + (void) mkdir(home_record_dir(), 0700); - fn = strjoina("/var/lib/systemd/home/", h->user_name, ".identity"); + fn = strjoina(home_record_dir(), "/", h->user_name, ".identity"); r = write_string_file(fn, text, WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_MODE_0600|WRITE_STRING_FILE_SYNC); if (r < 0) @@ -316,7 +316,7 @@ int home_unlink_record(Home *h) { assert(h); - fn = strjoina("/var/lib/systemd/home/", h->user_name, ".identity"); + fn = strjoina(home_record_dir(), "/", h->user_name, ".identity"); if (unlink(fn) < 0 && errno != ENOENT) return -errno; |