summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-08-29 23:02:42 +0000
committerbrian <brian@FreeBSD.org>1998-08-29 23:02:42 +0000
commita6f2807f3b625c8a4e85daa68692e88033a45ef8 (patch)
tree9cbd91c3bb20123d0c0cf5ad8bd5014d4f18d8f6 /usr.sbin/ppp/command.c
parent58408d403285d0a4a43b840f34545391c5024f22 (diff)
downloadFreeBSD-src-a6f2807f3b625c8a4e85daa68692e88033a45ef8.zip
FreeBSD-src-a6f2807f3b625c8a4e85daa68692e88033a45ef8.tar.gz
Add the following word substitutions when running a shell
command: AUTHNAME: The local authname ENDDISC: The local endpoint discriminator LABEL: The configuration label in use PEER_ENDDISC: The peers endpoint discriminator USER: The peers authname
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index a36d5d4..fc9e26e 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.163 1998/08/29 18:37:02 brian Exp $
+ * $Id: command.c,v 1.164 1998/08/29 23:02:39 brian Exp $
*
*/
#include <sys/types.h>
@@ -127,7 +127,7 @@
#define NEG_DNS 50
const char Version[] = "2.0";
-const char VersionDate[] = "$Date: 1998/08/29 18:37:02 $";
+const char VersionDate[] = "$Date: 1998/08/29 23:02:39 $";
static int ShowCommand(struct cmdargs const *);
static int TerminalCommand(struct cmdargs const *);
@@ -376,10 +376,22 @@ expand(char **nargv, int argc, char const *const *oargv, struct bundle *bundle)
nargv[0] = strdup(oargv[0]);
for (arg = 1; arg < argc; arg++) {
- nargv[arg] = subst(strdup(oargv[arg]), "HISADDR",
+ nargv[arg] = strdup(oargv[arg]);
+ nargv[arg] = subst(nargv[arg], "HISADDR",
inet_ntoa(bundle->ncp.ipcp.peer_ip));
+ nargv[arg] = subst(nargv[arg], "AUTHNAME", bundle->cfg.auth.name);
nargv[arg] = subst(nargv[arg], "INTERFACE", bundle->ifp.Name);
nargv[arg] = subst(nargv[arg], "MYADDR", inet_ntoa(bundle->ncp.ipcp.my_ip));
+ nargv[arg] = subst(nargv[arg], "USER", bundle->ncp.mp.peer.authname);
+ nargv[arg] = subst(nargv[arg], "PEER_ENDDISC",
+ mp_Enddisc(bundle->ncp.mp.peer.enddisc.class,
+ bundle->ncp.mp.peer.enddisc.address,
+ bundle->ncp.mp.peer.enddisc.len));
+ nargv[arg] = subst(nargv[arg], "ENDDISC",
+ mp_Enddisc(bundle->ncp.mp.cfg.enddisc.class,
+ bundle->ncp.mp.cfg.enddisc.address,
+ bundle->ncp.mp.cfg.enddisc.len));
+ nargv[arg] = subst(nargv[arg], "LABEL", bundle_GetLabel(bundle));
}
nargv[arg] = NULL;
}
OpenPOWER on IntegriCloud