mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-13 07:53:23 -05:00
Fix issue with relative paths in web_root
This commit is contained in:
parent
46aecff93a
commit
20e564ed18
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -48,6 +49,7 @@ int config_read(char *file, CONFIG *pconfig) {
|
|||||||
int err;
|
int err;
|
||||||
char *value;
|
char *value;
|
||||||
char *comment;
|
char *comment;
|
||||||
|
char path_buffer[PATH_MAX];
|
||||||
err=0;
|
err=0;
|
||||||
|
|
||||||
buffer=(char*)malloc(MAX_LINE);
|
buffer=(char*)malloc(MAX_LINE);
|
||||||
@ -80,8 +82,9 @@ int config_read(char *file, CONFIG *pconfig) {
|
|||||||
value[strlen(value)-1] = '\0';
|
value[strlen(value)-1] = '\0';
|
||||||
|
|
||||||
if(!strcasecmp(buffer,"web_root")) {
|
if(!strcasecmp(buffer,"web_root")) {
|
||||||
pconfig->web_root=strdup(value);
|
realpath(value,path_buffer);
|
||||||
DPRINTF(ERR_DEBUG,"Web root: %s\n",value);
|
pconfig->web_root=strdup(path_buffer);
|
||||||
|
DPRINTF(ERR_DEBUG,"Web root: %s\n",path_buffer);
|
||||||
} else if(!strcasecmp(buffer,"port")) {
|
} else if(!strcasecmp(buffer,"port")) {
|
||||||
pconfig->port=atoi(value);
|
pconfig->port=atoi(value);
|
||||||
DPRINTF(ERR_DEBUG,"Port: %d\n",pconfig->port);
|
DPRINTF(ERR_DEBUG,"Port: %d\n",pconfig->port);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
web_root /home/ron/working/mt-daapd/admin-root
|
web_root ../admin-root
|
||||||
port 3689
|
port 3689
|
||||||
admin_password secret
|
admin_password secret
|
||||||
mp3_dir mp3
|
mp3_dir mp3
|
||||||
|
Loading…
Reference in New Issue
Block a user