X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Foptions.c;h=346430d454f0037d2450e444ba7865ad03c77147;hp=4407cefa16adbdc272b09206ce490c6bbbf5663d;hb=122606b29e977c437d32c407e640357b43e03e6e;hpb=bfa20ccde2a70b1252dbb614132f1a4cbee815d4;ds=sidebyside 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; }