summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-09-24 17:51:29 -0400
committerDrew DeVault <sir@cmpwn.com>2020-09-24 17:51:29 -0400
commit0d1137f987d78f83e1222ece29a1438a49658d3c (patch)
tree01ba72c6f8b7dfc7b4f3e112ee3dd50e443d7ed0 /src/util.c
parente15aca171dd5a3d1954699252540bda2c832a8fa (diff)
downloadgmnisrv-0d1137f987d78f83e1222ece29a1438a49658d3c.tar.gz
gmnisrv-0d1137f987d78f83e1222ece29a1438a49658d3c.tar.xz
gmnisrv-0d1137f987d78f83e1222ece29a1438a49658d3c.zip
Implement TLS store
Includes hands-free certificate generation and loading
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index 93c6e91..8cc5502 100644
--- a/src/util.c
+++ b/src/util.c
@@ -6,6 +6,7 @@
#include <string.h>
#include <sys/stat.h>
#include "util.h"
+#include <stdio.h>
static void
posix_dirname(char *path, char *dname)
@@ -29,11 +30,11 @@ posix_dirname(char *path, char *dname)
int
mkdirs(char *path, mode_t mode)
{
- char dname[PATH_MAX + 1];
- posix_dirname(path, dname);
- if (strcmp(dname, "/") == 0) {
+ if (strcmp(path, "/") == 0 || strcmp(path, ".") == 0) {
return 0;
}
+ char dname[PATH_MAX + 1];
+ posix_dirname(path, dname);
if (mkdirs(dname, mode) != 0) {
return -1;
}