Skip to content

Commit ce4c710

Browse files
author
crass
committed
Fixes issue #256. If config path in envvar is not absolute, make it so.
1 parent eb36238 commit ce4c710

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/common.c

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "common.h"
2+
#include "debug.h"
23
#include <stdlib.h>
34
#include <unistd.h>
45
#include <stdio.h>
@@ -94,5 +95,11 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) {
9495

9596
return NULL;
9697
have:
98+
if(path[0] != '/') {
99+
path = realpath(path, NULL);
100+
setenv(PROXYCHAINS_CONF_FILE_ENV_VAR, path, 1);
101+
free(path);
102+
path = getenv(PROXYCHAINS_CONF_FILE_ENV_VAR);
103+
}
97104
return path;
98105
}

0 commit comments

Comments
 (0)