#include "close-keep-errno.h"
#include "istream.h"
#include "istream-seekable.h"
+#include "abspath.h"
#include "safe-mkstemp.h"
#include "eacces-error.h"
#include "mkdir-parents.h"
struct istream *input;
struct mailbox_transaction_context *t;
struct mailbox_header_lookup_ctx *headers_ctx;
- char cwd[PATH_MAX];
void **sets;
uid_t process_euid;
bool stderr_rejection = FALSE;
break;
case 'p':
/* input path */
- path = optarg;
- if (*path != '/') {
- /* expand relative paths before we chdir */
- if (getcwd(cwd, sizeof(cwd)) == NULL)
- i_fatal("getcwd() failed: %m");
- path = t_strconcat(cwd, "/", path, NULL);
- }
+ path = t_abspath(optarg);
break;
default:
print_help();
#include "write-full.h"
#include "env-util.h"
#include "hostpid.h"
+#include "abspath.h"
#include "restrict-process-size.h"
#include "master-service.h"
#include "master-service-settings.h"
static const char *get_full_config_path(struct service_list *list)
{
const char *path;
- char cwd[PATH_MAX];
path = master_service_get_config_path(master_service);
if (*path == '/')
return path;
- if (getcwd(cwd, sizeof(cwd)) == NULL)
- i_fatal("getcwd() failed: %m");
- return p_strconcat(list->pool, cwd, "/", path, NULL);
+ return p_strdup(list->pool, t_abspath(path));
}
static void master_time_moved(time_t old_time, time_t new_time)