Skip to content
Snippets Groups Projects
Commit 7f039014 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Keep the same area file (areas.bbs) mode flags (permissions)

When executing area manager requests that alter the area file, the temp area
file created (with mkstemp) had mode 0600 (owner read/write only). The sysop
very possibly had different permission flags they want to keep for their area
file, so copy the mode flags from the original area file to the temp/new area
file.
parent 0f262d8a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2325 failed
......@@ -1525,6 +1525,7 @@ void alter_areas(str_list_t add_area, str_list_t del_area, fidoaddr_t addr, cons
unsigned u;
size_t add_count, added = 0;
size_t del_count, deleted = 0;
struct stat st = {0};
add_count = strListCount(add_area);
del_count = strListCount(del_area);
......@@ -1541,6 +1542,8 @@ void alter_areas(str_list_t add_area, str_list_t del_area, fidoaddr_t addr, cons
fclose(nmfile);
return;
}
if(stat(cfg.areafile, &st) == 0)
fchmod(file, st.st_mode);
if((afileout=fdopen(file, "w+"))==NULL) {
lprintf(LOG_ERR,"ERROR %u (%s) line %d fdopening %s",errno,strerror(errno),__LINE__,outpath);
fclose(nmfile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment