mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-24 10:12:55 +08:00
Fixes issue #256. If config path in envvar is not absolute, make it so.
This commit is contained in:
parent
eb36238c8a
commit
ce4c71078e
@ -1,4 +1,5 @@
|
||||
#include "common.h"
|
||||
#include "debug.h"
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
@ -94,5 +95,11 @@ char *get_config_path(char* default_path, char* pbuf, size_t bufsize) {
|
||||
|
||||
return NULL;
|
||||
have:
|
||||
if(path[0] != '/') {
|
||||
path = realpath(path, NULL);
|
||||
setenv(PROXYCHAINS_CONF_FILE_ENV_VAR, path, 1);
|
||||
free(path);
|
||||
path = getenv(PROXYCHAINS_CONF_FILE_ENV_VAR);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user