Change _PATH_PPP to PPP_CONFDIR and allow it to be overridden at compile time

This commit is contained in:
Brian Somers 2001-03-23 11:43:22 +00:00
parent 3dfe3292f1
commit 7a66a36d2a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74687
4 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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;

View File

@ -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)