From 122606b29e977c437d32c407e640357b43e03e6e Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Wed, 20 Jan 1999 00:00:35 +0000 Subject: [PATCH] If device name given, complain if not privileged --- pppd/options.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pppd/options.c b/pppd/options.c index 4407cef..346430d 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: options.c,v 1.44 1998/11/07 06:59:28 paulus Exp $"; +static char rcsid[] = "$Id: options.c,v 1.45 1999/01/20 00:00:35 paulus Exp $"; #endif #include @@ -304,6 +304,7 @@ scan_args(argc, argv) char *arg; option_t *opt; + privileged_option = privileged; while (argc > 0) { arg = *argv++; --argc; @@ -1183,11 +1184,15 @@ setdevname(cp, quiet) return -1; } + if (!privileged_option) { + if (!quiet) + option_error("setting the device name requires root privilege"); + return -1; + } + (void) strncpy(devnam, cp, MAXPATHLEN); devnam[MAXPATHLEN-1] = 0; default_device = FALSE; - devnam_info.priv = privileged_option; - devnam_info.source = option_source; return 1; } -- 2.39.2