summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
authoramurai <amurai@FreeBSD.org>1995-04-16 13:38:39 +0000
committeramurai <amurai@FreeBSD.org>1995-04-16 13:38:39 +0000
commit77fb3e11a9e3cb49e06bada07db0087ce92dbe4c (patch)
tree3b7c457ee92323830e7814c72b7f3e80226d0dd0 /usr.sbin/ppp/command.c
parenta2b0c379b4708d88895945ad3a79a5c2f163d3ed (diff)
downloadFreeBSD-src-77fb3e11a9e3cb49e06bada07db0087ce92dbe4c.zip
FreeBSD-src-77fb3e11a9e3cb49e06bada07db0087ce92dbe4c.tar.gz
Fixing follows and John's fruent explnation than my English....
The first problem I found was that descriptor 0 was being closed. This happens because the modem variable is set to 0 to indicate that it is not valid but there are not enough tests for the modem variable being 0. You can see where I have done this in the patch. Code in OpenModem() dups the modem descriptor if it is < 3. Once this happened the modem was always open and an incomming call would have getty and ppp reading the modem. Descriptor 1 is closed when the quit command was executed from a telnet connection. The next modem open returns descriptor 1 and this gets duped leaving the modem always open again. The modem was not being closed when the connection dropped or was closed from the other end. The UUCP lock was also not removed if the modem could not be opened. Reviewed by: Atsushi Murai <amurai@spec.co.jp> Submitted by: John Capo <jc@irbs.com>
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index bcd14e0..b926879 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.2 1995/02/26 12:17:22 amurai Exp $
+ * $Id: command.c,v 1.3 1995/02/27 10:57:45 amurai Exp $
*
*/
#include <ctype.h>
@@ -445,6 +445,7 @@ char **argv;
VarLocalAuth = LOCAL_NO_AUTH;
close(netfd);
close(1);
+ dup2(2, 1); /* Have to have something here or the modem will be 1 */
netfd = -1;
mode &= ~MODE_INTER;
}
OpenPOWER on IntegriCloud