From 20e564ed186af23d17072edc2eaa1f3e0d3ad4a0 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 10 Nov 2003 16:14:20 +0000 Subject: [PATCH] Fix issue with relative paths in web_root --- src/configfile.c | 7 +++++-- src/mt-daapd.conf | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 5d887ba9..94bfe4ae 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -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); diff --git a/src/mt-daapd.conf b/src/mt-daapd.conf index 068d1cac..3b4e44b7 100644 --- a/src/mt-daapd.conf +++ b/src/mt-daapd.conf @@ -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