Moved magic directory into ~/var

This commit is contained in:
Michiel Broek
2004-09-14 20:11:20 +00:00
parent e67668499a
commit d9c5d0eb54
6 changed files with 34 additions and 11 deletions

View File

@@ -418,11 +418,11 @@ void InitFDB(void)
/*
* Search the magic directory to see if this file is a magic file.
*/
sprintf(temp, "%s/magic", getenv("MBSE_ROOT"));
sprintf(temp, "%s", CFG.req_magic);
if ((dp = opendir(temp)) != NULL) {
while ((de = readdir(dp))) {
if (de->d_name[0] != '.') {
sprintf(temp, "%s/magic/%s", getenv("MBSE_ROOT"), de->d_name);
sprintf(temp, "%s/%s", CFG.req_magic, de->d_name);
/*
* Only regular files without execute permission are magic requests.
*/
@@ -439,6 +439,8 @@ void InitFDB(void)
}
}
closedir(dp);
} else {
WriteError("$Can't open directory %s", temp);
}
fdb.Deleted = old.Deleted;
fdb.NoKill = old.NoKill;

View File

@@ -1408,6 +1408,7 @@ void global_menu(void)
{
unsigned long crc, crc1;
int i;
char *temp;
if (! check_free())
return;
@@ -1461,6 +1462,14 @@ void global_menu(void)
Syslog('+', "Main config, installed convert for thumbnails");
}
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/magic", getenv("MBSE_ROOT"));
if (strcmp(CFG.req_magic, temp) == 0) {
sprintf(CFG.req_magic, "%s/var/magic", getenv("MBSE_ROOT"));
Syslog('+', "Main config, magic dir moved to %s", CFG.req_magic);
}
free(temp);
if (!CFG.is_upgraded) {
CFG.priority = 15;
#ifdef __linux__