fix: make dirs readable by other users

This commit is contained in:
ngn
2024-08-16 05:25:02 +03:00
parent 2aa147b351
commit e41a627882
10 changed files with 17 additions and 17 deletions

View File

@ -89,7 +89,7 @@ bool lm_pool_info_download(lm_pool_t *pool, lm_mptp_transfer_callback_t callback
return false;
}
if(!mkdir_ifnot(pool->dir)){
if(!mkdir_ifnot(pool->dir, 0755)){
lm_error_set(LM_ERR_PoolBadDir);
return false;
}

View File

@ -30,12 +30,12 @@ bool lm_pool_list_load(lm_pool_t *pool, char *dir){
pdebug(__func__, "(%s) extracting pool to %s", pool->name, dir);
if(!mkdir_ifnot(pool->dir)){
if(!mkdir_ifnot(pool->dir, 0755)){
lm_error_set(LM_ERR_PoolBadDir);
return false;
}
if(!mkdir_ifnot(dir)){
if(!mkdir_ifnot(dir, 0755)){
lm_error_set(LM_ERR_PoolListBadDir);
return false;
}
@ -102,7 +102,7 @@ bool lm_pool_list_download(lm_pool_t *pool, char *dir, lm_mptp_transfer_callback
return false;
}
if(!mkdir_ifnot(pool->dir)){
if(!mkdir_ifnot(pool->dir, 0755)){
lm_error_set(LM_ERR_PoolBadDir);
return false;
}

View File

@ -17,7 +17,7 @@ bool lm_pool_path_set_dir(lm_pool_t *pool, char *dir){
if(NULL == dir)
return true;
if(exists(dir, NULL) && (is_file(dir) || !can_read(dir) || !can_write(dir))){
if(exists(dir, NULL) && (is_file(dir) || !can_read(dir))){
lm_error_set(LM_ERR_PoolBadDir);
return false;
}
@ -26,12 +26,12 @@ bool lm_pool_path_set_dir(lm_pool_t *pool, char *dir){
pool->info_file = join_alloc(dir, "INFO");
pool->list_file = join_alloc(dir, "LIST");
if(exists(pool->info_file, NULL) && (!is_file(pool->info_file) || !can_read(pool->info_file) || !can_write(pool->info_file))){
if(exists(pool->info_file, NULL) && (!is_file(pool->info_file) || !can_read(pool->info_file))){
lm_error_set(LM_ERR_PoolBadPaths);
return false;
}
if(exists(pool->list_file, NULL) && (!is_file(pool->list_file) || !can_read(pool->list_file) || !can_write(pool->list_file))){
if(exists(pool->list_file, NULL) && (!is_file(pool->list_file) || !can_read(pool->list_file))){
lm_error_set(LM_ERR_PoolBadPaths);
return false;
}