aboutsummaryrefslogtreecommitdiffstats
path: root/key2root-rmkey.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-06-23 11:43:50 +0200
committerMattias Andrée <maandree@kth.se>2023-06-23 11:43:57 +0200
commitf7b164989f4e9dcb8f5bd87f544adf5c2070eb81 (patch)
tree41145a93d11fb84a60a247aae85d220480e588c3 /key2root-rmkey.c
parentFix minor mistakes i key2root-lskeys.c, implement key2root-rmkey.c, and minor work on key2root-addkey.c (diff)
downloadkey2root-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 '')
-rw-r--r--key2root-rmkey.c6
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);