Commit Graph

9259 Commits

Author SHA1 Message Date
Xin LI
92fc47574f MFC r205702:
Remove GNU cpio after fix of CVE-2010-0624.

Note that this is actually a no-op for most users, as this GNU
cpio was broken on -HEAD and 8-STABLE since last March until
the recent fix.

FreeBSD 8.0+ uses BSD cpio by default and the code is being
actively maintained.
2010-03-29 18:24:08 +00:00
Jaakko Heinonen
f004e8133a MFC r198175:
- 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
2010-03-28 11:22:38 +00:00
Ed Schouten
4ae65fe952 MFC r205008 and 205009:
Make script(1) a little less broken.

  Close the file descriptor to the TTY. There is no reason why the parent
  process should keep track of the descriptor. This ensures that the
  application inside properly drains the TTY during exit(2).

  Reported by:  alfred
2010-03-25 08:33:56 +00:00
Konstantin Belousov
1b90b87fba MFC r204879:
Teach procstat(1) to display some information about signal disposition
and pending/blocked status for signals.

MFC r204880:
Add file forgotten in r204879.
2010-03-22 09:29:56 +00:00
Gavin Atkinson
27dfb536f2 Merge r203865 from head:
The -newerXB option was being interpreted the same as the -newerXm option
  as a check for F_TIME2_B was missing.  Fix this.

PR:		bin/138245
Submitted by:	"David E. Cross"  <crossd cs.rpi.edu>
2010-03-17 20:16:28 +00:00
Jaakko Heinonen
77d503efb1 MFC r204872: Pass the correct size to memset().
PR:		bin/128094
2010-03-15 16:39:52 +00:00
Joerg Wunsch
cf4bd5e4d9 (r205011) The "number" argument is everything but optional. 2010-03-12 05:16:24 +00:00
Gavin Atkinson
50819829d3 Merge r204053 from head:
The correct value of DEL is 0x7f, not 0xff.  This is purely a documentation
  issue - od(1) and hexdump(1) behave as expected.

PR:		docs/143869
Submitted by:	gcooper
2010-03-10 13:40:37 +00:00
Jaakko Heinonen
27a5b388f3 MFC r203551:
- Cast intptr_t, pid_t and time_t values to intmax_t and use %jd with
  printf.
- Cast the system call return value to long and use %ld in a printf in
  ktrsysret().

PR:		bin/123774
2010-02-21 13:17:35 +00:00
Rebecca Cran
b9d3fd67b9 MFC r203688:
Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows
the -M option to be used without specifying -N.

PR:	bin/138146
Approved by:	rrs (mentor)
2010-02-18 10:46:25 +00:00
Xin LI
0985bbeaab MFC r202060:
Add a new option, -q howmany, which when used in conjuction with -w,
exits netstat after _howmany_ outputs.

Requested by:	thomasa
Reviewed by:	freebsd-net (bms, old version in early 2007)
2010-02-10 00:34:13 +00:00
Jaakko Heinonen
5e4fd6c798 MFC r200781:
Cast time_t values to intmax_t and use %jd with printf.
2010-02-08 15:55:01 +00:00
Jaakko Heinonen
46e7e3ebbc MFC r200780:
Remove non-working special case for pipe(2) from amd64-fbsd32.c and
i386-fbsd.c. Add pipe(2) to syscall table to decode it's pointer
argument properly and re-add special handling for pipe(2) return value
to print_syscall_ret().

PR:		bin/120870
2010-02-08 15:53:28 +00:00
Jaakko Heinonen
3ede63a7e3 MFC r200752:
Avoid sharing the file descriptor of the output file with traced
processes by setting the FD_CLOEXEC flag for the output file.

PR:		bin/140493
2010-02-08 15:50:51 +00:00
Jaakko Heinonen
33e6da3c3a MFC r200751:
Add fork(2), getegid(2), geteuid(2), getgid(2), getpid(2), getpgid(2),
getpgrp(2), getppid(2), getsid(2) and getuid(2) to syscall table to
decode their arguments correctly.
2010-02-08 15:48:18 +00:00
Jaakko Heinonen
37a33496e2 MFC r200632:
The input line length limit mentioned on the manual page was removed by
r176119.
2010-02-06 11:42:23 +00:00
Jaakko Heinonen
f8d5cb4579 MFC r200441:
The input line length limit mentioned on the manual page was removed by
r179374.
2010-02-06 11:39:33 +00:00
Edward Tomasz Napierala
4e86d39db2 MFC r196839:
Add NFSv4 ACL support to find(1).
2010-01-30 14:54:12 +00:00
George V. Neville-Neil
fbbbfe0ba5 MFC r196797:
Add ARP statistics to the kernel and netstat.
2010-01-28 16:48:44 +00:00
Alberto Villa
df4743bc4a - MFC r197788, r203040, r203045, r203048
Approved by:	tabthorpe (mentor)
2010-01-27 18:12:22 +00:00
Gavin Atkinson
18fab66957 Merge r200318 from head: add myself to calendar.freebsd. 2010-01-27 15:36:19 +00:00
Konstantin Belousov
b3c4be736e Merge scandir(3) interface update to stable/8.
MFC r201512:
Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008.

MFC r201602:
Move scandir(3) and alphasort(3) into XSI namespace.

MFC r201604:
Use thunks to adapt alphasort-like interface to the comparision function
required by qsort() and qsort_r().

MFC r202556 (by ache):
Use strcoll() in opendir() and alphasort(). Remove some comments.

MFC r202572 (by ache):
Revert to using strcmp() for opendir().

MFC r202677 (by ache):
Style.

MFC r202679 (by ache):
Style: rename internal function to opendir_compar().

MFC r202691 (by ache):
For alphasort(3) add reference to strcoll(3).

MFC r202693 (by ache):
Style: reword comment.
2010-01-24 12:35:36 +00:00
Brooks Davis
52c240aaf4 MFC r201350:
The devices that supported EVFILT_NETDEV kqueue filters were removed in
  r195175.  Remove all definitions, documentation, and usage.

The change of function signature for vlan_link_state() was not merged to
maintain the ABI.
2010-01-22 19:51:34 +00:00
Edwin Groothuis
73510ebf05 MFC of 202280, 202281
- Remove -d option, whois.nic.mil doesn't exist anymore.

- Make whois capable of searching for IPv6 addresses just like it can
  do for IPv4 addresses without having to explicetly specify that the
  ARIN server should be used to get the initial information.

PR:		bin/142507, bin/128725
Submitted by:	Dan Mahoney <danm@prime.gushi.org>, "Matt D. Harris" <mdh_lists@yahoo.com>
2010-01-21 10:16:21 +00:00
Gavin Atkinson
322a943070 Merge r201429:
Fix return code in the case of successful file transfer, broken in
  tftp.c 1.13

PR:		bin/117452
Submitted by:	Spencer Minear  minear securecomputing.com
Approved by:	ed (mentor, implicit)
2010-01-17 10:58:59 +00:00
Ruslan Ermilov
f96c46c6ab Update to a 26-Nov-2009 release. 2010-01-15 14:20:01 +00:00
Ruslan Ermilov
c7fabb7176 MFC r201290: Treat an empty argument as an error, instead of
fetching the contents of the root directory.
2010-01-06 08:26:43 +00:00
Xin LI
90ad4a8e4c MFC r200793:
Plug a memory leak.

PR:		bin/141836
Submitted by:	Henning Petersen <henning.petersen at t-online.de>
2010-01-04 01:07:32 +00:00
Edwin Groothuis
85f5f3b435 MFC of r200650, r200624
Add Australian, New Zealand and Ukraian calendars to the "all" target".
Nationalise Easter -> Pasen in calendar.dutch
2009-12-24 01:28:26 +00:00
Attilio Rao
ebc5dece54 MFC r199805:
Change gcore in order to get rid of the procfs support and use FreeBSD's
specific interfaces. Main changes:
- now gcore recognizes threads within the the process and handle dumps on
  a thread scope
- the process to be analyzed should be stopped while gcore runs
- gcore may not work with processes that are being debugged with gdb or
  truss
- ptrace may let interruptible calls to return EINTR, thus dirtying
  signals handling within the process

Sponsored by:	Sandvine Incorporated
2009-12-19 19:30:27 +00:00
Attilio Rao
2df3481531 MFC r199803:
Add the possibility to show informations about dropped packets on the
input path when showing interfaces informations.

Sponsored by:	Sandvine Incorporated
2009-12-19 19:25:35 +00:00
Edwin Groothuis
0b1ab65e97 MFC of r199642
The output of perror(1) is now showing local messages for locales
supported by libc/nls

PR:             bin/140499
Approved by:    gnn@
2009-12-06 21:07:47 +00:00
Bjoern A. Zeeb
87d7d0abb5 MFC r199946:
Add more statistics variables for IPcomp.

  Try to version the struct in a backward compatible way.
  People asked for the versioning of the stats structs in general before.

Note: old netstat binaries, as only consumer, continue to work as they are
      still using kvm but will not display the new stats. [1]

Discussed with:	rwatson [1]
2009-12-05 19:21:58 +00:00
Xin LI
23ca7b86bd MFC r199066 + 199339:
Apply a NetBSD fix (revision 1.12) to handle multi-session bzip2 files
as created by pbzip2.
2009-12-02 21:58:00 +00:00
Tony Finch
cb0593b42c MFC 199813, 199817, 199842, 199867:
Update unifdef to latest upstream version.
2009-12-02 15:30:53 +00:00
Hajimu UMEMOTO
c2a8874e1a MFC r199242: Use ncursesw to output the date field of vmstat
display with multi-byte string, correctly.
2009-11-22 17:16:37 +00:00
Attilio Rao
fa5f8aabc7 MFC r199024:
Use a safety belt for cases where corrupted narg can be passed to the
ktrsyscall().
2009-11-22 16:13:16 +00:00
Jaakko Heinonen
f969a7ac4b MFC r197956:
- 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.
- Remove attempt to clear stdio error indicators. getch() doesn't use
  stdio, making it useless.
- Remove unneeded masking of getch() return value.

PR:		bin/107171
Approved by:	trasz (mentor)
2009-11-15 14:11:26 +00:00
John Baldwin
8da42c8a89 MFC 198620:
When fetching sum stats (vmstat -s) from a crash dump, fetch per-CPU counts
and sum them to form the total counts.
2009-11-06 20:33:40 +00:00
Ed Maste
9d37c171d7 MFC r197437:
Use %zu for size_t, not %zd.
2009-11-05 02:27:56 +00:00
Edwin Groothuis
05edd60be4 MFCs of r197764, r197765, r197766, r197847:
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.

Add the comment "(FreeBSD only)" to the altmonth_x keywords
2009-10-31 06:35:40 +00:00
Jilles Tjoelker
5ad306115b MFC r197363: 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
2009-10-29 21:25:16 +00:00
Robert Watson
4b94fa7835 Merge r198118 from head to stable/8:
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.

Approved by:	re (bz)
2009-10-18 15:58:57 +00:00
Doug Barton
a3cd0ffc70 MFC r197725:
The 6bone was decommissioned on 6/6/06, so remove references to it.

Approved by:	re (kib)
2009-10-06 22:15:12 +00:00
Hajimu UMEMOTO
285c40cb98 MFC r196652: Fix the problem that the entry broke into two lines
with multi-byte AM/PM date format.

Approved by:	re (kib)
2009-09-13 17:01:34 +00:00
Colin Percival
ee1db5ae45 MFC r196558: Don't try to mmap the contents of empty files. This behaviour
was harmless prior to r195693, when mmap(2) changed from silently ignoring
requests for mapping zero bytes to returning EINVAL; this commit can be seen
as adjusting for the change in mmap(2) in order to make look(1) act like it
did previously.

Reviewed by:	jhb
Approved by:	re (kib)
2009-08-31 13:02:21 +00:00
Andriy Gapon
2c68e2fb1e MFC 196399: 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 11:04:31 +00:00
Dima Panov
1ffdef9f28 MFC calendar.freebsd
Approved by:	re (rwatson) miwi (mentor)
2009-08-15 16:04:36 +00:00
Robert Watson
7a34e29bc6 Merge r196120 from head to stable/8:
Update procstat(1) for the fact that devfs paths are no longer unsupported.

Approved by:	re (kib)
2009-08-13 14:38:09 +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