Date: Mon, 25 Jan 1999 00:42:07 +0100 (CET) From: dan@obluda.cz To: FreeBSD-gnats-submit@FreeBSD.ORG Cc: brian@awfulhak.org Subject: bin/9669: [PATCH] PPP ``set title'' command versus command line processing error Message-ID: <199901242342.AAA00908@fio.cz>
index | next in thread | raw e-mail
>Number: 9669
>Category: bin
>Synopsis: ppp
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 24 17:20:03 PST 1999
>Closed-Date:
>Last-Modified:
>Originator: Dan Lukes
>Release: FreeBSD 2.2.8-RELEASE i386
>Organization:
Obludarium
>Environment:
User process PPP
$Id: main.c,v 1.22.2.50 1998/11/26 07:14:43 jkh Exp $
>Description:
If "set [proc]title ..." command used inside "default" section of
configuration file then destroy argv[1] item - it has been set to NULL.
Later in processing, it (destroyed) argument is used as section name. It
caused SYGSEGV abend at line 311/systems.c (function ReadSystem).
Independent problem - the SetProcTitle function in command.c
- should be or shouldn't be rewritten using ``setproctitle(3)'' function ... ?
>How-To-Repeat:
Put "set title <any text>" command into section default of ppp.conf.
Run ppp with no "option" arguments but one or more "section name"
arguments.
>Fix:
--- main.c.ORIG Thu Nov 26 08:14:43 1998
+++ main.c Mon Jan 25 00:34:07 1999
@@ -349,6 +349,14 @@
sig_signal(SIGUSR2, BringDownServer);
+/* In case the `set title ...'' used in default section, so argv[1] is destroyed now */
+ if ( label == 1 && argc > 1 ) {
+ /* In case we use LABEL or `set enddisc label'' */
+ bundle_SetLabel(bundle, argc == 2 ? bundle->argv1 : argv[argc - 1]);
+ system_Select(bundle, bundle->argv1, CONFFILE, prompt, NULL);
+ label++;
+ }
+
for (arg = label; arg < argc; arg++) {
/* In case we use LABEL or `set enddisc label'' */
bundle_SetLabel(bundle, argv[argc - 1]);
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901242342.AAA00908>
