Commit Graph

3262 Commits

Author SHA1 Message Date
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
Brian Somers
d27d502ce6 Don't depend on a u_long being 32 bits.
Pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-17 21:22:05 +00:00
Brian Somers
a19363a911 char filename[200] => char filename[MAXPATHLEN]
Pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-17 21:22:01 +00:00
Brian Somers
58f264e1f1 Log the source of client connections to the diagnostic port.
Disallow connections from port numbers <1024 as low port numbers
can only really mean trouble (ftp bounces etc.).

Discussed at length with: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-17 21:21:56 +00:00
Brian Somers
865f3ab28a Remove useless comparison. 1997-12-17 21:21:53 +00:00
Brian Somers
e3b4c40068 If we've got a descriptor table that's bigger than an
fd_set, make sure that all descriptors >2 are closed
when we start - otherwise we're asking for a dump in
FD_SET().

Problem pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org>
1997-12-17 21:21:47 +00:00
Brian Somers
72ca96bfa5 o Log ******** instead of the actual password for "set authkey"
when command logging is switched on.
o Display ******** for the authkey for "show auth"
o Document how \P should be used, and document the other chat escapes
  while I'm there.
o Make sure the full command is displayed when a compound command
  fails - ie, "set novar rubbish" should say "set novar: Invalid command"
  rather than "novar: Invalid command"

Problem pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org> (among others)
1997-12-17 21:21:42 +00:00
Garrett Wollman
3a0a936baa Add -Wno-unused so that ``make world'' can complete successfully.
GCC suppresses the warning for ``standard'' header files, but since the
headers do not come from the ``standard'' place in a ``make world'', GCC
doesn't get it.
1997-12-17 19:38:33 +00:00
Bruce Evans
8355db991e BSDify. 1997-12-17 19:32:54 +00:00
Bruce Evans
f34b67af93 Don't use LDDESTDIR. Just put the -L arg in LDADD. 1997-12-17 15:11:43 +00:00
Bruce Evans
bd29cad15f Use the default LIBOWN, etc. instead of clobbering the defaults to bin,
etc., so that (this part of) `LIBOWN=... make world' can be run by users
other than root.  Actually, use BINOWN instead of LIBOWN, since the files
that we install in /usr/libdata are not libraries, and LIBOWN is not
used for anything else in /usr/libdata.

Rewrote all the rules and cleaned up.
1997-12-17 13:04:18 +00:00
Bruce Evans
1783bbf630 LIBOWN -> BINOWN, etc. There are no libraries here. 1997-12-17 12:38:42 +00:00
Bruce Evans
6935938329 Use the default LIBOWN, etc. instead of clobbering the defaults to bin,
etc., so that (this part of) `LIBOWN=... make world' can be run by users
other than root.  Actually, BINOWN instead of LIBOWN, since fonts are not
libraries.  Only one owner of (non-setuid) installed files is really
supported.
1997-12-17 12:31:58 +00:00
Bruce Evans
a2d1e2fbf5 Fixed missing DPADD by removing empty LDADD. 1997-12-17 11:13:26 +00:00
Bruce Evans
13b6695c0c Fixed building with NOSHARED=YES. libncurses depends on libmytinfo but
libmytinfo was not mentioned explicitly.  The bug was hidden by the
linkage of libncurses to libmytinfo in the shared library case.
1997-12-17 10:06:51 +00:00
Brian Somers
4754552a07 Remove an unnecessary (and wrong) cast. 1997-12-17 00:26:58 +00:00
Brian Somers
83c0952d1c Fix a potential overflow where, if the label passed on the command
line is > LINE_LEN (512 bytes), we scribble (*blush*).

Hinted at by: Theo de Raadt <deraadt@cvs.openbsd.org>

Change sprintf(buf, "fixedstring") to strcpy(buf, "fixedstring").
1997-12-17 00:19:25 +00:00
James Raynard
22ec24834e Typo alert (cosmetic). 1997-12-16 22:23:52 +00:00
Bruce Evans
b732d6bad5 Fixed DPADD. 1997-12-16 17:53:39 +00:00
Bruce Evans
53d0e9f018 Fixed DPADD. 1997-12-16 17:43:33 +00:00
Brian Somers
b399b74b2d Wrap long lines
Submitted by:	Greg Lehey <grog@lemis.com>
1997-12-16 00:32:35 +00:00
Brian Somers
8511968cda Correct return values from alias routines. 1997-12-15 23:34:05 +00:00
Brian Somers
abf533d806 Use LogWARN for command usage messages and unrecognised
commands, not LogCOMMAND.
1997-12-15 20:21:47 +00:00
Brian Somers
32ca334139 Do 2 passes when "delete all"ing. The first pass removes
all RTF_WASCLONED routes, and the second removes the
others.  This avoids the situation where we've added an
RTF_CLONING route (such as ``default''), created some
clones, then deleted the CLONING route before the
WASCLONED route(s).  Without the two passes, we get
errno (not rtm_errno) set to ESRCH when deleting the
WASCLONED route, despite the deletion succeeding !

Also:
  Enhance the route operation failure diagnostics.
  Make portability #ifdefs a bit more generic.
1997-12-15 20:21:15 +00:00
Kazutaka YOKOTA
5d6618fa17 Oops, I forgot to set `cflag' in some cases when initializing the
mouse port.
1997-12-15 02:57:45 +00:00
Guido van Rooij
f2c90b9538 Oops..The default behaviour should be *not* to log all succeeded
requests. If you want this extra loggin, add the -l option.
1997-12-13 19:50:14 +00:00
John Polstra
14e6f796cd Fix a segmentation violation that happened if "auth" was in the
options file but there was no suitable secret in the secrets file.
1997-12-13 05:27:29 +00:00
Sean Eric Fagan
d7b7dcba41 Change the ioctls for procfs around a bit; in particular, whever possible,
change from

	ioctl(fd, PIOC<foo>, &i);

to

	ioctl(fd, PIOC<foo>, i);

This is going from the _IOW to _IO ioctl macro.  The kernel, procctl, and
truss must be in synch for it all to work (not doing so will get errors about
inappropriate ioctl's, fortunately).  Hopefully I didn't forget anything :).
1997-12-13 03:13:49 +00:00
Brian Somers
bcc332bdb0 Allow random IP number allocation to peer.
Validate the peers suggested IP by attempting to make a routing table
entry.
Give up IPCP negotiation if the peer NAKs us with an unusable IP.
Always SIOCDIFADDR then SIOCAIFADDR when configuring the tun device.
Using SIOCSIFDSTADDR allows duplicate dst addresses (which we don't
want)!!!
Allow up to 200 interface names (was 50) (now that ppp can play server
properly).
Up the version number (1.5 -> 1.6).

Cosmetic:
  Log unexpected CCP packets in the CCP log rather than the ERROR log.
  Log unexpected Config Reqs in the appropriate LCP/IPCP/CCP log rather
  than the ERROR log.
  Log failed route additions and deletions with WARN, not TCPIP.
  Log the option id and length for unrecognised IPCP options.
  Change some .Sq to .Ar in the man page.
1997-12-13 02:37:33 +00:00
Bruce Evans
760cf7b24a Fixed printing of and comparison with d_typename[]. It is not always
null terminated.
1997-12-12 18:01:57 +00:00
Bruce Evans
f073fe0e04 MF22 (oops, I committed it to the wrong tree yesterday).
Changed lots of %ld's in format strings back to %d.  %ld was right
when daddr_t was long, but Lite2 changed daddr_t to int32_t which
is implemented as `int' on i386's.
1997-12-12 17:58:31 +00:00
Bruce Evans
484b65d5d8 Fixed the usual multiplication overflow bug in an lseek() offset calculation.
The scan for bad sectors was broken for offsets >= 4G on 32-bit systems.
1997-12-11 07:27:06 +00:00
Bruce Evans
65dafcf329 Merged from Lite2 (fix misformattings in copyright). 1997-12-11 07:12:10 +00:00
Guido van Rooij
690c488d0a Fix some style bugs.
Submitted by:	bruce
1997-12-10 20:33:59 +00:00
Brian Somers
67a886fb97 natd 1_10 => 1_11
Cosmetic style changes
  Use u_short for port values.
Submitted by:	Ari Suutari <ari@suutari.iki.fi>
1997-12-10 02:14:57 +00:00
Guido van Rooij
f51631d732 Log all failed mount attempts.
Also add a flag (-l) so mountd will also log all succeeded requests
to mountd.
1997-12-09 18:43:44 +00:00
Brian Somers
038a366695 Deal with inflate() returning avail_in == avail_out == 0
We must call inflate again in case there's any pending output
despite our input buffer being empty.  If the output buffer
is in fact already flushed, inflate() returns Z_BUF_ERROR.
There isn't really an error !
1997-12-08 20:22:12 +00:00
Brian Somers
d4395dc80b Correct usage of add' and delete'. 1997-12-08 20:09:10 +00:00
Kazutaka YOKOTA
f8b013e208 Explicitly state that the -t option is required only when the
moused command is not able to detect the appropriate protocol for the
give mouse automatically.

Suggested by: sos
1997-12-08 11:54:42 +00:00
Philippe Charnier
18970b8398 Use Pa for files and Ar for arguments. 1997-12-08 07:43:13 +00:00
Nate Williams
50b5ec4154 - Changed strcmp to strncmp for checking the CIS manufacturer strings,
since we only store CIS_MAXSTR data, and the users may stick the
  'entire' CIS string returned from the card in /etc/pccard.conf and
  cause the comparison to (bogusly) fail.

Submitted by:	Brad Karp <karp@eecs.harvard.edu>
1997-12-08 06:35:07 +00:00
Brian Somers
b0624e7fc6 Fix PAP, CHAP & LQR req (I broke the byte ordering when
I did the deflate re-org).
Make PAP & CHAP negotiation prettier in the log file.
If both PAP & CHAP are `enabled' and the peer NAKs CHAP
suggesting PAP, be friendly and REQ PAP the next time.
This is in line with the rfc.
1997-12-07 23:55:29 +00:00
Jonathan M. Bresler
7f19cd73cb update hub.mc with the latest set of anti-spam rules
Submitted by:	jmb
1997-12-07 16:59:28 +00:00
Kazutaka YOKOTA
5f436cfb7b The `moused' daemon is made to support various serial mouse
protocols to recognized extra buttons and wheel/roller. It now has
PnP COM device support code, thus, some recent mouse products are
automatically detected and an appropriate protocol is selected.
The `-i' option will print the result of auto-detection.

- Added support for the following SERIAL mice:
      ALPS GlidePoint, MS IntelliMouse, Kensington Thinking Mouse
  (Genius NetMouse, NetMouse Pro, ASCII MieMouse, Logitech MouseMan+,
  FirstMouse+ are compatible with MS IntelliMouse, when connected
  to a serial port, thus requires no explicit support)
- Added PnP serial mouse identification capability as defined
  by Microsoft and Hayes in "Plug and Play External COM Device
  Specification, rev 1.00".  This support will enable us to identify
  the correct protocol to use, or choose a compatible protocol for the
  given mouse.
- Utilize new ioctls defined in `mouse.h' to get hardware and protocol
  information on PS/2 and bus mouse devices.  Try to guess the correct
  protocol and port combination based on the obtained info.
- Use MOUSE_SETLEVEL ioctl.
- Use constants defined in `mouse.h' rather than using own definitions.
- A New command line option.  The -i option prints the information
  collected though the PnP code and psm/mse ioctls mentioned above,
  and just quits.  This is to test `moused's ability, or inability, to
  detect the correct protocol for the given mouse automatically.
- A new command line option.  The -m option maps a physical button
  to a logical button.
- A new command line option.  The -z option maps the Z axis movement to
  another axis or a pair of buttons.
- Add other options: -3, -C -F -P.
- Added a handler for SIGHUP.  This has been suggested by somebody in the
  past (I don't remember who).  He wanted this because he wants to attach
  or detach a mouse while his laptop is suspended.  Now `moused' will
  reopens and reinitialize the specified port whenever a SIGHUP is
  received.  I don't know how useful this can be...
1997-12-07 08:11:16 +00:00
Brian Somers
f01e577b07 Only allow one arg to `delete' - the mask & gateway aren't necessary.
Delete AF_LINK routes as well as AF_INET.
Allow the word `default' as the arg to `delete' or in place of the
first two args (dest & netmask) to `add'.
Accept INTERFACE as the third arg to `add'.

  You can now say `add default interface' to create a default route
  through the tun interface.  It's reported that subsequent bind()s
  will bind to a broadcast address and not to the address currently
  assigned to the tun device - this is the first step towards
  supporting that first connection that was around from before the
  dynamic IP negotiation....
1997-12-07 04:09:15 +00:00
Peter Wemm
ded275c6ec explicitly set MAN8 since only MAN1 is defaulted. 1997-12-07 02:35:18 +00:00