Commit Graph

4002 Commits

Author SHA1 Message Date
Jonathan Lemon
889b293a21 Null terminate buffer.
PR: 23150
Submitted by: Dan Nelson <dnelson@emsphone.com>
MFC in: 1 week
2001-06-07 05:26:26 +00:00
Dima Dorfman
41ff7633ea Silence the remaining warnings and clamp down with WARNS=2.
Not objected to by:	-audit
2001-06-07 02:57:58 +00:00
Jonathan Lemon
a8fb4e2810 o If the file being tailed is moved back to the original location,
resume using kqueue to monitor it, if possible.
  o auto-clear the read filter on EOF; this is needed when tailing a FIFO.
2001-06-06 17:47:13 +00:00
Ruslan Ermilov
1438aefc25 fmt(1) rewrite by Gareth McCaughan.
PR:		bin/5901, bin/12242, bin/19071
Submitted by:	Gareth McCaughan <gjm11@dpmms.cam.ac.uk>
Obtained from:	OpenBSD + ctype(3), WARNS=2, and manpage cleanup
MFC after:	2 weeks
2001-06-06 10:17:05 +00:00
Poul-Henning Kamp
c689eed5f3 There is no reason for logname to call getopt(3), it doesn't take
any options.

PR:		26689
Submitted by:	Félix-Antoine Paradis <reel@sympatico.ca>
2001-06-05 21:04:42 +00:00
Maxim Sobolev
54bb9f535c - Optimise current cursor position displaying routines, to avoid unnecessary
cursor movements;
- minor cleanups in cursor position displaying routines;
- properly resent "file modified" flag when editing several files.

MFC after:	1 week
2001-06-03 12:42:19 +00:00
Mike Heffner
db72da7b83 Use S_IXUSR instead of hardcoded values.
Reviewed by:	md5
2001-06-02 03:10:07 +00:00
Ruslan Ermilov
f66c1ecf8f Don't treat the pipe symbol in capabilities as an alternate
record name indicator; this causes a spurious warning:

$ cat x
record:\
	:capability=|value:
$ cap_mkdb x
cap_mkdb: ignored duplicate: record

Spotted by:	dcs
2001-06-01 14:45:00 +00:00
Hajimu UMEMOTO
2c5958aa51 Do retry next entry in addrinfo during connect.
MFC after:	1 week
2001-06-01 13:43:20 +00:00
Thomas Moestl
d62de5c4bb Replace a use of the hw.nintr sysctl as it has just gone away, cast
size_t variables when passing them to a printf-like function, and some
minor cleanups.
2001-06-01 13:29:19 +00:00
Dag-Erling Smørgrav
1a4a063934 Don't try to print a completion percentage for zero-size files.
PR:		27780
Submitted by:	Craig Leres <leres@ee.lbl.gov>
2001-06-01 10:24:58 +00:00
Dima Dorfman
6b0b1ebfc5 Correct a typo.
PR:		22885
Submitted by:	Rene de Vries <rene@tunix.nl>
2001-06-01 02:53:32 +00:00
Dima Dorfman
6ab55b23e2 Correct some typos.
PR:		27251
Submitted by:	Pekka Savola <pekkas@netcore.fi>
2001-06-01 02:28:15 +00:00
Dima Dorfman
0444aaa030 Don't install setgid kmem. 2001-06-01 01:14:28 +00:00
Thomas Moestl
e0038fe587 Cast size_t variables before printing them to cope with the case of
sizeof(size_t) != sizeof(int).
2001-05-31 22:36:51 +00:00
Dima Dorfman
b15abefff0 Convert to use the sysctl interface to obtain the data when operating
on a running system.  Using kvm is still supported, primarily for
postmortem analysis.

Reviewed by:	tmm
2001-05-31 22:30:39 +00:00
Ruslan Ermilov
18fbb861ab Display -tcp w/o load average so that all statistics fits on a 80x25 screen. 2001-05-31 07:14:52 +00:00
Ruslan Ermilov
7bbf75ec4f Show TCP checksum failures with -tcp display.
PR:		bin/27786
Submitted by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-05-31 07:08:49 +00:00
Ruslan Ermilov
b4ad2d5f3f Note that the default behavior has changed to copy files.
Also, fix markup in the SYNOPSIS.

Submitted by:	dougb
2001-05-30 09:45:47 +00:00
Ruslan Ermilov
fcbb2c69df Backout rev. 1.42 (relaxing the check for -d plus other flags).
Instead, issue a warning for now if -d and -C options are used
together.  This will be turned into an error before 4.5-RELEASE.

Reviewed by:	imp
2001-05-30 07:08:49 +00:00
Dima Dorfman
c1a7db888d Mention how env(1) can be used with the "#!" construct.
PR:		27690
Submitted by:	Mike Meyer <mwm@mired.org>
2001-05-30 03:15:39 +00:00
Dima Dorfman
dd512c47f1 Don't claim to ignore interrupts.
PR:		27747
Submitted by:	Gerhard Sittig <Gerhard.Sittig@gmx.net>
2001-05-30 02:39:53 +00:00
Dima Dorfman
9b1fd3272e Remove home-grown prototypes of time() and localtime().
Reviewed by:	md5(1)
2001-05-30 02:38:10 +00:00
Dima Dorfman
f878e83f9d Replace the cast I removed in rev. 1.16 with a slightly less evil one
(well, at least one that gcc doesn't complain about).  This fixes -r,
which rev. 1.16 broke.

Submitted by:	bde
2001-05-29 23:35:18 +00:00
Poul-Henning Kamp
753d49786e Remove MFS 2001-05-29 20:39:47 +00:00
Warner Losh
4c48c580ec Use use ${INSTALL} -d in our build process. If INSTALL is set to
"install -C" then things will fail due to new checks.  Relax the
checks so that install -C -d works again.
2001-05-29 18:41:16 +00:00
Gregory Neil Shapiro
1d3ebaf302 Make sure the len() builtin always returns an answer. Previously,
len(`') didn't return an answer.  Now it returns 0.

PR:		bin/12942
MFC after:	5 days
2001-05-29 03:32:38 +00:00
Poul-Henning Kamp
861c52f1c4 Direct queries for IP numbers to ARIN. It would be nice if we could
send them to APNIC/RIPE intelligently, but we can't at this time so
fallback to ARIN and depend on them telling the user where to look.

Maybe we need a .whoisrc file...

PR:		24707
Submitted by:	Mike Barcroft mike@q9media.com
MFC after:	1 week
2001-05-28 21:37:29 +00:00
Poul-Henning Kamp
c59c7f97ad Call kvm_close() before exit for consistency.
PR:		24654
Submitted by:	Daniel Hemmerich zartik@yahoo.com
2001-05-28 21:30:31 +00:00
Ruslan Ermilov
f120c88cca Many new features and optimization improvements:
o New flags: -b and -B (backup)
o New flag: -S (safe copy; aka "atomic" install)
o The -c flag is now the default.
o The -D flag was withdrawn.

Reviewed by:	bde (up to some point)
Obtained from:	OpenBSD but heavily modified
MFC after:	1 month
2001-05-28 16:41:53 +00:00
Ruslan Ermilov
8e46d9c279 Follow symbolic links named as command line arguments if run without -R.
This is required by symlink(7), ``Commands not traversing a file tree''
subsection, third paragraph:

: It is important to realize that this rule includes commands which may
: optionally traverse file trees, e.g. the command ``chown file'' is
: included in this rule, while the command ``chown -R file'' is not.

For chown(8) and chgrp(1), this is also is compliance with the latest
POSIX 1003.1-200x draft.

MFC after:	1 week
2001-05-28 12:58:10 +00:00
Ruslan Ermilov
f82078861c The last(1) choked if there were two successive "login" marks
found in wtmp(5) for the same TTY without in-between "logout"
mark.

This may be demonstrated by executing login(1), logging in and
out, and watching the last(1) output on this TTY:

: # last -tv7 -w
: ru      ttyv7              Mon May 28 12:46 - 12:46  (00:00:01)
: ru      ttyv7              Mon May 28 12:45   still logged in

The fix merely takes the second "login" mark as the "logout" for
the first "login" mark, if there were no "logout" mark in-between.
This restores the behavior of last.c,v 1.2:

: # last -tv7 -w
: ru      ttyv7              Mon May 28 12:46 - 12:46  (00:00:01)
: ru      ttyv7              Mon May 28 12:45 - 12:46  (00:00:25)

Silence from:	-arch, dg
2001-05-28 09:57:19 +00:00
Dima Dorfman
da3082d4a9 Silence warnings (most about constness) and clamp down with WARNS=2.
Tested on i386 and alpha.
2001-05-28 06:14:48 +00:00
Mike Heffner
f332550d02 Fix overflowing on nul character.
PR:		bin/16926
MFC after:	1 week
2001-05-28 03:49:23 +00:00
Dima Dorfman
8a24285612 Implement snapshots. The new -d option allows the user to find out
who was logged in at a certain time and date.

Obtained from:	OpenBSD
2001-05-28 01:22:37 +00:00
Dima Dorfman
edd7b2674d Silence warnings and compile with WARNS=2 on i386 and alpha. 2001-05-28 00:55:50 +00:00
Dima Dorfman
15ba0427d3 Miscellaneous cleanups; sync to OpenBSD as much as feasible.
Noteworthy changes include:
 * Use getopt(3).
 * Fix overflows in -b and -w options.
 * Use strlcpy(3) and snprintf(3) in favor of strcpy(3) and
   sprintf(3), respectively.  Also check return values of the former
   two.
 * Fix lots of other gratuitous differences with OpenBSD.

Obtained from:	OpenBSD
2001-05-27 21:08:19 +00:00
Mike Heffner
9ce73e9018 Cleanup mail(1)'s varying styles by converting to using style(9).
Also take a stab at cleaning up BDECFLAGS and convert all uses of
NOSTR, NIL, NONE, NOVAR, NOGRP, NOGE to NULL. Also kill 'register' to
get diffs somewhat closer to OpenBSD/NetBSD.

There are no functional changes however.
Reviewed by:	nra (visual inspection)
2001-05-27 20:26:22 +00:00
Dag-Erling Smørgrav
5ef824ed2b Damn. Fix typo in previous commit. 2001-05-27 10:46:19 +00:00
Kris Kennaway
83b65cc9cb Fix a trivial warning and clamp down with WARNS=2
MFC after:      1 week
2001-05-26 22:47:58 +00:00
Kris Kennaway
50d6b258b2 Fix a trivial warning and clamp down with WARNS=2
MFC after:	1 week
2001-05-26 22:45:14 +00:00
Kris Kennaway
16dd925f16 Fix some trivial warnings and clamp down with WARNS=2
MFC after:	1 week
2001-05-26 22:39:33 +00:00
Kris Kennaway
5f0e809ac0 Fix WARNS=2 warnings on alpha and i386 and clamp it down 2001-05-26 21:49:29 +00:00
Dag-Erling Smørgrav
0d60c7099d When running on a tty, install an authentication callback. 2001-05-26 19:51:05 +00:00
Mark Murray
5b3771f13c Deconvolute the authentication mess, and hand total responsiblity
for authentication to PAM. This meens that WHEELSU-type logic can
now be effected in the pam.conf "su" configuration stack. While here,
clean up the mess that the code had assumed over years of hacking by
folks using different styles. ANSIfy.

There is more policy in here that can be handed over to PAM. This will
be revisited.
2001-05-26 09:52:36 +00:00
Thomas Moestl
af943f55f7 Fix the error buffer passed to kvm_openfiles to have a correct length
of _POSIX2_LINE_MAX.

MFC after:	1 week
2001-05-26 00:02:13 +00:00
Thomas Moestl
9c9f2eefc8 Fix the error buffer passed to kvm_openfiles to have a correct length
of _POSIX2_LINE_MAX.

MFC after:	3 days
2001-05-25 23:36:09 +00:00
Kris Kennaway
096c40e3f3 Mark error() as __printflike() and fix a non-exploitable format string
error.

MFC after:	1 week
2001-05-25 23:15:05 +00:00
Thomas Moestl
5a3c3d039a Fix the error buffer passed to kvm_openfiles to have a length of
_POSIX2_LINE_MAX as required.
While being there, wrap an overly long line.

MFC after:	3 days
2001-05-25 23:10:27 +00:00
Ruslan Ermilov
1166fb516b - sys/msdosfs moved to sys/fs/msdosfs
- msdos.ko renamed to msdosfs.ko
- /usr/include/msdosfs moved to /usr/include/fs/msdosfs
2001-05-25 08:14:14 +00:00