mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -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 <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -48,6 +49,7 @@ int config_read(char *file, CONFIG *pconfig) {
|
||||
int err;
|
||||
char *value;
|
||||
char *comment;
|
||||
char path_buffer[PATH_MAX];
|
||||
err=0;
|
||||
|
||||
buffer=(char*)malloc(MAX_LINE);
|
||||
@ -80,8 +82,9 @@ int config_read(char *file, CONFIG *pconfig) {
|
||||
value[strlen(value)-1] = '\0';
|
||||
|
||||
if(!strcasecmp(buffer,"web_root")) {
|
||||
pconfig->web_root=strdup(value);
|
||||
DPRINTF(ERR_DEBUG,"Web root: %s\n",value);
|
||||
realpath(value,path_buffer);
|
||||
pconfig->web_root=strdup(path_buffer);
|
||||
DPRINTF(ERR_DEBUG,"Web root: %s\n",path_buffer);
|
||||
} else if(!strcasecmp(buffer,"port")) {
|
||||
pconfig->port=atoi(value);
|
||||
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
|
||||
admin_password secret
|
||||
mp3_dir mp3
|
||||
|
Loading…
Reference in New Issue
Block a user