From 1ba29b1754201d2e40b30fd73fd65ce249512132 Mon Sep 17 00:00:00 2001 From: Galin Simeonov Date: Mon, 27 Sep 2021 01:35:11 +0300 Subject: created directories did not allow entry --- system_part.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system_part.c b/system_part.c index f8d91db..94eccd9 100644 --- a/system_part.c +++ b/system_part.c @@ -29,7 +29,7 @@ void parse_options(int argc,char **argv) options.output_dir_fd=open(options.output_path,O_RDONLY|O_DIRECTORY); if(options.output_dir_fd==-1) { - mkdir(options.output_path,0770); + mkdir(options.output_path,0775); options.output_dir_fd=open(options.output_path,O_RDONLY|O_DIRECTORY); if(options.output_dir_fd==-1) die("Could not open output dir\n"); @@ -66,7 +66,7 @@ int create_branch_dir(const char *branch_name) ret=openat(options.output_dir_fd,branch_name,O_DIRECTORY|O_RDONLY); if(ret==-1) { - if(mkdirat(options.output_dir_fd,branch_name,0770)==-1) + if(mkdirat(options.output_dir_fd,branch_name,0775)==-1) die("Could not create branch directory for %s\n",branch_name); ret=openat(options.output_dir_fd,branch_name,O_DIRECTORY|O_RDONLY); @@ -92,7 +92,7 @@ FILE* create_file(int branch_dir,const char *filename) memcpy(new_filename+old_filename_len,".html",sizeof(".html")); unlinkat(branch_dir,new_filename,0); - fd=openat(branch_dir,new_filename,O_CREAT|O_RDWR,0660); + fd=openat(branch_dir,new_filename,O_CREAT|O_RDWR,0664); if(fd==-1) die("Could not open the file '%s' for one of the branches\n",filename); @@ -115,7 +115,7 @@ int create_dir(int base_dir,const char *dir_name) if(ret!=-1) return ret; - mkdirat(base_dir,dir_name,0770); + mkdirat(base_dir,dir_name,0775); ret=openat(base_dir,dir_name,O_DIRECTORY|O_RDONLY); if(ret==-1) die("Could not create the 'files' subdirectory of one of the branch dirs\n"); -- cgit v1.2.3