#include <grp.h>
#include <string.h>
#include <strings.h>
+#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
bool explicit_user = 0; /* Set if "user" option supplied */
bool explicit_passwd = 0; /* Set if "password" option supplied */
char remote_name[MAXNAMELEN]; /* Peer's name for authentication */
+char path_upapfile[MAXPATHLEN]; /* Pathname of pap-secrets file */
+char path_chapfile[MAXPATHLEN]; /* Pathname of chap-secrets file */
#if defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP)
char *cacert_file = NULL; /* CA certificate file (pem format) */
"Set remote name for authentication", OPT_PRIO | OPT_STATIC,
&explicit_remote, MAXNAMELEN },
+ { "pap-secrets", o_string, path_upapfile,
+ "Set pathname of pap-secrets", OPT_PRIO | OPT_PRIV | OPT_STATIC,
+ NULL, MAXPATHLEN },
+
+ { "chap-secrets", o_string, path_chapfile,
+ "Set pathname of chap-secrets", OPT_PRIO | OPT_PRIV | OPT_STATIC,
+ NULL, MAXPATHLEN },
+
{ "login", o_bool, &uselogin,
"Use system password database for PAP", OPT_A2COPY | 1 ,
&session_mgmt },
* Open the file of pap secrets and scan for a suitable secret
* for authenticating this user.
*/
- filename = PPP_PATH_UPAPFILE;
+ filename = 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 = PPP_PATH_UPAPFILE;
+ filename = path_upapfile;
addrs = NULL;
f = fopen(filename, "r");
if (f == NULL)
return ret;
}
- filename = PPP_PATH_UPAPFILE;
+ filename = path_upapfile;
f = fopen(filename, "r");
if (f == NULL)
return 0;
return ret;
}
- filename = PPP_PATH_UPAPFILE;
+ filename = path_upapfile;
f = fopen(filename, "r");
if (f == NULL)
return 0;
}
}
- filename = PPP_PATH_CHAPFILE;
+ filename = path_chapfile;
f = fopen(filename, "r");
if (f == NULL)
return 0;
return 0;
}
} else {
- filename = PPP_PATH_CHAPFILE;
+ filename = path_chapfile;
addrs = NULL;
secbuf[0] = 0;
struct protent *protp;
char numbuf[16];
+ strlcpy(path_upapfile, PPP_PATH_UPAPFILE, MAXPATHLEN);
+ strlcpy(path_chapfile, PPP_PATH_CHAPFILE, MAXPATHLEN);
+
strlcpy(path_ipup, PPP_PATH_IPUP, MAXPATHLEN);
strlcpy(path_ipdown, PPP_PATH_IPDOWN, MAXPATHLEN);
strlcpy(path_ippreup, PPP_PATH_IPPREUP, MAXPATHLEN);
extern bool session_mgmt; /* Do session management (login records) */
extern char our_name[MAXNAMELEN];/* Our name for authentication purposes */
extern char remote_name[MAXNAMELEN]; /* Peer's name for authentication */
+extern char path_upapfile[];/* Pathname of pap-secrets file */
+extern char path_chapfile[];/* Pathname of chap-secrets file */
extern bool explicit_remote;/* remote_name specified with remotename opt */
extern bool demand; /* Do dial-on-demand */
extern char *ipparam; /* Extra parameter for ip up/down scripts */