Moved magic directory into ~/var
This commit is contained in:
@@ -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;
|
||||
|
@@ -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__
|
||||
|
Reference in New Issue
Block a user