summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-02-02 09:35:30 +0000
committerbrian <brian@FreeBSD.org>1999-02-02 09:35:30 +0000
commitd8bfa57b5f8f231ac6d1d644df6f6b801593952a (patch)
tree78ac2a95aaa8cba50393f234d65d0dd3598afd3b /usr.sbin/ppp/main.c
parent61788f8e53914697da6084d3426078b1fd4e5832 (diff)
downloadFreeBSD-src-d8bfa57b5f8f231ac6d1d644df6f6b801593952a.zip
FreeBSD-src-d8bfa57b5f8f231ac6d1d644df6f6b801593952a.tar.gz
Don't allow root to specify non-existent labels on
the command line. Revise the error diagnostics so that invalid labels are reported immediately.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 506454a..d37c91d 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.147 1999/01/25 10:19:03 brian Exp $
+ * $Id: main.c,v 1.148 1999/01/28 01:56:33 brian Exp $
*
* TODO:
*/
@@ -239,7 +239,6 @@ CheckLabel(const char *label, struct prompt *prompt, int mode)
const char *err;
if ((err = system_IsValid(label, prompt, mode)) != NULL) {
- fprintf(stderr, "You may not use ppp in this mode with this label\n");
fprintf(stderr, "%s: %s\n", label, err);
if (mode == PHYS_DIRECT)
log_Printf(LogWARN, "Label %s rejected -direct connection: %s\n",
@@ -297,10 +296,8 @@ main(int argc, char **argv)
/* Allow output for the moment (except in direct mode) */
if (mode == PHYS_DIRECT)
prompt = NULL;
- else {
+ else
SignalPrompt = prompt = prompt_Create(NULL, NULL, PROMPT_STD);
- prompt_Printf(prompt, "Working in %s mode\n", mode2Nam(mode));
- }
ID0init();
if (ID0realuid() != 0) {
@@ -325,6 +322,8 @@ main(int argc, char **argv)
else
CheckLabel("default", prompt, mode);
+ prompt_Printf(prompt, "Working in %s mode\n", mode2Nam(mode));
+
if ((bundle = bundle_Create(TUN_PREFIX, mode, (const char **)argv)) == NULL) {
log_Printf(LogWARN, "bundle_Create: %s\n", strerror(errno));
return EX_START;
OpenPOWER on IntegriCloud