X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=surf.c;h=154957d48e435df5313f158fa652d51b9d4ff159;hb=6af15aa636ae72f1cbd89ed93ea1e5b0c9ddfa02;hp=bff621bbe7d15ea3f14f2c0ba64461cba1e66c62;hpb=a0e269b6bd9d7a70148f4ccbc733df35f071ba74;p=surf.git diff --git a/surf.c b/surf.c index bff621b..154957d 100644 --- a/surf.c +++ b/surf.c @@ -128,11 +128,14 @@ buildpath(const char *path) { if((p = strrchr(apath, '/'))) { *p = '\0'; g_mkdir_with_parents(apath, 0700); + g_chmod(apath, 0700); /* in case it existed */ *p = '/'; } /* creating file (gives error when apath ends with "/") */ - if((f = fopen(apath, "a"))) + if((f = fopen(apath, "a"))) { + g_chmod(apath, 0600); /* always */ fclose(f); + } return apath; }