aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/auth.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1998-01-05 01:35:20 +0000
committerBrian Somers <brian@FreeBSD.org>1998-01-05 01:35:20 +0000
commit9c97abd8c35ed449774bf680499a79a7450d73b6 (patch)
tree1eb9ae4ae50de10b28f7b62e117ebe18b95e4a5b /usr.sbin/ppp/auth.c
parent080ea93df293769d491eef9e54a5be72c4e38e1f (diff)
downloadsrc-9c97abd8c35ed449774bf680499a79a7450d73b6.tar.gz
src-9c97abd8c35ed449774bf680499a79a7450d73b6.zip
o Allow the use of HISADDR as the first arg to "add".
o Allow a forth argument in ppp.secret, specifying a new label. This gives control over which section of ppp.link{up,down} is used based on the authenticated user. o Support random address ranges in ppp.secret (not just in ppp.conf). o Add a AUTHENTICATING INCOMING CONNECTIONS section to the man page. o Add a bit more about DEFLATE in the man page. o Fix the incorrect "you must specify a password in interactive mode" bit of the manual. o Space things in the man page consistently. o Be more precice about where you can use MYADDR, HISADDR and INTERFACE in the "add" command documentation.
Notes
Notes: svn path=/head/; revision=32267
Diffstat (limited to 'usr.sbin/ppp/auth.c')
-rw-r--r--usr.sbin/ppp/auth.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c
index 7133d45047b4..9e07cc776866 100644
--- a/usr.sbin/ppp/auth.c
+++ b/usr.sbin/ppp/auth.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: auth.c,v 1.24 1997/11/22 03:37:24 brian Exp $
+ * $Id: auth.c,v 1.25 1997/12/24 09:28:50 brian Exp $
*
* TODO:
* o Implement check against with registered IP addresses.
@@ -43,6 +43,8 @@
#include "auth.h"
#include "chat.h"
#include "systems.h"
+#include "iplist.h"
+#include "route.h"
void
LocalAuthInit()
@@ -106,7 +108,7 @@ AuthValidate(const char *fname, const char *system, const char *key)
{
FILE *fp;
int n;
- char *vector[4];
+ char *vector[5];
char buff[LINE_LEN];
char passwd[100];
@@ -125,17 +127,11 @@ AuthValidate(const char *fname, const char *system, const char *key)
ExpandString(vector[1], passwd, sizeof passwd, 0);
if (strcmp(passwd, key) == 0) {
CloseSecret(fp);
- memset(&DefHisAddress, '\0', sizeof DefHisAddress);
- n -= 2;
- if (n > 0) {
- if (ParseAddr(n--, (char const *const *)(vector+2),
- &DefHisAddress.ipaddr,
- &DefHisAddress.mask,
- &DefHisAddress.width) == 0) {
- return (0); /* Invalid */
- }
- }
+ if (n > 2 && !UseHisaddr(vector[2], 1))
+ return (0);
IpcpInit();
+ if (n > 3)
+ SetLabel(vector[3]);
return (1); /* Valid */
}
}
@@ -149,7 +145,7 @@ AuthGetSecret(const char *fname, const char *system, int len, int setaddr)
{
FILE *fp;
int n;
- char *vector[4];
+ char *vector[5];
char buff[LINE_LEN];
static char passwd[100];
@@ -169,15 +165,13 @@ AuthGetSecret(const char *fname, const char *system, int len, int setaddr)
if (setaddr) {
memset(&DefHisAddress, '\0', sizeof DefHisAddress);
}
- n -= 2;
- if (n > 0 && setaddr) {
- LogPrintf(LogDEBUG, "AuthGetSecret: n = %d, %s\n", n, vector[2]);
- if (ParseAddr(n--, (char const *const *)(vector+2),
- &DefHisAddress.ipaddr,
- &DefHisAddress.mask,
- &DefHisAddress.width) != 0)
- IpcpInit();
- }
+ if (n > 2 && setaddr)
+ if (UseHisaddr(vector[2], 1))
+ IpcpInit();
+ else
+ return NULL;
+ if (n > 3)
+ SetLabel(vector[3]);
return (passwd);
}
}