From: Timo Sirainen Date: Wed, 16 Dec 2009 18:22:32 +0000 (-0500) Subject: lib-master: Use t_abspath() to resolve relative path, not realpath(). X-Git-Tag: 2.0.beta2~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c12c5dbeda9c819648c0a814f436bc66f8963b2e;p=thirdparty%2Fdovecot%2Fcore.git lib-master: Use t_abspath() to resolve relative path, not realpath(). --HG-- branch : HEAD --- diff --git a/src/lib-master/master-service-settings.c b/src/lib-master/master-service-settings.c index eac81e7ce5..bfb7a88388 100644 --- a/src/lib-master/master-service-settings.c +++ b/src/lib-master/master-service-settings.c @@ -2,6 +2,7 @@ #include "lib.h" #include "array.h" +#include "abspath.h" #include "istream.h" #include "write-full.h" #include "str.h" @@ -61,16 +62,13 @@ static void ATTR_NORETURN master_service_exec_config(struct master_service *service, bool preserve_home) { const char **conf_argv, *path, *const *paths, *binary_path; - char full_path[PATH_MAX]; binary_path = service->argv[0]; if (*service->argv[0] == '/') { /* already have the path */ } else if (strchr(service->argv[0], '/') != NULL) { /* relative to current directory */ - if (realpath(service->argv[0], full_path) == NULL) - i_fatal("realpath(%s) failed: %m", service->argv[0]); - binary_path = full_path; + binary_path = t_abspath(service->argv[0]); } else if ((path = getenv("PATH")) != NULL) { /* we have to find our executable from path */ paths = t_strsplit(path, ":");