diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile index 140a6a2f00cc..c10dc7f99e09 100644 --- a/usr.sbin/ppp/Makefile +++ b/usr.sbin/ppp/Makefile @@ -22,6 +22,10 @@ BINGRP= network CFLAGS+=-DRELEASE_CRUNCH .endif +.if defined(PPP_CONFDIR) && !empty(PPP_CONFDIR) +CFLAGS+=-DPPP_CONFDIR=${PPP_CONFDIR} +.endif + .if defined(NOKLDLOAD) CFLAGS+=-DNOKLDLOAD .endif diff --git a/usr.sbin/ppp/defs.h b/usr.sbin/ppp/defs.h index 9432470db840..088444f4cd5e 100644 --- a/usr.sbin/ppp/defs.h +++ b/usr.sbin/ppp/defs.h @@ -32,7 +32,9 @@ #endif #define NMODEMS 2 -#define _PATH_PPP "/etc/ppp" +#ifndef PPP_CONFDIR +#define PPP_CONFDIR "/etc/ppp" +#endif #define TUN_NAME "tun" #define TUN_PREFIX (_PATH_DEV TUN_NAME) /* /dev/tun */ diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index ecc2e0fc24af..628f2bcc1e7b 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -327,7 +327,7 @@ main(int argc, char **argv) if (ID0realuid() != 0) { char conf[200], *ptr; - snprintf(conf, sizeof conf, "%s/%s", _PATH_PPP, CONFFILE); + snprintf(conf, sizeof conf, "%s/%s", PPP_CONFDIR, CONFFILE); do { struct stat sb; diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c index 1b458534f958..2dc9c3fc3619 100644 --- a/usr.sbin/ppp/systems.c +++ b/usr.sbin/ppp/systems.c @@ -45,7 +45,7 @@ OpenSecret(const char *file) FILE *fp; char line[100]; - snprintf(line, sizeof line, "%s/%s", _PATH_PPP, file); + snprintf(line, sizeof line, "%s/%s", PPP_CONFDIR, file); fp = ID0fopen(line, "r"); if (fp == NULL) log_Printf(LogWARN, "OpenSecret: Can't open %s.\n", line); @@ -325,7 +325,7 @@ ReadSystem(struct bundle *bundle, const char *name, const char *file, if (*file == '/') snprintf(filename, sizeof filename, "%s", file); else - snprintf(filename, sizeof filename, "%s/%s", _PATH_PPP, file); + snprintf(filename, sizeof filename, "%s/%s", PPP_CONFDIR, file); fp = ID0fopen(filename, "r"); if (fp == NULL) { log_Printf(LogDEBUG, "ReadSystem: Can't open %s.\n", filename); @@ -448,7 +448,7 @@ system_IsValid(const char *name, struct prompt *prompt, int mode) return "Configuration label not found"; if (rs == -2) - return _PATH_PPP "/" CONFFILE ": File not found"; + return PPP_CONFDIR "/" CONFFILE " : File not found"; } if (userok == -1)