Commit Graph

9246 Commits

Author SHA1 Message Date
Xin LI
0c10c611ff Apply a NetBSD fix (revision 1.12) to handle multi-session bzip2 files
as created by pbzip2.

Submitted by:	mrg (NetBSD.org)
MFC after:	1 week
2009-11-09 02:37:02 +00:00
Attilio Rao
48f6dd8a8c Use a safety belt for cases where corrupted narg can be passed to the
ktrsyscall(). print_number() does decrement the number of arguments,
leading to infinite loops for negative values.

Reported by:	Patrick Lamaiziere <patpr at davenulle dot org>,
		Jonathan Pascal <jkpyvxmzsa at mailinator dot com>
Submitted by:	jh
PR:		bin/120055, kern/119564
MFC:		1 week
2009-11-07 21:46:34 +00:00
Xin LI
49fc79609a Static'ify signal handler which is not called from outside. 2009-11-03 09:25:08 +00:00
Christian Brueffer
cf6c5eebe7 Use our canonical .Dd format.
Submitted by:	Ulrich Spoerlein
2009-11-02 12:35:38 +00:00
Kirk McKusick
4145bb53bf When reading input from a file or device (via -f option) set the
input to be in non-buffering mode so that input lines are logged
as they occur rather than being saved up until a buffer's worth of
input has been logged.
2009-10-30 21:54:53 +00:00
Colin Percival
2bc706c648 Add notes pointing out that bsdiff does not store file hashes and
bspatch thus does not verify file hashes, and that consequently it
is recommended that users store hashes separately and verify files
before and after running bspatch.

Requested by:	BugMagnet
MFC after:	1 week
2009-10-30 11:13:00 +00:00
John Baldwin
f786e2f82e When fetching sum stats (vmstat -s) from a crash dump, fetch per-CPU counts
and sum them to form the total counts.

PR:		bin/135893
Submitted by:	Mikolaj Golub  to my trociny of gmail
MFC after:	1 week
2009-10-29 17:34:02 +00:00
Max Khon
ab5f4f723d Reset UPTODATE gnodes after remaking makefiles when make
is not going to be restarted: such nodes could be marked UPTODATE
without doing rebuild due to remakingMakefiles being TRUE.
2009-10-18 11:28:31 +00:00
Max Khon
a234abce8e Exit with non-zero error code in case of errors
when make is run with -k and not parallel (compat) make is run.
2009-10-18 11:26:09 +00:00
Jaakko Heinonen
c64b097bfc - If lstat()/stat() fails with an error other than ENOENT, don't ignore
the error and assume that the file doesn't exist. Touch could return
  success with -c option even if the file existed and time was not set.
- If the first utimes_f() call fails with -A option, give up and don't
  continue trying to set times to current time. [1]
- Set exit status to 1 when setting of timestamps fails for a directory
  or symbolic link even though lstat()/stat() would succeed.
- Don't print bogus error message when rw() succeeds.

PR:		bin/112213
Submitted by:	jilles [1]
Reviewed by:	jilles
Approved by:	trasz (mentor)
2009-10-16 20:52:45 +00:00
Robert Watson
c8359dde47 Print routing statistics as unsigned short rather than unsigned int,
otherwise sign extension leads to unlikely values when in the negative
range of the signed short structure fields that hold the statistics.
The type used to hold routing statistics is arguably also incorrect.

MFC after:	3 days
2009-10-15 10:31:24 +00:00
Jaakko Heinonen
c2dbb0de27 - Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
  systat(1) may get stuck in an infinite loop if it doesn't receive
  SIGHUP when terminal closes. [1]
- Remove attempt to clear stdio error indicators. getch() doesn't use
  stdio, making it useless. [2]
- Remove unneeded masking of getch() return value. [2]

PR:		bin/107171
Reviewed by:	bde
Approved by:	trasz (mentor)
Obtained from:	OpenBSD [1]
Suggested by:	bde [2]
MFC after:	1 month
2009-10-11 12:32:25 +00:00
Edwin Groothuis
dec5a150d1 Add the comment "(FreeBSD only)" to the altmonth_x keywords
MFC after:	1 week
2009-10-07 21:14:45 +00:00
Benedict Reuschling
ee06ebdf46 Belatedly add my calendar entry.
Discussed with:     remko
Approved by:        remko, jkois (mentor)
2009-10-05 19:29:49 +00:00
Robert Watson
963b7ccd3b netstat(1) support for UNIX SOCK_SEQPACKET sockets -- changes were required
only for the kvm case, as we supported SOCK_SEQPACKET via sysctl already.

Sponsored by:	Google
MFC after:	3 months
2009-10-05 15:06:14 +00:00
Edwin Groothuis
d5060740e3 Backout changes for c_fmt, x_fmt and X_fmt, they were coming from
the wrong patches. Apologies.
2009-10-05 07:21:21 +00:00
Edwin Groothuis
a250649bd8 Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.
Also modify the "-k list" option to display only fields with a certain prefix.

MFC after:	1 week
2009-10-05 07:11:19 +00:00
Doug Barton
85f67d6972 The 6bone was decommissioned on 6/6/06, so remove references to it. 2009-10-03 02:37:21 +00:00
Ed Maste
7149ebf446 Use %zu for size_t, not %zd.
Submitted by:	ru
MFC after:	1 week
2009-09-23 15:32:59 +00:00
Mike Silbersack
aae0914135 In netstat -x, do not try to print out tcp timer status for udp sockets. 2009-09-23 05:32:33 +00:00
Jilles Tjoelker
a05cb85237 Update find(1) man page for -L/-delete interaction.
It is a bit unfortunate that the example to delete broken symlinks now uses
rm(1), but allowing this with -delete would require fixing fts(3) to not
imply FTS_NOCHDIR if FTS_LOGICAL is given (or hacks in the -delete option).

PR:		bin/90687
MFC after:	2 weeks
2009-09-20 16:47:56 +00:00
Diomidis Spinellis
ac8f32ce62 IEEE Std 1003.1, 2004 Edition states:
"The escape sequence '\n' shall match a <newline> embedded in
the pattern space."

It is unclear whether this also applies to a \n embedded in a
character class.  Disable the existing handling of \n in a character
class following Mac OS X, GNU sed version 4.1.5 with --posix, and
SunOS 5.10 /usr/bin/sed.

Pointed by:	Marius Strobl
Obtained from:	Mac OS X
2009-09-20 15:47:31 +00:00
Diomidis Spinellis
76570d0a99 Follow POSIX (IEEE Std 1003.1, 2004 Edition) in the implementation
of the y (translate) command.

"If a backslash character is immediately followed by a backslash
character in string1 or string2, the two backslash characters shall
be counted as a single literal backslash character"

Pointed by:	Marius Strobl
Obtained from:	Mac OS X
2009-09-20 15:17:40 +00:00
Diomidis Spinellis
128e6a12b5 Allow [ to be used as a delimiter.
Pointed by:	Marius Strobl
Obtained from:	Apple
2009-09-20 14:11:33 +00:00
Mike Silbersack
b8614722ff Add the ability to see TCP timers via netstat -x. This can be a useful
feature when you have a seemingly stuck socket and want to figure
out why it has not been closed yet.

No plans to MFC this, as it changes the netstat sysctl ABI.

Reviewed by:	andre, rwatson, Eric Van Gyzen
2009-09-16 05:33:15 +00:00
Roman Divacky
d77fa17750 Add C/c/f/p/v switches plus a bunch of minor fixes and cleanups.
Obtained from:	NetBSD
Approved by:	des (maintainer)
Approved by:	ed (mentor, implicit)
2009-09-08 15:55:13 +00:00
Xin LI
277dbce981 Constify format string pointer, otherwise this would trigger warning when
higher warning level is enabled.
2009-09-08 01:11:23 +00:00
Pawel Jakub Dawidek
b61d9eabb4 Make sure to use up-to-date libarchive header files from source tree when
compiling tar and not the ones from /usr/include/.

Reviewed by:	kientzle
Approved by:	kientzle
2009-09-07 06:37:44 +00:00
Edward Tomasz Napierala
fa2db9145a Add NFSv4 ACL support to find(1).
Reviewed by:	rwatson
2009-09-04 20:01:16 +00:00
Andrey A. Chernov
234f1d7f1a Remove single occurance of HAS_CTYPE ifdef, ctype functions
used here for a long time and needs their header in anycase.
2009-09-04 07:44:27 +00:00
George V. Neville-Neil
54fc657d59 Add ARP statistics to the kernel and netstat.
New counters now exist for:
requests sent
replies sent
requests received
replies received
packets received
total packets dropped due to no ARP entry
entrys timed out
Duplicate IPs seen

The new statistics are seen in the netstat command
when it is given the -s command line switch.

MFC after:	2 weeks
In collaboration with: bz
2009-09-03 21:10:57 +00:00
Hajimu UMEMOTO
34903a55c3 Fix the problem that the entry broke into two lines with multi-byte
AM/PM format.

Reported by:	takawata
2009-08-30 11:17:42 +00:00
Colin Percival
f9f231846a Don't try to mmap the contents of empty files. This behaviour was harmless
prior to r195693, since historical behaviour of mmap(2) was to silently
ignore length-zero mmap requests; but mmap now returns EINVAL, which caused
look(1) to emit an error message and fail.

Among other things, this makes `freebsd-update fetch` on a newly installed
8.0-BETA3 system print bogus warning messages.

MFC after:	3 days
2009-08-26 03:30:06 +00:00
Andriy Gapon
497e910cd3 fstat: fix fsid comparison when executed on systems with 64-bit long
This affects only fstat on zfs and devfs, only on 64-bit systems
and only when fsid is greater than 2^31 - 1.
When fstat examines a file via stat(2) it takes uint32_t st_dev
and assigns to (signed) (64-bit) long fsid, this results in
a positive value.
When fstat examines opened files it takes int32_t f_fsid.val[0]
and assigns to (signed) (64-bit) long fsid, this results in
a negative value.
So, while initially st_dev and f_fsid.val[0] have the same bit
values they get promoted to different 64-bit values because
of the signed-vs-unsigned difference.

A fix is to use "more natural" positive numbers by introducing
intermediate unsigned cast for f_fsid.val[0].

Reviewed by:	jhb, lulf
Approved by:	re (kib)
MFC after:	1 week (to stable/7)
2009-08-20 10:57:14 +00:00
Dima Panov
5ad0a62fe0 Add my birthday
Approved by:	re (rwatson) miwi (mentor)
2009-08-15 15:40:30 +00:00
Robert Watson
d19d55a76f Update procstat(1) for the fact that devfs paths are no longer unsupported.
Approved by:	re (kib)
2009-08-12 10:41:37 +00:00
Xin LI
deb6327793 Correct a stack underflow in gzip:
- Limit suffix to be no more than 30 bytes long.  This matches GNU
   behavior.
 - Correct usage of memcpy().

Note that this commit only corrects the stack underflow issue, we
still need some other fixes to cover other edges. [1]

Reported by:	Ron Jude <ronj wytheville org>
Discussed with:	Matthew Green (original NetBSD gzip author),
		Eygene Ryabinkin <rea-fbsd codelabs ru> [1]
Approved by:	re (kib)
2009-07-31 08:37:27 +00:00
Xin LI
f0be0a1f8c Update less to v436. This is considered as a bugfix release from vendor.
Major changes from v429:
 * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-".
 * Allow a fraction as the argument to the -# (--shift) option.
 * Fix highlight bug when underlined/overstruck text matches at end of line.
 * Fix non-regex searches with ctrl-R.

Approved by:	re (kensmith, kib)
2009-07-29 09:20:32 +00:00
Brooks Davis
254d03c508 Introduce a new sysctl process mib, kern.proc.groups which adds the
ability to retrieve the group list of each process.

Modify procstat's -s option to query this mib when the kinfo_proc
reports that the field has been truncated.  If the mib does not exist,
fall back to the truncated list.

Reviewed by:	rwatson
Approved by:	re (kib)
MFC after:	2 weeks
2009-07-24 19:12:19 +00:00
John Baldwin
013818111a Add a new type of VM object: OBJT_SG. An OBJT_SG object is very similar to
a device pager (OBJT_DEVICE) object in that it uses fictitious pages to
provide aliases to other memory addresses.  The primary difference is that
it uses an sglist(9) to determine the physical addresses for a given offset
into the object instead of invoking the d_mmap() method in a device driver.

Reviewed by:	alc
Approved by:	re (kensmith)
MFC after:	2 weeks
2009-07-24 13:50:29 +00:00
John Baldwin
29985e350d Move the check to ensure the locate database has the minimum required size
when using mmap() before invoking mmap().  This avoids a confusing error
message when locate is invoked against a zero-size database after the
recent change to make mmap() fail requests to map 0 bytes.

Submitted by:	Jaakko Heinonen  jh of saunalahti dot fi
Approved by:	re (kensmith)
MFC after:	1 week
2009-07-24 13:40:25 +00:00
Yi-Jheng Lin
bd8311d481 - Add my birthday
- Add myself to ports committers and to lwhsu's mentee list

Approved by:	re (kib), lwhsu (mentor)
2009-07-21 09:54:04 +00:00
Bjoern A. Zeeb
da1b35844b Remove no longer needed #include after removing the legacy
vimage API in r195741.

Reviewed by:	rwatson
Approved by:	re (kib)
2009-07-18 10:36:18 +00:00
Ed Schouten
523a386d23 Make mklocale work again, now that fwrite()'s return codes are different.
Submitted by:	Navdeep Parhar <nparhar gmail com>
Approved by:	re (kib)
2009-07-14 09:19:33 +00:00
Edward Tomasz Napierala
e50022797f Add manual page links to advertise procstat(1) a little better.
Approved by:	re (kib)
2009-07-09 16:40:00 +00:00
Brian Somers
58a654f664 Fix some uninitialise variables.
PR:		136383
Submitted by:	Ulrich Spoerlein - uqs at spoerlein dot net
Approved by:	re (kib)
MFC after:	3 weeks
2009-07-08 10:16:16 +00:00
Tim Kientzle
3e0fc6d3f3 This addresses some issues with my earlier -R fix that
were pointed out by Brooks Davis and Alexey Dokuchaev:
* It now tries to lookup arguments as names first, then tries
   to parse them as numbers.  In particular, this makes the
   behavior consistent with POSIX conventions when usernames
   consist entirely of digits.
* It now uses strtoul() for the numeric parsing.

Finally, I've included an update to the test harness
to exercise the new numeric cases for -R.

Approved by:	re (kib)
2009-07-06 02:02:45 +00:00
Tim Kientzle
99b13cfb97 This fixes bsdcpio's -R option to accept numeric
user or group Ids as well as user or group names.
In particular, this fixes freesbie2, which uses
-R 0:0 to copy a bunch of files so that the result
will be owned by root.

Also fixes a related bug that mixed-up the uid
and gid specified by -R when in passthrough mode.

Thanks to Dominique Goncalves for reporting this
regression.

Approved by:	re (kib)
2009-07-03 17:54:33 +00:00
Brian Somers
53c405786b Support shadow.byname and shadow.byuid maps, protecting them by
insisting on privileged port access.

Include /var/yp/Makefile.local if it exists and suggest using
it to override /var/yp/Makefile behaviour.

Approved by:	re (kib)
MFC after:	3 weeks
2009-06-25 16:15:39 +00:00
Xin LI
b47ed83de8 Sync with NetBSD:
- gzip -n does not store timestamp; [1]
 - Reduce diff against NetBSD by moving some casts in our local
   versions.

PR:		bin/134955
Obtained from:	NetBSD
MFC after:	1 month
2009-06-24 21:51:02 +00:00