summaryrefslogtreecommitdiff
path: root/pppd/plugins
diff options
context:
space:
mode:
authorEivind Næss <eivnaes@yahoo.com>2022-07-30 14:33:15 -0700
committerEivind Næss <eivnaes@yahoo.com>2022-08-08 11:22:46 -0700
commit66a8c74c3f73d7480a09923a225b56b8829ae790 (patch)
tree7ed0b4e062afd45f9ccd981c68c40e32380a7aea /pppd/plugins
parent2a7caa2b79ff1edd5d19aa8c41d5614e526f1b93 (diff)
downloadppp-66a8c74c3f73d7480a09923a225b56b8829ae790.tar.gz
Let ./configure control the paths for pppd
This was previously done by specifying an overriding value for _ROOT_PATH. With this change, this variable is now gone. Instead, pathnames.h will use the SYSCONFDIR and LOCALSTATEDIR to resolve these paths. These directories is already controlled by configure. Package maintainers should be aware though that this may change their current configuration. The convential ./configure way is to specify: ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run --with-plugin-dir=/usr/lib/pppd/2.4.10 If one omit the --sysconfdir option, then the default location is by ${prefix}/etc which may not be what you want. Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Diffstat (limited to 'pppd/plugins')
-rw-r--r--pppd/plugins/pppoe/Makefile.am2
-rw-r--r--pppd/plugins/pppoe/plugin.c9
-rw-r--r--pppd/plugins/radius/Makefile.am2
-rw-r--r--pppd/plugins/radius/pathnames.h8
-rw-r--r--pppd/plugins/radius/sendserver.c2
5 files changed, 9 insertions, 14 deletions
diff --git a/pppd/plugins/pppoe/Makefile.am b/pppd/plugins/pppoe/Makefile.am
index 6cea70a..5fea701 100644
--- a/pppd/plugins/pppoe/Makefile.am
+++ b/pppd/plugins/pppoe/Makefile.am
@@ -6,7 +6,7 @@ dist_man8_MANS = pppoe-discovery.8
noinst_HEADERS = \
pppoe.h
-pppoe_la_CPPFLAGS = -I${top_srcdir}
+pppoe_la_CPPFLAGS = -I${top_srcdir} -DSYSCONFDIR=\"${sysconfdir}\"
pppoe_la_LDFLAGS = -module -avoid-version
pppoe_la_SOURCES = plugin.c discovery.c if.c common.c
diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c
index 92d0493..7020565 100644
--- a/pppd/plugins/pppoe/plugin.c
+++ b/pppd/plugins/pppoe/plugin.c
@@ -53,13 +53,8 @@ static char const RCSID[] =
#include <pppd/lcp.h>
#include <pppd/ipcp.h>
#include <pppd/ccp.h>
-/* #include <pppd/pathnames.h> ?, see below ... */
-#ifndef _ROOT_PATH
-#define _ROOT_PATH ""
-#endif
-
-#define _PATH_ETHOPT _ROOT_PATH "/etc/ppp/options."
+#define PPP_PATH_ETHOPT SYSCONFDIR "/ppp/options."
char pppd_version[] = PPPD_VERSION;
@@ -332,7 +327,7 @@ PPPOEDeviceOptions(void)
{
char buf[MAXPATHLEN];
- strlcpy(buf, _PATH_ETHOPT, MAXPATHLEN);
+ strlcpy(buf, PPP_PATH_ETHOPT, MAXPATHLEN);
strlcat(buf, devnam, MAXPATHLEN);
if (!options_from_file(buf, 0, 0, 1))
exit(EXIT_OPTION_ERROR);
diff --git a/pppd/plugins/radius/Makefile.am b/pppd/plugins/radius/Makefile.am
index ec637ae..40f4d16 100644
--- a/pppd/plugins/radius/Makefile.am
+++ b/pppd/plugins/radius/Makefile.am
@@ -47,7 +47,7 @@ radrealms_la_SOURCES = radrealms.c
libradiusclient_la_SOURCES = \
avpair.c buildreq.c config.c dict.c ip_util.c \
clientid.c sendserver.c lock.c util.c
-libradiusclient_la_CPPFLAGS = $(RADIUS_CPPFLAGS)
+libradiusclient_la_CPPFLAGS = $(RADIUS_CPPFLAGS) -DSYSCONFDIR=\"${sysconfdir}\"
if !WITH_OPENSSL
libradiusclient_la_SOURCES += md5.c
diff --git a/pppd/plugins/radius/pathnames.h b/pppd/plugins/radius/pathnames.h
index 5aa4c60..3a00d2c 100644
--- a/pppd/plugins/radius/pathnames.h
+++ b/pppd/plugins/radius/pathnames.h
@@ -17,12 +17,12 @@
#ifndef PATHNAMES_H
#define PATHNAMES_H
-#define _PATH_DEV_URANDOM "/dev/urandom" /* Linux only */
-#define _PATH_ETC_ISSUE "/etc/issue"
+#define PPP_PATH_DEV_URANDOM "/dev/urandom" /* Linux only */
+#define PPP_PATH_ETC_ISSUE "/etc/issue"
/* normally defined in the Makefile */
-#ifndef _PATH_ETC_RADIUSCLIENT_CONF
-#define _PATH_ETC_RADIUSCLIENT_CONF "/etc/radiusclient.conf"
+#ifndef PPP_PATH_ETC_RADIUSCLIENT_CONF
+#define PPP_PATH_ETC_RADIUSCLIENT_CONF SYSCONFDIR "/radiusclient.conf"
#endif
#endif /* PATHNAMES_H */
diff --git a/pppd/plugins/radius/sendserver.c b/pppd/plugins/radius/sendserver.c
index f601286..acf78e5 100644
--- a/pppd/plugins/radius/sendserver.c
+++ b/pppd/plugins/radius/sendserver.c
@@ -491,7 +491,7 @@ static void rc_random_vector (unsigned char *vector)
we use /dev/urandom here, as /dev/random might block and we don't
need that much randomness. BTW, great idea, Ted! -lf, 03/18/95 */
- if ((fd = open(_PATH_DEV_URANDOM, O_RDONLY)) >= 0)
+ if ((fd = open(PPP_PATH_DEV_URANDOM, O_RDONLY)) >= 0)
{
unsigned char *pos;
int readcount;