diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-02-19 08:14:50 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-02-19 08:14:50 +0000 |
commit | af00e483d236122f0e1f250cec72ad5741ea3d93 (patch) | |
tree | 16019c89a1c445aab4490e77a4e44a259660900c /usr.sbin/rpki-client/mkdir.c | |
parent | e3a2a293219104edf3c95a6fdfc251a01e43c12e (diff) |
Move the mkpath() call from the rsync path to the main process. This allows
to drop cpath from the rsync proc pledge (down to "stdio proc exec").
This will also make work easier with the upcoming http fetcher.
OK tb@
Diffstat (limited to 'usr.sbin/rpki-client/mkdir.c')
-rw-r--r-- | usr.sbin/rpki-client/mkdir.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rpki-client/mkdir.c b/usr.sbin/rpki-client/mkdir.c index d9f466f721a..7369c3de4c5 100644 --- a/usr.sbin/rpki-client/mkdir.c +++ b/usr.sbin/rpki-client/mkdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkdir.c,v 1.1 2021/02/02 18:33:11 claudio Exp $ */ +/* $OpenBSD: mkdir.c,v 1.2 2021/02/19 08:14:49 claudio Exp $ */ /* * Copyright (c) 1983, 1992, 1993 @@ -43,7 +43,7 @@ * dir_mode - file mode of intermediate directories */ int -mkpath(const char *dir) +mkpath(int dirfd, const char *dir) { char *path, *slash; int done; @@ -59,7 +59,7 @@ mkpath(const char *dir) done = (*slash == '\0'); *slash = '\0'; - if (mkdir(path, 0700) == -1 && errno != EEXIST) { + if (mkdirat(dirfd, path, 0700) == -1 && errno != EEXIST) { free(path); return (-1); } |