mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
Sanity check the admin-root path
This commit is contained in:
parent
c75a402576
commit
e7b4e3879b
@ -282,6 +282,27 @@ int config_read(char *file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* sanity check the paths */
|
||||||
|
sprintf(path_buffer,"%s/index.html",config.web_root);
|
||||||
|
if((fin=fopen(path_buffer,"r")) == NULL) {
|
||||||
|
err=-1;
|
||||||
|
DPRINTF(E_LOG,L_CONF,"Invalid web_root\n");
|
||||||
|
|
||||||
|
/* check for the common error */
|
||||||
|
if(strcasecmp(config.web_root,"/usr/share/mt-daapd/admin-root") == 0) {
|
||||||
|
/* see if /usr/local is any better */
|
||||||
|
if((fin=fopen("/usr/local/share/mt-daapd/admin-root","r")) != NULL) {
|
||||||
|
fclose(fin);
|
||||||
|
DPRINTF(E_LOG,L_CONF,"Should it be /usr/local/share/mt-daapd/admin-root?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fclose(fin);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* should really check the mp3 path */
|
||||||
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user