AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
-AC_PROG_LIBTOOL
AC_PROG_LN_S
+LT_INIT
PKG_PROG_PKG_CONFIG
#
# Specify runtime directory
AC_ARG_WITH([plugin-dir],
- AC_HELP_STRING([--with-plugin-dir=DIR], [Specify the plugin directory for pppd]))
+ AS_HELP_STRING([--with-plugin-dir=DIR],[Specify the plugin directory for pppd]))
AS_IF([test -n "$with_plugin_dir"],
[PPPD_PLUGIN_DIR="$with_plugin_dir"],
[PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
#
# Specify runtime directory
AC_ARG_WITH([runtime-dir],
- AC_HELP_STRING([--with-runtime-dir=DIR], [Specify the runtime directory for pppd]))
+ AS_HELP_STRING([--with-runtime-dir=DIR],[Specify the runtime directory for pppd]))
AS_IF([test -n "$with_runtime_dir"],
[PPPD_RUNTIME_DIR="$with_runtime_dir"],
- [PPPD_RUNTIME_DIR="${localstatedir}/run/pppd"])
+ [PPPD_RUNTIME_DIR="${runstatedir}/pppd"])
AC_SUBST(PPPD_RUNTIME_DIR)
#
# Specify runtime directory
AC_ARG_WITH([logfile-dir],
- AC_HELP_STRING([--with-logfile-dir=DIR], [Specify the log directory for pppd]))
+ AS_HELP_STRING([--with-logfile-dir=DIR],[Specify the log directory for pppd]))
AS_IF([test -n "$with_logfile_dir"],
[PPPD_LOGFILE_DIR="$with_logfile_dir"],
- [PPPD_LOGFILE_DIR="${localstatedir}/log/pppd"])
+ [PPPD_LOGFILE_DIR="${localstatedir}/log/ppp"])
AC_SUBST(PPPD_LOGFILE_DIR)
#
upap.c \
utils.c
-pppd_CPPFLAGS = -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
+pppd_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DLOCALSTATEDIR=\"${localstatedir}\" -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
pppd_LDFLAGS =
pppd_LIBS =
if (auth_script_state == s_up && auth_script_pid == 0) {
update_link_stats(unit);
auth_script_state = s_down;
- auth_script(_PATH_AUTHDOWN);
+ auth_script(PPP_PATH_AUTHDOWN);
}
}
if (!doing_multilink) {
auth_state = s_up;
if (auth_script_state == s_down && auth_script_pid == 0) {
auth_script_state = s_up;
- auth_script(_PATH_AUTHUP);
+ auth_script(PPP_PATH_AUTHUP);
}
}
* Open the file of pap secrets and scan for a suitable secret
* for authenticating this user.
*/
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
addrs = opts = NULL;
ret = UPAP_AUTHNAK;
f = fopen(filename, "r");
* Open the file of pap secrets and scan for a suitable secret.
*/
if (ret <= 0) {
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
addrs = NULL;
f = fopen(filename, "r");
if (f == NULL)
return ret;
}
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
return ret;
}
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
}
}
- filename = _PATH_CHAPFILE;
+ filename = PPP_PATH_CHAPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
char *filename;
struct wordlist *addrs;
- filename = _PATH_SRPFILE;
+ filename = PPP_PATH_SRPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
return 0;
}
} else {
- filename = _PATH_CHAPFILE;
+ filename = PPP_PATH_CHAPFILE;
addrs = NULL;
secbuf[0] = 0;
if (!am_server && passwd[0] != '\0') {
strlcpy(secret, passwd, MAXWORDLEN);
} else {
- filename = _PATH_SRPFILE;
+ filename = PPP_PATH_SRPFILE;
addrs = NULL;
fp = fopen(filename, "r");
case s_up:
if (auth_state == s_down) {
auth_script_state = s_down;
- auth_script(_PATH_AUTHDOWN);
+ auth_script(PPP_PATH_AUTHDOWN);
}
break;
case s_down:
if (auth_state == s_up) {
auth_script_state = s_up;
- auth_script(_PATH_AUTHUP);
+ auth_script(PPP_PATH_AUTHUP);
}
break;
}
char cacertfile[MAXWORDLEN];
char pkfile[MAXWORDLEN];
- filename = _PATH_EAPTLSSERVFILE;
+ filename = PPP_PATH_EAPTLSSERVFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
if (pkcs12_file)
return 1;
- filename = _PATH_EAPTLSCLIFILE;
+ filename = PPP_PATH_EAPTLSCLIFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
}
else
{
- filename = (am_server ? _PATH_EAPTLSSERVFILE : _PATH_EAPTLSCLIFILE);
+ filename = (am_server ? PPP_PATH_EAPTLSSERVFILE : PPP_PATH_EAPTLSCLIFILE);
addrs = NULL;
fp = fopen(filename, "r");
config = NCONF_new( NULL );
dbglog( "Loading OpenSSL config file" );
- ret_code = NCONF_load( config, _PATH_OPENSSLCONFFILE, &error_line );
+ ret_code = NCONF_load( config, PPP_PATH_OPENSSLCONFFILE, &error_line );
if (ret_code == 0)
{
- warn( "EAP-TLS: Error in OpenSSL config file %s at line %d", _PATH_OPENSSLCONFFILE, error_line );
+ warn( "EAP-TLS: Error in OpenSSL config file %s at line %d", PPP_PATH_OPENSSLCONFFILE, error_line );
NCONF_free( config );
config = NULL;
ERR_clear_error();
errno = EINVAL;
return (NULL);
}
- file = _PATH_PSEUDONYM;
+ file = PPP_PATH_PSEUDONYM;
pl = strlen(user) + strlen(file) + 2;
path = malloc(pl);
if (path == NULL)
}
if (!sifaddr(u, wo->ouraddr, wo->hisaddr, GetMask(wo->ouraddr)))
return 0;
- ipcp_script(_PATH_IPPREUP, 1);
+ ipcp_script(PPP_PATH_IPPREUP, 1);
if (!sifup(u))
return 0;
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
ifindex = if_nametoindex(ifname);
/* run the pre-up script, if any, and wait for it to finish */
- ipcp_script(_PATH_IPPREUP, 1);
+ ipcp_script(PPP_PATH_IPPREUP, 1);
/* check if preup script renamed the interface */
if (!if_indextoname(ifindex, ifname)) {
{
FILE *f;
- f = fopen(_PATH_RESOLV, "w");
+ f = fopen(PPP_PATH_RESOLV, "w");
if (f == NULL) {
- error("Failed to create %s: %m", _PATH_RESOLV);
+ error("Failed to create %s: %m", PPP_PATH_RESOLV);
return;
}
fprintf(f, "nameserver %s\n", ip_ntoa(peerdns2));
if (ferror(f))
- error("Write failed to %s: %m", _PATH_RESOLV);
+ error("Write failed to %s: %m", PPP_PATH_RESOLV);
fclose(f);
}
struct protent *protp;
char numbuf[16];
- strlcpy(path_ipup, _PATH_IPUP, MAXPATHLEN);
- strlcpy(path_ipdown, _PATH_IPDOWN, MAXPATHLEN);
+ strlcpy(path_ipup, PPP_PATH_IPUP, MAXPATHLEN);
+ strlcpy(path_ipdown, PPP_PATH_IPDOWN, MAXPATHLEN);
#ifdef PPP_WITH_IPV6CP
- strlcpy(path_ipv6up, _PATH_IPV6UP, MAXPATHLEN);
- strlcpy(path_ipv6down, _PATH_IPV6DOWN, MAXPATHLEN);
+ strlcpy(path_ipv6up, PPP_PATH_IPV6UP, MAXPATHLEN);
+ strlcpy(path_ipv6down, PPP_PATH_IPV6DOWN, MAXPATHLEN);
#endif
link_stats_valid = 0;
new_phase(PHASE_INITIALIZE);
* Parse, in order, the system options file, the user's options file,
* and the command line arguments.
*/
- if (!options_from_file(_PATH_SYSOPTIONS, !privileged, 0, 1)
+ if (!options_from_file(PPP_PATH_SYSOPTIONS, !privileged, 0, 1)
|| !options_from_user()
|| !parse_args(argc-1, argv+1))
exit(EXIT_OPTION_ERROR);
die(0);
/* Make sure fds 0, 1, 2 are open to somewhere. */
- fd_devnull = open(_PATH_DEVNULL, O_RDWR);
+ fd_devnull = open(PPP_DEVNULL, O_RDWR);
if (fd_devnull < 0)
- fatal("Couldn't open %s: %m", _PATH_DEVNULL);
+ fatal("Couldn't open %s: %m", PPP_DEVNULL);
while (fd_devnull <= 2) {
i = dup(fd_devnull);
if (i < 0)
sys_init();
#ifdef PPP_WITH_TDB
- pppdb = tdb_open(_PATH_PPPDB, 0, 0, O_RDWR|O_CREAT, 0644);
+ pppdb = tdb_open(PPP_PATH_PPPDB, 0, 0, O_RDWR|O_CREAT, 0644);
if (pppdb != NULL) {
slprintf(db_key, sizeof(db_key), "pppd%d", getpid());
update_db_entry();
} else {
- warn("Warning: couldn't open ppp database %s", _PATH_PPPDB);
+ warn("Warning: couldn't open ppp database %s", PPP_PATH_PPPDB);
if (multilink) {
warn("Warning: disabling multilink");
multilink = 0;
FILE *pidfile;
slprintf(pidfilename, sizeof(pidfilename), "%s%s.pid",
- _PATH_VARRUN, ifname);
+ PPP_PATH_VARRUN, ifname);
if ((pidfile = fopen(pidfilename, "w")) != NULL) {
fprintf(pidfile, "%d\n", pid);
(void) fclose(pidfile);
return;
script_setenv("LINKNAME", linkname, 1);
slprintf(linkpidfile, sizeof(linkpidfile), "%sppp-%s.pid",
- _PATH_VARRUN, linkname);
+ PPP_PATH_VARRUN, linkname);
if ((pidfile = fopen(linkpidfile, "w")) != NULL) {
fprintf(pidfile, "%d\n", pid);
if (ifname[0])
/*
* device_script - run a program to talk to the specified fds
* (e.g. to run the connector or disconnector script).
- * stderr gets connected to the log fd or to the _PATH_CONNERRS file.
+ * stderr gets connected to the log fd or to the PPP_PATH_CONNERRS file.
*/
int
device_script(char *program, int in, int out, int dont_wait)
if (log_to_fd >= 0)
errfd = log_to_fd;
else
- errfd = open(_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0644);
+ errfd = open(PPP_PATH_CONNERRS, O_WRONLY | O_APPEND | O_CREAT, 0644);
++conn_running;
pid = safe_fork(in, out, errfd);
pw = getpwuid(getuid());
if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0)
return 1;
- file = _PATH_USEROPT;
+ file = PPP_PATH_USEROPT;
pl = strlen(user) + strlen(file) + 2;
path = malloc(pl);
if (path == NULL)
dev = p + 5;
if (dev[0] == 0 || strcmp(dev, "tty") == 0)
return 1; /* don't look for /etc/ppp/options.tty */
- pl = strlen(_PATH_TTYOPT) + strlen(dev) + 1;
+ pl = strlen(PPP_PATH_TTYOPT) + strlen(dev) + 1;
path = malloc(pl);
if (path == NULL)
novm("tty init file name");
- slprintf(path, pl, "%s%s", _PATH_TTYOPT, dev);
+ slprintf(path, pl, "%s%s", PPP_PATH_TTYOPT, dev);
/* Turn slashes into dots, for Solaris case (e.g. /dev/term/a) */
- for (p = path + strlen(_PATH_TTYOPT); *p != 0; ++p)
+ for (p = path + strlen(PPP_PATH_TTYOPT); *p != 0; ++p)
if (*p == '/')
*p = '.';
option_priority = OPRIO_CFGFILE;
return 0;
}
- l = strlen(arg) + strlen(_PATH_PEERFILES) + 1;
+ l = strlen(arg) + strlen(PPP_PATH_PEERFILES) + 1;
if ((fname = (char *) malloc(l)) == NULL)
novm("call file name");
- slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg);
+ slprintf(fname, l, "%s%s", PPP_PATH_PEERFILES, arg);
script_setenv("CALL_FILE", arg, 0);
ok = options_from_file(fname, 1, 1, 1);
const char *vers;
if (strchr(arg, '/') == 0) {
- const char *base = _PATH_PLUGIN;
+ const char *base = PPP_PATH_PLUGIN;
int l = strlen(base) + strlen(arg) + 2;
path = malloc(l);
if (path == 0)
/*
- * define path names
+ * pathnames.h - define default paths for pppd
+ *
+ * Copyright (c) 1999-2002 Paul Mackerras. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. The name(s) of the authors of this software must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission.
+ *
+ * 3. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by Paul Mackerras
+ * <paulus@samba.org>".
+ *
+ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Paths are controlled by configure. Typically, one would pass the following options
+ * to configure:
+ * ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+ *
+ * Note that if the prefix variable do control all the other directory variables, e.g
+ * sysconfdir is ${prefix}/etc. Setting prefix to /usr, you'll have to override
+ * sysconfdir with /etc to avoid installing config files into /usr/etc.
+ *
+ * In addition, there are three explicit variables that has overrides via configure:
+ * - PPPD_RUNTIME_DIR, set by --with-runtime-dir=<dir>
+ * - PPPD_LOGFILE_DIR, set by --with-logfile-dir=<dir>
+ * - PPPD_PLUGIN_DIR, set by --with-plugin-dir=<dir>
*/
#ifndef PPP_PATHNAMES_H
#define PPP_PATHNAMES_H
#endif /* HAVE_PATHS_H */
#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
+#define _PATH_DEVNULL "/dev/null"
#endif
+#define PPP_DEVNULL _PATH_DEVNULL
+
+/*
+ * PPPD_RUNTIME_DIR is set by passing --with-runtime-dir=<path> via configure
+ * the default value set by configure when option is absent is ${localstatedir}/run/pppd
+ */
#ifdef PPPD_RUNTIME_DIR
-#undef _PATH_VARRUN
-#define _PATH_VARRUN PPPD_RUNTIME_DIR "/"
+#define PPP_PATH_VARRUN PPPD_RUNTIME_DIR
+#else
+#define PPP_PATH_VARRUN _PATH_VARRUN
#endif
+/*
+ * PPPD_LOGFILE_DIR is set by passing --with-logfile-dir=<path> via configure
+ * the default value set by configure when option is absent is ${localstatedir}/log/ppp
+ */
#ifdef PPPD_LOGFILE_DIR
-#undef _PATH_VARLOG
-#define _PATH_VARLOG PPPD_LOGFILE_DIR
+#define PPP_PATH_VARLOG PPPD_LOGFILE_DIR
+#else
+#define PPP_PATH_VARLOG _PATH_VARRUN "/log/ppp"
#endif
+/*
+ * PPPD_PLUGIN_DIR is set by passing --with-plugin-dir=<path> via configure
+ * the default value set by configure when option is absent is ${libdir}/pppd/${version}
+ */
#ifdef PPPD_PLUGIN_DIR
-#define _PATH_PLUGIN PPPD_PLUGIN_DIR
-#else
-#ifdef __STDC__
-#define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION
-#else /* __STDC__ */
-#define _PATH_PLUGIN "/usr/lib/pppd"
-#endif /* __STDC__ */
+#define PPP_PATH_PLUGIN PPPD_PLUGIN_DIR
#endif /* PPPD_PLUGIN_DIR */
-#ifndef _ROOT_PATH
-#define _ROOT_PATH
-#endif
+#define PPP_PATH_CONFDIR SYSCONFDIR "/ppp"
-#define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets"
-#define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets"
-#define _PATH_SRPFILE _ROOT_PATH "/etc/ppp/srp-secrets"
+#define PPP_PATH_UPAPFILE PPP_PATH_CONFDIR "/pap-secrets"
+#define PPP_PATH_CHAPFILE PPP_PATH_CONFDIR "/chap-secrets"
+#define PPP_PATH_SRPFILE PPP_PATH_CONFDIR "/srp-secrets"
#ifdef PPP_WITH_EAPTLS
-#define _PATH_EAPTLSCLIFILE _ROOT_PATH "/etc/ppp/eaptls-client"
-#define _PATH_EAPTLSSERVFILE _ROOT_PATH "/etc/ppp/eaptls-server"
-#define _PATH_OPENSSLCONFFILE _ROOT_PATH "/etc/ppp/openssl.cnf"
+#define PPP_PATH_EAPTLSCLIFILE PPP_PATH_CONFDIR "/eaptls-client"
+#define PPP_PATH_EAPTLSSERVFILE PPP_PATH_CONFDIR "/eaptls-server"
+#define PPP_PATH_OPENSSLCONFFILE PPP_PATH_CONFDIR "/openssl.cnf"
#endif /* PPP_WITH_EAPTLS */
-#define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options"
-#define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up"
-#define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down"
-#define _PATH_IPPREUP _ROOT_PATH "/etc/ppp/ip-pre-up"
-#define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up"
-#define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down"
-#define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
-#define _PATH_CONNERRS _ROOT_PATH _PATH_VARLOG "/connect-errors"
-#define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
-#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
+#define PPP_PATH_SYSOPTIONS PPP_PATH_CONFDIR "/options"
+#define PPP_PATH_IPUP PPP_PATH_CONFDIR "/ip-up"
+#define PPP_PATH_IPDOWN PPP_PATH_CONFDIR "/ip-down"
+#define PPP_PATH_IPPREUP PPP_PATH_CONFDIR "/ip-pre-up"
+#define PPP_PATH_AUTHUP PPP_PATH_CONFDIR "/auth-up"
+#define PPP_PATH_AUTHDOWN PPP_PATH_CONFDIR "/auth-down"
+#define PPP_PATH_TTYOPT PPP_PATH_CONFDIR "/options."
+#define PPP_PATH_PEERFILES PPP_PATH_CONFDIR "/peers/"
+#define PPP_PATH_RESOLV PPP_PATH_CONFDIR "/resolv.conf"
-#define _PATH_USEROPT ".ppprc"
-#define _PATH_PSEUDONYM ".ppp_pseudonym"
+#define PPP_PATH_CONNERRS PPP_PATH_VARLOG "/connect-errors"
+
+#define PPP_PATH_USEROPT ".ppprc"
+#define PPP_PATH_PSEUDONYM ".ppp_pseudonym"
#ifdef PPP_WITH_IPV6CP
-#define _PATH_IPV6UP _ROOT_PATH "/etc/ppp/ipv6-up"
-#define _PATH_IPV6DOWN _ROOT_PATH "/etc/ppp/ipv6-down"
+#define PPP_PATH_IPV6UP PPP_PATH_CONFDIR "/ipv6-up"
+#define PPP_PATH_IPV6DOWN PPP_PATH_CONFDIR "/ipv6-down"
+#endif
+
+#define PPP_PATH_PPPDB PPP_PATH_VARRUN "/pppd2.tdb"
+
+#ifdef __linux__
+#define PPP_PATH_LOCKDIR PPP_PATH_VARRUN "/lock"
+#else
+#ifdef SVR4
+#define PPP_PATH_LOCKDIR LOCALSTATEDIR "/spool/locks"
+#else
+#define PPP_PATH_LOCKDIR LOCALSTATEDIR "/spool/lock"
+#endif
#endif
-#ifdef __STDC__
-#define _PATH_PPPDB _ROOT_PATH _PATH_VARRUN "pppd2.tdb"
-#else /* __STDC__ */
-#define _PATH_PPPDB _PPP_VARRUN "pppd2.tdb"
-#endif /* __STDC__ */
#endif /* PPP_PATHNAMES_H */
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
#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;
{
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);
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
#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 */
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;
#include "pppd.h"
#include "fsm.h"
#include "lcp.h"
+#include "pathnames.h"
#if defined(SUNOS4)
#endif
/* Procedures for locking the serial device using a lock file. */
-#ifndef LOCK_DIR
-#ifdef __linux__
-#define LOCK_DIR "/var/lock"
-#else
-#ifdef SVR4
-#define LOCK_DIR "/var/spool/locks"
-#else
-#define LOCK_DIR "/var/spool/lock"
-#endif
-#endif
-#endif /* LOCK_DIR */
-
static char lock_file[MAXPATHLEN];
/*
return -1;
}
slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
- LOCK_DIR, major(sbuf.st_dev),
+ PPP_PATH_LOCKDIR, major(sbuf.st_dev),
major(sbuf.st_rdev), minor(sbuf.st_rdev));
#else
char *p;
if ((p = strrchr(dev, '/')) != NULL)
dev = p + 1;
- slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev);
+ slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", PPP_PATH_LOCKDIR, dev);
#endif
while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) {