diff options
| author | Drew DeVault <sir@cmpwn.com> | 2020-09-24 17:51:29 -0400 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2020-09-24 17:51:29 -0400 |
| commit | 0d1137f987d78f83e1222ece29a1438a49658d3c (patch) | |
| tree | 01ba72c6f8b7dfc7b4f3e112ee3dd50e443d7ed0 /src/util.c | |
| parent | e15aca171dd5a3d1954699252540bda2c832a8fa (diff) | |
| download | gmnisrv-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |
