added mode parameter to mkdirs

This commit is contained in:
Michiel Broek
2002-01-19 13:04:55 +00:00
parent b6ff90ffeb
commit 2bdbf7a494
21 changed files with 30 additions and 29 deletions

View File

@@ -85,7 +85,7 @@ int Add_BBS()
sprintf(temp1, "%s/%s", TIC.Inbound, TIC.NewName);
sprintf(temp2, "%s/%s", TIC.BBSpath, TIC.NewName);
mkdirs(temp2);
mkdirs(temp2, 0755);
if (file_cp(temp1, temp2) != 0) {
WriteError("$Copy to %s failed", temp2);

View File

@@ -162,7 +162,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
* If we need a .TIC file, start creating it.
*/
if (nodes.Tic) {
mkdirs(ticfile);
mkdirs(ticfile, 0770);
if ((fp = fopen(ticfile, "a+")) != NULL) {
fprintf(fp, "Area %s\r\n", TIC.TicIn.Area);
fprintf(fp, "Origin %s\r\n", TIC.TicIn.Origin);

View File

@@ -173,7 +173,7 @@ FILE *newpage(char *Name, char *Title)
later = time(NULL) + 86400;
sprintf(linebuf, "%s/stat/%s.temp", CFG.www_root, Name);
mkdirs(linebuf);
mkdirs(linebuf, 0755);
if ((fa = fopen(linebuf, "w")) == NULL) {
WriteError("$Can't create %s", linebuf);

View File

@@ -82,7 +82,7 @@ void AdoptFile(int Area, char *File, char *Description)
if ((unarc = unpacker(File)) == NULL) {
Syslog('+', "No known archive: %s", File);
sprintf(temp2, "%s/tmp/arc/%s", getenv("MBSE_ROOT"), File);
mkdirs(temp2);
mkdirs(temp2, 0755);
if (file_cp(temp, temp2)) {
WriteError("Can't copy file to %s", temp2);
if (!do_quiet)

View File

@@ -114,7 +114,7 @@ void Check(void)
if (access(area.Path, R_OK) == -1) {
Syslog('!', "No dir: %s", area.Path);
sprintf(newdir, "%s/foobar", area.Path);
mkdirs(newdir);
mkdirs(newdir, 0755);
}
sprintf(fAreas, "%s/fdb/fdb%d.data", getenv("MBSE_ROOT"), i);

View File

@@ -103,7 +103,7 @@ void ImportFiles(int Area)
if ((unarc = unpacker(temp)) == NULL) {
Syslog('+', "Unknown archive format %s", temp);
sprintf(temp2, "%s/tmp/arc/%s", getenv("MBSE_ROOT"), fdb.LName);
mkdirs(temp2);
mkdirs(temp2, 0755);
if (file_cp(temp, temp2)) {
WriteError("Can't copy file to %s", temp2);
Doit = FALSE;
@@ -292,7 +292,7 @@ void ImportFiles(int Area)
if ((unarc = unpacker(temp)) == NULL) {
Syslog('+', "Unknown archive format %s", temp);
sprintf(temp2, "%s/tmp/arc/%s", getenv("MBSE_ROOT"), fdb.LName);
mkdirs(temp2);
mkdirs(temp2, 0755);
if (file_cp(temp, temp2)) {
WriteError("Can't copy file to %s", temp2);
Doit = FALSE;

View File

@@ -483,7 +483,7 @@ void Index(void)
Syslog('!', "Create dir: %s", area.Path);
newdir = xstrcpy(area.Path);
newdir = xstrcat(newdir, (char *)"/");
mkdirs(newdir);
mkdirs(newdir, 0755);
free(newdir);
newdir = NULL;
}

View File

@@ -108,7 +108,7 @@ void Kill(void)
Syslog('!', "Create dir: %s", area.Path);
newdir = xstrcpy(area.Path);
newdir = xstrcat(newdir, (char *)"/");
mkdirs(newdir);
mkdirs(newdir, 0755);
free(newdir);
newdir = NULL;
}

View File

@@ -309,7 +309,7 @@ int AddFile(struct FILERecord fdb, int Area, char *DestPath, char *FromPath)
FILE *fp1, *fp2;
int i, Insert, Done = FALSE, Found = FALSE;
mkdirs(DestPath);
mkdirs(DestPath, 0755);
if (file_cp(FromPath, DestPath)) {
WriteError("Can't move file in place");
return FALSE;
@@ -445,7 +445,7 @@ int CheckFDB(int Area, char *Path)
*/
if (access(Path, W_OK) == -1) {
sprintf(temp, "%s/foobar", Path);
if (mkdirs(temp))
if (mkdirs(temp, 0755))
Syslog('+', "Created directory %s", Path);
}

View File

@@ -50,7 +50,7 @@ void mover(char *fn)
sprintf(To, "%s/%s", CFG.badtic, fn);
Syslog('!', "Moving %s to %s", From, To);
if (mkdirs(To)) {
if (mkdirs(To, 0770)) {
if (file_mv(From, To) != 0)
WriteError("$Failed to move %s to %s", From, To);
}