summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ppp/Makefile4
-rw-r--r--usr.sbin/ppp/defs.h4
-rw-r--r--usr.sbin/ppp/main.c2
-rw-r--r--usr.sbin/ppp/systems.c6
4 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile
index 140a6a2..c10dc7f 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 9432470..088444f 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 ecc2e0f..628f2bc 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 1b45853..2dc9c3f 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)
OpenPOWER on IntegriCloud