diff options
author | Mattias Andrée <maandree@kth.se> | 2023-06-23 11:43:50 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-06-23 11:43:57 +0200 |
commit | f7b164989f4e9dcb8f5bd87f544adf5c2070eb81 (patch) | |
tree | 41145a93d11fb84a60a247aae85d220480e588c3 /key2root-rmkey.c | |
parent | Fix minor mistakes i key2root-lskeys.c, implement key2root-rmkey.c, and minor work on key2root-addkey.c (diff) | |
download | key2root-f7b164989f4e9dcb8f5bd87f544adf5c2070eb81.tar.gz key2root-f7b164989f4e9dcb8f5bd87f544adf5c2070eb81.tar.bz2 key2root-f7b164989f4e9dcb8f5bd87f544adf5c2070eb81.tar.xz |
Make key directory compile-time configurable (intended for testing)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'key2root-rmkey.c')
-rw-r--r-- | key2root-rmkey.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/key2root-rmkey.c b/key2root-rmkey.c index d3dbc16..eba2a9a 100644 --- a/key2root-rmkey.c +++ b/key2root-rmkey.c @@ -166,17 +166,17 @@ main(int argc, char *argv[]) for (i = 0; i < (size_t)argc; i++) keys[i] = argv[i]; - path = malloc(sizeof("/etc/key2root/") + strlen(user)); + path = malloc(sizeof(KEYPATH"/") + strlen(user)); if (!path) { fprintf(stderr, "%s: malloc: %s\n", argv0, strerror(errno)); exit(1); } - path2 = malloc(sizeof("/etc/key2root/~") + strlen(user)); + path2 = malloc(sizeof(KEYPATH"/~") + strlen(user)); if (!path) { fprintf(stderr, "%s: malloc: %s\n", argv0, strerror(errno)); exit(1); } - stpcpy(stpcpy(path, "/etc/key2root/"), user); + stpcpy(stpcpy(path, KEYPATH"/"), user); stpcpy(stpcpy(path2, path), "~"); fd = open(path, O_RDONLY); |