Commit Graph

3307 Commits

Author SHA1 Message Date
Brian Somers
2a279fed14 Allow "set device" to close the open modem if we're in
interactive mode.
Use `netfd' in fcntl() and tc[gs]etattr() calls rather than
the hard coded descriptor 0.
Use _FILENO constants from unistd.h

This un-breaks things after my recent `close(0)' in interactive
mode.

Close STDIN_FILENO, and open _PATH_TTY O_RDONLY as `netfd'.  This
has the effect of allowing `show route' to output more than about
a page of data (on FreeBSD, not OpenBSD....).  I have no idea why,
except that it was a direct consequence of the tcsetattr() in
TtyCommandMode().  My previous fix (closing descriptor 0) `fixed'
this because all calls to tcsetattr() failed :-(
1997-12-30 23:22:31 +00:00
Brian Somers
05d83ad6a4 Typo in error message. 1997-12-30 20:02:50 +00:00
Brian Somers
adac5b72cc Use inet_aton() before gethostbyname()
Suggested by: Christian Sandberg <christian@yes.no>
              Eivind Eklund <perhaps@yes.no>
1997-12-30 20:02:32 +00:00
Brian Somers
65eea2e0fa Allow "add! dst mask gw" (note the ``!'') to do an
RTM_CHANGE if the RTM_ADD fails with an EEXIST.
Allow "delete! dst" (note the ``!'') to silently
fail if the RTM_DELETE fails with an ESRCH.
Also, make the ESRCH and EEXIST error conditions
more understandable to the casual observer.
1997-12-30 02:45:48 +00:00
Alexander Langer
a228025e10 Added copyright (taken from natd.c).
Approved by:	Ari Suutari <ari@suutari.iki.fi>
1997-12-30 00:38:56 +00:00
Brian Somers
f7d8bb14f0 Don't complain that someone's changed the clock unless the time
after a select() interrupt is more than 1 second past what
should have been the end time.
We may just be running on an over-burdened machine.
1997-12-29 22:23:52 +00:00
Brian Somers
b2167e32a4 Show how much time is left before timing out in the
`show timeout' output.
Remove ipIdleSecs variable - it's not used.
1997-12-29 22:23:13 +00:00
Jordan K. Hubbard
de92741516 gateway -> gateway_enable
Pointed out by: Susie Ward <sward@voltage.net>
1997-12-29 20:07:17 +00:00
Brian Somers
b1cbb71c91 Don't expect select() to adjust the passed time when it's
interrupted with a SIGALRM.  In fact, select() sets the
passed time to zero, making the previous implementation
terminate always after 1/10th of a second !

Also, deal with someone changing the clock while we're
sleeping (and restart the whole sleep).

Dangers pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-28 21:55:05 +00:00
James Raynard
bf58fc2646 Fix a couple of stray apostrophes. 1997-12-28 20:52:56 +00:00
Brian Somers
09411a5af3 Initialize mbuf::pnext.
Complain to LogERROR if we have internal inconsistency (not LogDEBUG).
1997-12-28 02:56:43 +00:00
Brian Somers
c60f92ca71 If a packet causes a dial, continue to test whether it's
blocked in the output filter.  If so, proceed with the
dial despite dropping the packet.
1997-12-28 02:46:26 +00:00
Brian Somers
1208d55b60 Allow initial sequence numbers less than what we're expecting.
When CCP is originally negotiated, the only thing we can be
sure about is that we've started adding data to the inflate
dictionary either before or at the same time as the peer.  This
is ok, 'cos DEFLATE is a `sliding window' compressor.
1997-12-28 02:17:06 +00:00
Garrett Wollman
8ff467c6b7 Fix top-of-form bogon. 1997-12-27 20:49:39 +00:00
Steve Price
039016310d Another sysconfig -> rc.conf fix.
PR:		5374
Submitted by:	Studded <Studded@dal.net>
1997-12-27 19:40:20 +00:00
Alexander Langer
f13f9fada7 Typo/$Id$ police. 1997-12-27 19:31:11 +00:00
Brian Somers
de7453bb2a Write to the routing socket as uid 0. It's not good enough
to just open it as uid 0 under OpenBSD.
1997-12-27 19:23:13 +00:00
Steve Price
ff2dff3d42 Fix some minor formatting bugs.
PR:		5216
Submitted by:	Masahiro Sekiguchi <seki@sysrap.cs.fujitsu.co.jp>
1997-12-27 18:54:23 +00:00
Brian Somers
e7250038b6 Show who closes the diagnostic connection.
Show the IP range (if specified) in "show ipcp".
Close unused descriptors 0 and 2 in interactive mode.
Pass (size_t *) rather than (int *) to sysctl().
1997-12-27 13:45:57 +00:00
Brian Somers
fcabffd883 Remove bogus timeout code in Receive().
Don't read(fd, buffer, 0) and think ppp has closed the
connection when `buffer' is full, instead, flush most of
buffer to the terminal and read() for a reasonable length.
This fixes "show route" when there's more than 2k of
routing output.
1997-12-27 13:44:42 +00:00
Brian Somers
313572f3e3 Allow (and document) execution of commands from within
our chat script.
You can now even run chat(8) - see ppp.conf.sample.
1997-12-27 07:22:12 +00:00
Tim Vanderhoek
a86f3c5dee "This is the add^H^H^Hinfo module."
Pedantic comment fix.

PR:		bin/5188
Submitted by:	Alex [3]garbanzo@hooked.net
1997-12-26 05:29:29 +00:00
Tim Vanderhoek
dfb9495b2a Use consistent spelling,
writeable -> writable (recall prior debate over this? :-)
	initialise -> initialize
	recognise -> recognize

Merry Christmas! :)
1997-12-25 09:36:42 +00:00
Wolfram Schneider
86e2983aa5 Small bugfix: store $uid_start instead hard coded value 1000
in /etc/adduser.conf.
1997-12-24 11:44:14 +00:00
Brian Somers
b40d784ebf Correct copyright.
Requested by: Eivind Eklund <perhaps@yes.no>
1997-12-24 10:28:38 +00:00
Brian Somers
70ee81ff6b Cosmetic (style):
sizeof(var) -> sizeof var
  sizeof type -> sizeof(type)

Suggested by: J Wunsch <j@uriah.heep.sax.de>
1997-12-24 09:29:17 +00:00
Brian Somers
f9925914f1 Use sizeof cftypes128 for NCFTYPES128 macro, not sizeof cftypes !
Lucky that sizeof cftypes < sizeof cftypes128
1997-12-24 09:28:11 +00:00
Brian Somers
6fefd43684 strncpy(x,y,sizeof(x)) --> strncpy(x,y,sizeof(x)-1)
Suggested by: Philippe Charnier <charnier@lirmm.fr>
              Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-23 22:38:55 +00:00
Kazutaka YOKOTA
30ee7535d4 - Added support for a new MouseMan model (4 buttons, no wheel).
Based on the report from Dave Bodenstab.
- Turn off PnP COM device enumeration procedure if the user explicitly
  specifies a protocol type with the "-t" option.
- Accept "-t auto".  Now the user may entirely omit the "-t" option
  in the command line, or specify "-t auto" in order to make moused
  detect an appropriate protocol type automatically.  In the
  previous version, moused did so only if the "-t" option is absent
  in the command line. ("-t auto" won't disable PnP COM device
  enumeration.)
- Updated the man page.
1997-12-23 08:04:38 +00:00
Alexander Langer
c62b41d9d5 YTK fix. 1997-12-22 23:00:35 +00:00
Brian Somers
4401489a4a Don't forget to ntohs(sin.sin_port) (DUH!) 1997-12-22 02:28:18 +00:00
Brian Somers
abbdf4e916 Charles Mott created these (and told me via email that
they were BSD copyright).  Use his name, not mine.
1997-12-21 14:28:24 +00:00
Brian Somers
c39934ea32 Add (BSD) copyright headers. 1997-12-21 12:11:13 +00:00
Brian Somers
0ec82e961e Cosmetic: Test for comment lines after the lenght has been established.
Pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-21 03:41:23 +00:00
Brian Somers
8fe71e0656 Allow multiple (comma seperated) devices on the "set device" line.
Submitted by: Derek Inksetter <derek@saidev.com>
1997-12-21 03:16:19 +00:00
Brian Somers
25ee22f573 Cosmetic: Tidy up.
Submitted by:	Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-21 02:37:49 +00:00
Brian Somers
857a4bf337 Mention that leading whitespace is ignored when identifying comments. 1997-12-21 02:34:27 +00:00
Brian Somers
2e14bb4605 Zero struct sockaddr_??s before filling them in.
Suggested by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-21 02:27:32 +00:00
Brian Somers
aa2e5be7ae Allow leading whitespace before '#' when identifying comments.
Submitted by: Dave Bodenstab <imdave@mcs.net>
1997-12-21 02:11:48 +00:00
Brian Somers
bb1d272c41 Correct the "how to find out if the line is up" example. 1997-12-21 01:21:40 +00:00
Brian Somers
0ecc184e10 Cosmetic: Remove blank lines, add .Pp where necessary.
Submitted by:	Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-21 01:07:13 +00:00
Sean Eric Fagan
267ffcab5c Add a copyright and license statement, at the request of Jordan. 1997-12-20 18:34:49 +00:00
Bruce Evans
389bd59ff7 Never create the destination directory at install time.
Don't build things at install time.
Don't override the (correct) clean rule.
Rewrote all the rules and cleaned up.
1997-12-20 00:40:05 +00:00
Bruce Evans
100c897389 Handle the ``maintenance'' case better.
Fixed some style bugs.
1997-12-19 23:56:18 +00:00
Brian Somers
5a76e22406 Reset our "ifaddr" to zero if the "set ifaddr" fails in
-auto mode.  This makes ppp correctly exit if you kick it
off twice in auto mode with the same label (read: interface).
1997-12-19 18:11:05 +00:00
Brian Somers
f5fb6bd02a If the peer asks for IP 0.0.0.0, choose an IP ourselves
without looking for it in our IP list (and if found, trying
to ifconfig it!).
1997-12-19 04:49:53 +00:00
Bruce Evans
5ce43a5e9b Install sysctl in /sbin. It is used in some cases in network_pass1(),
before /usr is mounted if /usr has type nfs.
1997-12-18 15:34:08 +00:00
Brian Somers
16f81f6873 Replace
strcpy(a, b);  /* a and b are the same size */

with

  strncpy(a, b, sizeof(a));
  a[sizeof(a)-1] = '\0';

Making the code `correct at a glance'.

Suggested by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-18 01:10:13 +00:00
Brian Somers
31746f5580 "No reply from ppp" -> "Connection closed".
"No reply" sounds like the message didn't get through (for
example when you `pppctl xxxx quit all'.
1997-12-18 00:29:56 +00:00
Brian Somers
a09d09cbe7 Don't log the actual password when command-logging
"passwd xxxx".
1997-12-18 00:28:36 +00:00