the cachedir.
-/* $OpenBSD: extern.h,v 1.48 2021/03/02 09:08:59 claudio Exp $ */
+/* $OpenBSD: extern.h,v 1.49 2021/03/02 09:23:59 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
void logx(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
-int mkpathat(int, const char *);
+int mkpath(const char *);
#define RPKI_PATH_OUT_DIR "/var/db/rpki-client"
#define RPKI_PATH_BASE_DIR "/var/cache/rpki-client"
-/* $OpenBSD: main.c,v 1.107 2021/03/02 09:08:59 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.108 2021/03/02 09:23:59 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
* will not build the destination for us.
*/
- if (mkpathat(cachefd, rp->local) == -1)
+ if (mkpath(rp->local) == -1)
err(1, "%s", rp->local);
logx("%s: pulling from network", rp->local);
-/* $OpenBSD: mkdir.c,v 1.3 2021/02/22 09:46:05 claudio Exp $ */
+/* $OpenBSD: mkdir.c,v 1.4 2021/03/02 09:23:59 claudio Exp $ */
/*
* Copyright (c) 1983, 1992, 1993
#include "extern.h"
/*
- * mkpathat -- create directories.
- * dirfd - file descriptor for local directory
+ * mkpath -- create directories.
* path - path
* mode - file mode of terminal directory
* dir_mode - file mode of intermediate directories
*/
int
-mkpathat(int dirfd, const char *dir)
+mkpath(const char *dir)
{
char *path, *slash;
int done;
done = (*slash == '\0');
*slash = '\0';
- if (mkdirat(dirfd, path, 0700) == -1 && errno != EEXIST) {
+ if (mkdir(path, 0755) == -1 && errno != EEXIST) {
free(path);
return (-1);
}