From bbcdc4366bbee6c3f4e1ddda31e4eec8c1b3ccc2 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 23 Aug 2016 16:10:21 +1000 Subject: pppd: allow use of arbitrary interface names This is a modified version of a patch from openSUSE that enables PPP interfaces to be called arbitrary names, rather than simply pppX where X is the unit number. The modifications from the stock openSUSE patch are: - refresh patch on top of 018_ip-up_option.diff - fix a printf format-string vulnerability in pppd/main.c:set_ifunit() - clarify the pppd.8 manpage additions - patch pppstats/pppstats.c to query renamed interfaces without complaint Origin: SUSE Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646 Forwarded: no Reviewed-by: Chris Boot Signed-off-by: Paul Mackerras --- pppstats/pppstats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pppstats') diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c index 6367988..46cb9c2 100644 --- a/pppstats/pppstats.c +++ b/pppstats/pppstats.c @@ -88,7 +88,6 @@ int aflag; /* print absolute values, not deltas */ int dflag; /* print data rates, not bytes */ int interval, count; int infinite; -int unit; int s; /* socket or /dev/ppp file descriptor */ int signalled; /* set if alarm goes off "early" */ char *progname; @@ -449,6 +448,7 @@ main(argc, argv) { int c; #ifdef STREAMS + int unit; char *dev; #endif @@ -506,11 +506,6 @@ main(argc, argv) if (argc > 0) interface = argv[0]; - if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) { - fprintf(stderr, "%s: invalid interface '%s' specified\n", - progname, interface); - } - #ifndef STREAMS { struct ifreq ifr; @@ -535,6 +530,11 @@ main(argc, argv) } #else /* STREAMS */ + if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) { + fprintf(stderr, "%s: invalid interface '%s' specified\n", + progname, interface); + } + #ifdef __osf__ dev = "/dev/streams/ppp"; #else -- cgit v1.2.1