Commit Graph

8663 Commits

Author SHA1 Message Date
Edwin Groothuis
21008fdbf9 Add misc entries communilated over the year
PR:             conf/113285, conf/113642, conf/70252 and conf/61641
Submitted by:   Edwin Groothuis <edwin@mavetju.org>, <acc107_3@acc.tula.ru>, Evan Dower <evantd@cs.washington.edu>
MFC after:      1 week
Approved by:    re (bmah@), mentor (grog@)
2007-09-07 03:23:06 +00:00
Ruslan Ermilov
06351b59c6 Inactive pages don't have to be dirty plus improve description of
the cache queue.

Submitted by:	alc
Approved by:	re (kensmith)
2007-09-02 10:29:16 +00:00
Ruslan Ermilov
d71e591b49 Fix the description of the "Cache" memory and clarify the
description of the "Inact" memory.  (They count pages in
the cache/inactive page queues, respectively.)

Approved by:	re (kensmith)
2007-09-01 05:52:39 +00:00
Randall Stewart
d37c519324 - Fix typo in netstat's display of Nagle algorithm - refer to the RFC.
Submitted by:	bruce@cran.org.uk
Approved by:	re@freebsd.org (Bruce Mah)
2007-08-24 00:35:18 +00:00
Xin LI
f7504c33c4 Use POSIX mutex instead of Solaris ones. This makes generation
of threaded RPC servers to work out of the box.

Spotted by:	Changming Sun <changming at staff.sina.com.cn>
Sponsored by:	SINA Corporation
Approved by:	re (kensmith)
2007-08-23 09:39:40 +00:00
Xin LI
f87730d4b0 sysent.h is installed as sys/sysent.h, so reflect it.
Approved by:	re (kensmith)
Spotted by:	Changming Sun <changming at staff.sina.com.cn>
Sponsored by:	SINA Corporation
2007-08-23 09:38:26 +00:00
Tim Kientzle
9b93c30d30 Fix for PR bin/115033. This corrects a crash when long options
are specified with the "-W option=arg" syntax and the '=' is omitted.

MFC after: 3 days
Approved by: re (rwatson)
2007-08-01 03:15:35 +00:00
Dag-Erling Smørgrav
218cbbea9a Make tcpstates[] static, and make sure TCPSTATES is defined before
<netinet/tcp_fsm.h> is included into any compilation unit that needs
tcpstates[].  Also remove incorrect extern declarations and TCPDEBUG
conditionals.  This allows kernels both with and without TCPDEBUG to
build, and unbreaks the tinderbox.

Approved by:	re (rwatson)
2007-07-30 11:06:42 +00:00
Marcel Moolenaar
f235995090 Print integer-typed arguments as integers. This makes sure that
on 64-bit platforms the result is more reliable. For example,
-1 was previously printed as 0xffffffff.

Approved by: re (kensmith)
2007-07-28 23:18:39 +00:00
Marcel Moolenaar
2c02627ff8 Fix handling of Quad-type arguments. Previously, syscalls
containing 64-bit arguments would have explicit padding.
On 64-bit platforms there was no padding, so the dummy
argument was not covering anything. On 32-bit platforms
with weak alignment (i.e. i386) the 64-bit argument did
not need to be aligned, so there too an aditional argument
was introduced. On 32-bit platforms with strong alignment
(i.e. PowerPC) the dummy argument in fact cover the padding.
By elimininating the dummy argument, 64-bit platforms now
have 1 argument less. This also applies to 32-bit platforms
with weak alignment. On PowerPC this doesn't matter, because
the padding is still there. We just don't "name" it.
Deal with those 3 cases.

Approved by: re (kensmith)
2007-07-28 23:15:04 +00:00
Marcel Moolenaar
3e1b607837 Syscalls have at most 6 argument, not 5. See mmap(2) for example.
Previously the offset argument to mmap(2) would be bogus as we
weren't reading it in.

Approved by: re (kensmith)
2007-07-28 23:00:42 +00:00
Alan Cox
eaa29f1ce4 Add a counter for the total number of pages cached and support for
reporting the value of this counter in the program "vmstat".

Approved by:	re (rwatson)
2007-07-27 20:01:22 +00:00
Alexander Nedotsukov
7bd2b6a8ab Update for japanese holidays.
PR:		114732
Approved by:	re (rwatson)
2007-07-27 12:09:55 +00:00
Xin LI
9a0e6be26a Stop mentioning /usr/X11R6.
Approved by:	re (hrs)
2007-07-24 06:41:07 +00:00
Tim Kientzle
660665be6b Fill in some casts that are needed (according to GCC 4.1)
Thanks to: Joerg Sonnenberger
Approved by: re (hrs)
MFC after: 3 days
2007-07-20 01:27:50 +00:00
Tim Kientzle
7061a01ba7 Don't exit immediately on libarchive warnings, just
set the delayed return value and keep going.

Approved by: re (hrs)
MFC after: 7 days
2007-07-20 01:24:49 +00:00
John Baldwin
87bebf24f7 Update the default FILESYSTEMS value in a comment to note that ext2fs is
included in the default list in the locate.updatedb script.

Approved by:	re (bmah)
Inspired by:	mwlucas
2007-07-19 21:00:08 +00:00
John Baldwin
55fd53e237 Bah, fix a cosmetic nit and remove a debugging aid missed in the previous
fixes for netstat -M.

Pointy hat to:	jhb
Approved by:	re (kensmith)
2007-07-16 18:13:12 +00:00
John Baldwin
feda1a4372 Restore netstat -M functionality for most statistics on core dumps. In
general, when support was added to netstat for fetching data using sysctl,
no provision was left for fetching equivalent data from a core dump, and
in fact, netstat would _always_ fetch data from the live kernel using
sysctl even when -M was specified resulting in the user believing they
were getting data from coredumps when they actually weren't.  Some specific
changes:
- Add a global 'live' variable that is true if netstat is running against
  the live kernel and false if -M has been specified.
- Stop abusing the sysctl flag in the protocol tables to hold the protocol
  number.  Instead, the protocol is now its own field in the tables, and
  it is passed as a separate parameter to the PCB and stat routines rather
  than overloading the KVM offset parameter.
- Don't run PCB or stats functions who don't have a namelist offset if we
  are being run against a crash dump (!live).
- For the inet and unix PCB routines, we generate the same buffer from KVM
  that the sysctl usually generates complete with the header and trailer.
- Don't run bpf stats for !live (before it would just silently always run
  live).
- kread() no longer trashes memory when opening the buffer if there is an
  error on open and the passed in buffer is smaller than _POSIX2_LINE_MAX.
- The multicast routing code doesn't fallback to kvm on live kernels if
  the sysctl fails.  Keeping this made the code rather hairy, and netstat
  is already tied to the kernel ABI anyway (even when using sysctl's since
  things like xinpcb contain an inpcb) so any kernels this is run against
  that have the multicast routing stuff should have the sysctls.
- Don't try to dig around in the kernel linker in the netgraph PCB routine
  for core dumps.

Other notes:
- sctp's PCB routine only works on live kernels, it looked rather
  complicated to generate all the same stuff via KVM.  Someone can always
  add it later if desired though.
- Fix the ipsec removal bug where N_xxx for IPSEC stats weren't renumbered.
- Use sysctlbyname() everywhere rather than hardcoded mib values.

MFC after:	1 week
Approved by:	re (rwatson)
2007-07-16 17:15:55 +00:00
Robert Watson
2b851aeb63 Disconnect netatm from the build as it is not MPSAFE and relies on
NET_NEEDS_GIANT, which will shortly be removed.  This is done in a
away that it may be easily reattached to the build before 7.1 if
appropriate locking is added.  Specifics:

- Don't install netatm include files
- Disconnect netatm command line management tools
- Don't build libatm
- Don't include ATM parts in rescue or sysinstall
- Don't install sample configuration files and documents
- Don't build kernel support as a module or in NOTES
- Don't build netgraph wrapper nodes for netatm

This removes the last remaining consumer of NET_NEEDS_GIANT.

Reviewed by:	harti
Discussed with:	bz, bms
Approved by:	re (kensmith)
2007-07-14 21:49:24 +00:00
Xin LI
78b8781ab1 - Simulate GNU gzip(1) behavior where full filename is
being output in verbose mode when doing recursive[1].
 - Use better representation of S:

PR:		bin/114470
Submitted by:	Ighighi <ighighi gmail com> [1]
Approved by:	re (hrs)
2007-07-12 01:17:14 +00:00
John Baldwin
1db0049fa1 Fix alignment of context switch traces.
MFC after:	1 week
Approved by:	re (rwatson: "I like simple patches.")
2007-07-10 00:01:30 +00:00
Xin LI
870945d830 Before doing compile_re() which needs a parameter to identify
whether we should ignore case, determine the flag by calling
compile_flags() first.  Also, make sure that we obtain an
initialized cmd->u.s buffer before processing further.  We
may want to refine this solution later, but for now, make
the changes in order to unbreak world build after a sed(1)
with rev. 1.29 of compile.c is installed.

Approved by:	re (hrs)
2007-07-06 16:34:56 +00:00
Bjoern A. Zeeb
53bf725ae1 Remove the -DFAST_IPSEC from Makefiles again.
This was needed during the IPSEC->FAST_IPSEC->IPSEC transition
period to not break the build after picking up netipsec header
files. Now that the FAST_IPSEC kernel option is gone and the
default is IPSEC again those defines are superfluous.

Approved by:	re (rwatson)
2007-07-05 08:56:46 +00:00
Peter Wemm
cae1120adf kdump has knowledge of lseek() and mmap() arg decoding. Teach it about
the new mmap and lseek syscalls.

Approved by:  re (kensmith)
2007-07-04 23:32:49 +00:00
Suleiman Souhlal
bdd72b703b Add case-insensitive matching to sed, using the 'I' flag, similarly to GNU sed.
For example,
	sed /foo/Id
	sed s/foo/bar/Ig

Reviewed by:	dds
Approved by:	re (hrs)
2007-07-04 16:42:41 +00:00
Sean Farley
2966d28c32 Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
 - unsetenv returns an int.
 - putenv takes a char * instead of const char *.
 - putenv no longer makes a copy of the input string.
 - errno is set appropriately for POSIX.  Exceptions involve bad environ
   variable and internal initialization code.  These both set errno to
   EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit.  A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions.  It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR:		kern/99826
Approved by:	wes
Approved by:	re (kensmith)
2007-07-04 00:00:41 +00:00
George V. Neville-Neil
8409aedfa6 Commit IPv6 support for FAST_IPSEC to the tree.
This commit includes all remaining changes for the time being including
user space updates.

Submitted by:    bz
Approved by:    re
2007-07-01 12:08:08 +00:00
Warner Losh
986bd8412b Add support using an alternate table file to usbhidaction(1).
Submitted by: Michael Haro
PR: 61234
Approved by: re (bmah)
2007-06-30 03:58:01 +00:00
Xin LI
ef29ac7f76 MFp4: Bugfixes for truss(1):
- Fix logic handling execve().  We will not be able to
   obtain information otherwise.
 - truss coredump [1].
 - truss does not work against itself [2].

PR:		bin/58970 [1], bin/45193 [2]
Submitted by:	Howard Su
Approved by:	re (kensmith)
2007-06-26 22:42:37 +00:00
Sean Farley
e2ebaca52a Add myself as a src committer.
Approved by:  wes (mentor)
Approved by:  re (bmah)
2007-06-25 14:28:12 +00:00
Randall Stewart
b8a1761e07 o style(9) nit.
o shorten explainations which are over 80 columns in console.
	o group rows
	o clean up and change explanations a little bit.
Obtained from:	weongyo.jeong@gmail.com
2007-06-17 14:45:28 +00:00
Randall Stewart
3f8d71d596 - Forced commit to update who actually did this code (I forgot
the obtained from in the original line)
Obtained from:	Weongyo Jeong (weongyo.jeong@gmail.com)
2007-06-17 01:57:08 +00:00
Maxim Konovalov
48c513e07f o Do not warn if the process exits before we get its name.
PR:		bin/113777
Submitted by:	Dmitrij Tejblum
MFC after:	1 week
2007-06-16 20:24:55 +00:00
Stefan Eßer
03fec0bdbc Never define the generated rpc server main function with storage type
"static". The header file generated by "rpcgen -h" will always declare
it as extern, leading to a "static after extern" error being issued by
gcc-4.2. This caused only a warning in gcc-3.x, but it has been wrong
all the time.

This change does not modify the code generated by "rpcgen -m", it only
affects rpcgen used to generate server stubs with a local main function.

This is the minimal patch. It does not remove the now obsolete "storage"
parameter from write_program() and write_programs() in an attempt to keep
differences to other systems' versions of rpcgen as small as possible.
2007-06-16 14:39:25 +00:00
John Baldwin
5900369697 Expand TCP counters from 9 digits to 12.
MFC after:	1 week
PR:		bin/112881
2007-06-15 18:12:58 +00:00
John Baldwin
595bf788f6 Consistently indent the R() macro for fields on the right-side of the
display to make the code easier to read.

PR:		bin/112881
2007-06-15 18:00:10 +00:00
John Baldwin
02a50a14b3 Add a new counter for retransmitted packets due to SACK.
PR:		bin/112881
Submitted by:	Phil Rosenthal <pr  isprime com>
2007-06-15 17:55:44 +00:00
Bruce Evans
e19249f7a7 Third stage of unbreaking printing of pseudo-nice values (realtime
priorities, etc.) in the NICE field:

Use a combination of pri_native and pri_user instead of pri_level to
guess the original realtime priority.  Using pri_level here has been
wrong since 2001/02/12.  Using only pri_native here would be correct
if the kernel actually initialized it reasonably.  (The kernel exports
its raw td_base_priority as pri_native, but userland mostly wants a
refined base priority).  Give up on waiting pri_native to work correctly
and only use it when there is nothing better (for kthreads).

This should reduce printing of bizarre pseudo-nice values.  Bizarre
values are still printed if we observe a transient borrowed priority
for a kthread (transient borrowing is the main thing that makes the
raw td_base_priority almost useless in userland), or if there is a
kernel bug.  One current kernel bug involves the kernel idprio thread
pagezero permanently changing its priority from PRI_MAX_IDLE (255) to
PUSER (160).  Then the bizarre value "ki-6" is printed instead of
"ki31".  Here "-6" is PRI_MIN_IDLE - PUSER = -64 truncated to 2
characters.  We are observing a transient borrowed priority that has
become permanent due to a bug.

ps/print.c:priorityr() needs similar changes (including ones in stage 2
here).
2007-06-15 12:03:07 +00:00
Timur I. Bakeyev
a79e185ffa Add myself as a commiter.
Approved by:	shaun (mentor)
2007-06-13 16:37:36 +00:00
Xin LI
04b764d8f4 sctp_process_inpcb() wants an offset parameter in size_t,
so define it as what it is expected.  This fixes WARNS=3
without NO_WERROR build.
2007-06-13 02:37:00 +00:00
Stephane E. Potvin
04031e9ae2 Options spring cleanup:
- Add and document the KVM and KVM_SUPPORT options that
are needed for the ifmcstats(3) makefile
- Garbage collect unused variables
- Add missing inclusion of bsd.own.mk where needed

Approved by: kan (mentor)
Reviewed by: ru
2007-06-13 02:08:04 +00:00
Bruce M Simpson
71498f308b Import rewrite of IPv4 socket multicast layer to support source-specific
and protocol-independent host mode multicast. The code is written to
accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work.

This change only pertains to FreeBSD's use as a multicast end-station and
does not concern multicast routing; for an IGMPv3/MLDv2 router
implementation, consider the XORP project.

The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6,
which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html

Summary
 * IPv4 multicast socket processing is now moved out of ip_output.c
   into a new module, in_mcast.c.
 * The in_mcast.c module implements the IPv4 legacy any-source API in
   terms of the protocol-independent source-specific API.
 * Source filters are lazy allocated as the common case does not use them.
   They are part of per inpcb state and are covered by the inpcb lock.
 * struct ip_mreqn is now supported to allow applications to specify
   multicast joins by interface index in the legacy IPv4 any-source API.
 * In UDP, an incoming multicast datagram only requires that the source
   port matches the 4-tuple if the socket was already bound by source port.
   An unbound socket SHOULD be able to receive multicasts sent from an
   ephemeral source port.
 * The UDP socket multicast filter mode defaults to exclusive, that is,
   sources present in the per-socket list will be blocked from delivery.
 * The RFC 3678 userland functions have been added to libc: setsourcefilter,
   getsourcefilter, setipv4sourcefilter, getipv4sourcefilter.
 * Definitions for IGMPv3 are merged but not yet used.
 * struct sockaddr_storage is now referenced from <netinet/in.h>. It
   is therefore defined there if not already declared in the same way
   as for the C99 types.
 * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF
   which are then interpreted as interface indexes) is now deprecated.
 * A patch for the Rhyolite.com routed in the FreeBSD base system
   is available in the -net archives. This only affects individuals
   running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces.
 * Make IPv6 detach path similar to IPv4's in code flow; functionally same.
 * Bump __FreeBSD_version to 700048; see UPDATING.

This work was financially supported by another FreeBSD committer.

Obtained from:  p4://bms_netdev
Submitted by:   Wilbert de Graaf (original work)
Reviewed by:    rwatson (locking), silence from fenner,
		net@ (but with encouragement)
2007-06-12 16:24:56 +00:00
Yaroslav Tykhiy
85ae5d2f94 Drop the argument to the OUT macro because it can't emit
anything but the pattern space anyway.  Apply style(9)
to the macro.

Tested with:	md5(1)
2007-06-12 12:17:25 +00:00
Yaroslav Tykhiy
26a5710c40 Don't forget to clear out the hold space for each subsequent file
when in -i mode so that each file gets a clean context of its own.

Add a regression test for the bug.

Tested with:	regression tests
2007-06-12 12:05:24 +00:00
Yaroslav Tykhiy
bebfe2adf7 There is a symbolic antonym for REPLACE as a flag to cspace()
and mf_fgets(): APPEND.  So use it instead of a 0 constant for
clarity.

Tested with:	md5(1)
2007-06-12 10:56:38 +00:00
Ceri Davies
f18f2fc7fd Backout mess mistakenly committed with manpage update. 2007-06-10 06:18:04 +00:00
Ceri Davies
664fd46b84 Document SCTP support. 2007-06-10 06:11:03 +00:00
Beech Rintoul
52d1461fdc - Add myself.
Approved by:	sat (mentor)
2007-06-09 21:46:04 +00:00
Randall Stewart
74fd40c90c Adds support for SCTP. 2007-06-09 13:44:09 +00:00
Greg Lehey
f4025ee00f Sort events by date.
Correct long-standing off-by-one error in -W option.

Submitted by: edwin@

Shorten some long lines.  These files are still not completely
style(9) compliant.
2007-06-09 05:54:13 +00:00
Greg Lehey
a4a78d1a4c Include calendar.dutch. 2007-06-09 05:51:24 +00:00
Greg Lehey
c98b7694bc Dutch calendar.
Submitteed by: edwin@
2007-06-09 05:41:18 +00:00
Xin LI
4f68049e7b Increase inputFS buffer. awk will not accept some old scripts
otherwise.
2007-06-08 05:44:12 +00:00
Xin LI
bca072af62 Mention 'k' option of gunzip.
Pointed out by:	ighighi gmail.com
2007-06-06 02:51:54 +00:00
Rong-En Fan
202819e1e6 - Update for 2007/05/01 import
Approved by:	delphij (mentor)
Nodded by:	ru
Tested by:	make universe
2007-06-05 15:35:05 +00:00
Xin LI
a1f2804141 Regen. 2007-06-04 01:43:25 +00:00
Greg Lehey
70ee1a4509 Fix various bugs in the -A and -B options.
Submitted by:	edwin@
PR:		bin/113250
MFC after:	2 weeks
2007-06-03 03:07:10 +00:00
Doug Barton
d6ceb6db22 Update bmake glue for the BIND 9.4.1 import.
This includes a return to building with threads, since one of the
major focuses of the 9.4.x branch is to improve thread performance.
2007-06-02 23:19:58 +00:00
Max Khon
6d000893b4 Change directory back to ${.CURDIR} when remaking Makefiles.
Pointed out by:	ru
2007-06-01 04:20:19 +00:00
Tim Kientzle
a38d1d4c8b bsdtar 2.2.3:
* Implement --use-compress-program using new libarchive feature.
  * Minor portability improvement by adjusting casts used to
    print out uids, gids, and device numbers.

Thanks to: Joerg Sonnenberger for the --use-compress-program implementation.
MFC after: 15 days
2007-05-29 05:39:10 +00:00
Xin LI
2a8e7ac9c8 Add a '-k' flag which is similar with its bzip2(1) counterpart,
meaning that the user wants the input file to be left intact.

Feature request: Ighighi <ighighi gmail.com>
PR:		 bin/103006
MFC after:	 1 month
2007-05-28 08:20:46 +00:00
Ruslan Ermilov
55e1a40108 Update for the 4.21 import (manuals didn't change). 2007-05-25 09:25:05 +00:00
David E. O'Brien
79f6e0e6b4 FreeBSD has <limits.h>. 2007-05-24 22:10:22 +00:00
David E. O'Brien
8cbe72bdb7 Update for the 'file' 4.21 import. 2007-05-24 22:02:49 +00:00
Lukas Ertl
46a3ae64b2 Fix handling of filenames containing whitespace.
PR:      bin/112860
MFC in:  3 days
2007-05-24 18:28:08 +00:00
David E. O'Brien
a90b38c0b1 Update for the 'file' 4.19 import. 2007-05-24 16:14:38 +00:00
Ruslan Ermilov
a688ea13f5 Don't want a stray systrace_args.c in objdir. 2007-05-22 10:36:12 +00:00
Diomidis Spinellis
fdbe5babe4 Increase precision of time values in the process accounting
structure, while maintaining backward compatibility with legacy
file and record formats.
2007-05-22 06:51:38 +00:00
Giorgos Keramidas
42aff2e46d Remove duplicate ' 2' manpage section number.
Submitted by:	 Rui Paulo
MFC after:	 3 days
2007-05-21 20:33:51 +00:00
Tim Kientzle
3b0e49fad9 Mention the formats supported by bsdtar; include an
example that shows how to work with an ISO 9660 image.
2007-05-20 18:23:39 +00:00
Juli Mallett
26cfaf71bb Fix typo. 2007-05-17 00:19:56 +00:00
Juli Mallett
36c5e18daa o) Correct for missing whitespace.
o) We don't need to check if ifp == stdin to give the filename, since we already
   know that ifn will be "stdin" if it is.
2007-05-17 00:18:01 +00:00
Juli Mallett
2fdb65fd82 Fix confusing misindentation of a closing-brace. (It goes with the switch, not
with the while.)
2007-05-17 00:11:58 +00:00
Diomidis Spinellis
e91843d40a Backout revisions 1.16-1.14.
Backwards compatibility with the new acct(5) format will be
implemented through the explicit versioning of acct records,
not through an export/import procedure.
2007-05-14 09:05:22 +00:00
Andre Oppermann
612d21296c 'netstat -A -p tcp' doesn't print the Socket but the Tcpcb pointer in the
first column.
2007-05-13 22:32:32 +00:00
Pav Lucistnik
67a09fffe1 Replace rev. 1.9 with patch from OpenBSD.
Submitted by:	Ray Lai <ray@cyth.net>
Obtained from:	http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/tip/acu.c.diff?r1=1.13&r2=1.14
MFC after:	1 week
2007-05-12 23:29:33 +00:00
Pav Lucistnik
bae1345b9d Fix crash when using 'du' capability: NULL return of strpbrk was not handled
PR:		bin/108368
Reported by:	Ivo Hazmuk <ivo@vutbr.cz>
Submitted by:	rdivacky
MFC after:	2 weeks
2007-05-12 13:36:13 +00:00
Pav Lucistnik
0e2dd92370 Expand documentation of -f option
PR:		docs/66265
Submitted by:	Michel Lavondes <fox@vader.aacc.cc.md.us>
MFC after:	1 week
2007-05-12 12:23:40 +00:00
Tim Kientzle
6a955a7506 Set the program return value non-zero if we enounter
an error while skipping the body of an entry during
"tar -t" processing.

Thanks to: Spencer Minear
PR: misc/112521
2007-05-08 15:22:21 +00:00
David Malone
61d8eede29 Cast to intmax_t to print tv_sec in struct timeval.
Avoid shadowing a global variable with a function argument.
Set WARNS to 6.
2007-05-07 12:23:23 +00:00
David Malone
2ffe6bbf0f Use [u]intmax_t to printf unknown integer types.
Make timeprt always allocate memory, to make things a little simpler.
Remove an unused variable.
2007-05-07 12:10:06 +00:00
David Malone
6f62d86388 Make logmsg take const char * arguments.
Set WARNS to 6.
2007-05-07 11:28:01 +00:00
David Malone
e4cedda807 ANSIfy function definitions.
Move some extern declarations to a header file.
Remove an unneeded extern declaration for optarg.
2007-05-07 11:18:30 +00:00
David Malone
bc7e443092 Fix some warnings by making things const, adding missing headers,
removing some unused variables and making a variable unsigned.

MFC after:	3 weeks
2007-05-07 11:01:36 +00:00
David Malone
61f31ed6cf Initialise variable size so that reading stdin works deterministically.
Add missing include.

Default to WARNS=6.
2007-05-03 13:57:19 +00:00
Benjamin Close
d7a1f74bec Add myself
Approved by:	mlaier (mentor)
2007-05-03 11:34:36 +00:00
Colin Percival
c85ac10468 If lstat(2) fails, have bsdtar return a non-zero exit code if the
failed path is one which was specified on the command line.

This is a compromise between the situation prior to revision 1.57
(where a race between tar(1) and rm(1) could cause tar(1) to
spuriously report an error) and the situation after revision 1.57
(where "tar -c /no/such/path" prints a warning but returns with
an exit code of zero).

Inspired by:	rafan
MFC after:	1 week
2007-05-03 04:33:11 +00:00
Andrey A. Chernov
ba174a5e38 Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug
reports (I receive nothing). But because I surprisingly meets so
strong opposition and resistance so lost any desire to continue that.

Anyone who interested in POSIX can dig out what changes and how
through cvs diffs.
2007-05-01 16:02:44 +00:00
Andrey A. Chernov
35e4f24d23 limits calls setenv("name=value", "value", 1); which violates POSIX:
"The setenv( ) function shall fail if:
[EINVAL] The name argument is a null pointer, points to an empty string,
or points to a string containing an '=' character."
The fix (like all others in this subject) is backward-compatible.
2007-04-30 20:10:10 +00:00
Andrey A. Chernov
ed4bcacfde env calls setenv("name=value", "value", 1); which violates POSIX:
"The setenv( ) function shall fail if:
[EINVAL] The name argument is a null pointer, points to an empty string,
or points to a string containing an '=' character."
The fix (like all others in this subject) is backward-compatible.
2007-04-30 19:25:00 +00:00
Andrey A. Chernov
8673ed1565 Slightly tune previous fix: free memory if !export 2007-04-30 12:54:02 +00:00
Andrey A. Chernov
9e461e53cc Prepare for upcoming POSIXed putenv() rewrite:
don't free memory after putenv()
2007-04-30 12:51:02 +00:00
Andrey A. Chernov
2efaac818f Prepare for upcoming POSIXed putenv() rewrite:
don't free memory after putenv()
2007-04-30 12:44:04 +00:00
Maxim Konovalov
4063583a62 o Fill the list of icmp types; make its size depend on ICMP_MAXTYPE.
o Print "unknown ICMP" instead of "(null)" if we don't have a description         for a icmp type.

Based on code

Submitted by:	Christoph Weber-Fahr
PR:		misc/112126
MFC after:	2 weeks
2007-04-30 12:27:04 +00:00
Andrey A. Chernov
97e49dd4b5 Eliminate error with -W* strict flags and make putenv() calls conforming to
standard and portable in the same way as f.e. gcc internal portable code does.
2007-04-30 05:14:29 +00:00
David Malone
3e6dcadf52 Change the date for Daylight Savings in the US.
PR:		111102
Submitted by:	Sean Farley <sean-freebsd@farley.org>
Obtained from:	OpenBSD
2007-04-29 20:03:06 +00:00
Brian Somers
2e7b6bff38 Add some more examples. It always takes me a long time to find the S
modifier (-t is ignored without it).

MFC after:	1 week
2007-04-27 18:23:32 +00:00
Marcelo Araujo
e27c581538 - Added entry for Marcelo S. Araujo.
Approved by:	itetcu (comentor)
2007-04-27 18:17:41 +00:00
Tong LIU
e5b725c271 add myself.
Approved by:	delphij (mentor)
2007-04-25 11:59:10 +00:00
Yaroslav Tykhiy
f3aad16b88 Insert explicit space between the output fields to prevent them
from running together when a field overflows.

MFC after:	1 week
2007-04-23 11:43:22 +00:00
Yaroslav Tykhiy
70b36fc0c8 Don't forget to bump document date after changing the content. 2007-04-21 01:22:51 +00:00
Yaroslav Tykhiy
f6703c9c0a Change the semantics of -i (in-place editing) so that it treats
each file independently from other files.  The new semantics are
desired in the most of practical cases, e.g.: delete lines 5-9
from each file.

Keep the previous semantics of -i under a new option, -I, which
uses a single continuous address space covering all files to edit
in-place -- they are too cool to just drop them.

Add regression tests for -i and -I.

Approved by:	dds
Compared with:	GNU sed
Discussed on:	-hackers
MFC after:	2 weeks
2007-04-21 01:21:36 +00:00
Max Khon
45352bae07 Improve logging when -dm is specified: if the node is considered
out-of-date print not only "modified before source" message
but also the path of youngest source.
2007-04-20 06:33:25 +00:00
Max Khon
bc5748e31f When remaking makefiles check that mtime has actually changed.
This fixes infinite restart in the following case:

Makefile: foo

foo: bar
	do-something

Unlike GNU make, BSD make considers "Makefile" node as remade even
if "foo" is up-to-date and was not actually rebuilt.
GNU make does not consider nodes without commands as remade if child nodes
were not actually rebuilt.

Most probably, more proper fix would be to bring BSD make behaviour in-line
with GNU make but this would be more intrusive change.
2007-04-20 06:25:45 +00:00
Diomidis Spinellis
b7dd80b843 Change the export option from -w (write) to -X.
While implementing import it became apparent that write as a mnemonic
is ambiguous and confusing.

MFC after:	8 days
2007-04-18 16:43:21 +00:00
Diomidis Spinellis
3f863a9ae4 Complain on write errors.
Use correct type for write_text.

MFC after:	8 days
2007-04-18 09:39:47 +00:00
Diomidis Spinellis
947ef7f187 Add export capability through the new -w flag.
Discussed in: -arch
MFC after:	8 days
2007-04-18 08:55:54 +00:00
Tim Kientzle
8d36aa79ef Ignore trailing '/' when comparing pathnames, so that
"tar -u" works again.  Otherwise, "tar -u" wants to
treat every dir as new and re-adds it.
2007-04-18 04:36:11 +00:00
Tim Kientzle
007c50304b When testing basic functionality, strip trailing '/' from
dir names, so they match the names generated by 'find'.
2007-04-18 04:35:17 +00:00
Rong-En Fan
6000ced11b - Add a new 'j' switch and runtime option to toggle display jail id for
each process.
- While I'm here, keep help message sorted by keys

PR:		98489, 98975
Submitted by:	clsung
Approved by:	delphij (mentor)
MFC after:	2 weeks
2007-04-17 03:12:39 +00:00
Colin Percival
6fc0ea8474 In libarchive: Downgrade ARCHIVE_FATAL and ARCHIVE_FAILED errors which
occur on the write side of extracting a file to ARCHIVE_WARN errors
when returning them from archive_read_extract.

In bsdtar: Use the return code from archive_read_data_into_fd and
archive_read_extract to determine whether we should continue trying to
extract an archive after one of the entries fails.

This commit makes extracting a truncated tarball complain once about
the archive being truncated, instead of complaining twice (once when
trying to extract an entry, and once when trying to seek to the next
entry).

Discussed with:	kientzle
2007-04-16 04:04:50 +00:00
Andrey A. Chernov
b79aefd3e9 Use proper type cast for ctype macro 2007-04-14 14:32:48 +00:00
Stanislav Sedov
faac60c8fc - Add new 'a' switch and runtime option that allows 'top' to display process
titles extracted from argv vector instead of the real executable names.
  This is useful when you want to watch applications that set their status
  information via setproctitle(3).

Approved by:	alfred
MFC after:	2 weeks
2007-04-14 10:16:52 +00:00
Tim Kientzle
94a2a4ad3d Portability.
Thanks to: Martin Koeppe for testing on Interix
2007-04-13 16:08:23 +00:00
Ruslan Ermilov
edd57853f5 In .error and .warning, prefer command-line variables
to globals, as per documentation.

Nudged by:	Jeremie Le Hen
2007-04-12 18:14:00 +00:00
Ruslan Ermilov
1e5f1c29ea Restore the ".Sh BUGS" line that was accidentally removed
in the previous commit.
2007-04-12 08:22:49 +00:00
Tim Kientzle
f6df491097 Make it easier to support more platforms.
Thanks to: Joerg Sonnenberger for pointing out the need and the technique.
2007-04-12 04:45:32 +00:00
Dag-Erling Smørgrav
ae16dc8817 Remove irrelevant comment about T/TCP in BUGS.
Spotted by:	ru@
2007-04-11 20:32:59 +00:00
Dag-Erling Smørgrav
b49339d790 Remove -T from getopt() spec and usage string.
Submitted by:	ru@
2007-04-11 20:32:09 +00:00
Dag-Erling Smørgrav
e705dbe22c Bump Dd. 2007-04-11 19:20:42 +00:00
Dag-Erling Smørgrav
f8871cc86d Remove T/TCP support, and the -T option which was needed to disable it.
MFC after:	3 weeks
2007-04-11 19:11:54 +00:00
Ed Maste
affde8a968 Eliminate memory leak from an accidental malloc(). 2007-04-10 17:37:53 +00:00
Greg Lehey
5abc1de430 Update to match revision 1.23 of touch.c.
Clarify some details.
2007-04-10 07:24:47 +00:00
Greg Lehey
1b54381b5a Usage: print base name of program.
-A flag: respect the -a and -m flags.
	 imply the -c flag.

Requested in principle by: brian
2007-04-10 07:22:30 +00:00
Xin LI
5d2d083c92 Make use of ptrace(2) instead of procfs in truss(1), eliminating
yet another need of an available /proc/ mount.

Tested with:	make universe
Submitted by:	howardsu
Reviewed by:	alfred
2007-04-10 04:03:34 +00:00
Bruce M Simpson
b9cb107e3a Mark netstat -g host-mode output as deprecated.
MFC after:	2 weeks
2007-04-10 00:30:26 +00:00
Ed Maste
5cfe203fbf Add prototype for generated ptraceopname function. 2007-04-09 22:04:27 +00:00
Pawel Jakub Dawidek
0c6b66bd70 Move uuidgen(1) from /usr/bin/ to /bin/. It will be used in rc.d/hostid
script, which will be executed before /usr/ mount.

Reviewed by:	mlaier, rink, brooks, rwatson
2007-04-09 19:16:48 +00:00
Ed Maste
24be4e6248 Remove static ptrace_ops array and extract ptrace op names from
sys/ptrace.h with mksubr.
2007-04-09 19:16:24 +00:00
Colin Percival
35c2dd3d05 Clean up error handling in archive_append to match how errors are
handled in write_hierarchy.

Approved by:	kientzle
2007-04-09 08:22:34 +00:00
Greg Lehey
3481910d32 Add -A flag to adjust existing time stamps.
Print name by which program was started in usage() message.

MFC after:  2 weeks
2007-04-09 02:19:37 +00:00
Tim Kientzle
c2c19b10c7 Simplify the logic for handling header read
errors.
2007-04-07 05:56:40 +00:00
Yaroslav Tykhiy
9cfc96edd7 style(9):
Use a single space before $FreeBSD$ to avoid terminal line overflow.

Pointed out by:		ru (The All-Seeing Eye)
2007-04-06 08:43:30 +00:00
Pawel Jakub Dawidek
f3a8d2f93c Add security.jail.mount_allowed sysctl, which allows to mount and
unmount jail-friendly file systems from within a jail.
Precisely it grants PRIV_VFS_MOUNT, PRIV_VFS_UNMOUNT and
PRIV_VFS_MOUNT_NONUSER privileges for a jailed super-user.
It is turned off by default.

A jail-friendly file system is a file system which driver registers
itself with VFCF_JAIL flag via VFS_SET(9) API.
The lsvfs(1) command can be used to see which file systems are
jail-friendly ones.

There currently no jail-friendly file systems, ZFS will be the first one.
In the future we may consider marking file systems like nullfs as
jail-friendly.

Reviewed by:	rwatson
2007-04-05 21:03:05 +00:00
Yaroslav Tykhiy
4ebdfcd2e1 Add an important detail to paragraph 12: the range is reset only if its
second address is a line number.
2007-04-05 17:12:01 +00:00
Yaroslav Tykhiy
0d68e7fead Reflect the change in rev. 1.44 of process.c.
Add $FreeBSD$ to please commit_prep.pl.
2007-04-05 13:31:17 +00:00
Diomidis Spinellis
44c900afd7 A dash as an argument to the -f option will now cause lastcomm to
read data from the standard input.  This allows tail -f to pipe
data to lastcomm, and thereby real-time monitoring of executed
commands.  The manual page includes the exact incantation.

MFC after:	2 weeks
2007-04-04 16:04:58 +00:00
Colin Percival
17c0c70552 Add test to confirm that piping a tar archive created by bsdtar through
'bsdtar -cf- @-' doesn't alter it.
2007-04-04 03:12:15 +00:00
Li-Wen Hsu
506f0b8148 Add myself.
Approved by:     clsung (mentor)
2007-04-04 02:34:33 +00:00
Brian Somers
b29cf88e96 Fix a typo 2007-04-03 19:14:39 +00:00
Chin-San Huang
5b4c58dff5 - Add myself.
Approved by:	delphij@ (mentor)
2007-04-03 06:02:49 +00:00
Yaroslav Tykhiy
e9a0eed451 Don't forget to close the range if we branched over its end
and had no chance to match it by the 2nd address precisely.
Otherwise the unclosed range would bogusly extend to the end
of stream.

Add a basic regression test for the bug fixed.  (This change
also fixes the more complex case 5.3 from `multitest.t'.)

Compared with:	SUN and GNU seds
Tested by:	regression tests
MFC after:	1 week
2007-04-02 08:14:46 +00:00
Yaroslav Tykhiy
b1b46280cb Prevent foot-shooting in advance: Put the MATCH() macro's value
in parentheses.  The ?: operator has a remarkably low precedence, so
expressions like (MATCH(foo) && bar) would have an unexpected meaning
w/o the parentheses around MATCH().

Tested with:	md5(1)
2007-04-02 06:47:48 +00:00
Yaroslav Tykhiy
6b8ef68111 This trivial change should fix at least 3 similar bugs. All of
them are related to the `c' function's need to know if we are at
the actual end of the address range.  (It must print the text not
earlier than the whole pattern space was deleted.)  It appears the
only sed function with this requirement.

There is `lastaddr' set by applies(), which is to notify the `c'
function, but it can't always help because it's false when we are
hitting the end of file early.  There is also a bug in applies()
due to which `lastaddr' isn't set to true on degenerate ranges such
as `$,$' or `N,$' if N appears the last line number.

Handling early EOF condition in applies() could look more logical,
but it would effectively revert sed to the unreasonable behaviour
rev. 1.26 of main.c fought against, as it would require lastline()
be called for each line within each address range.  So it's better
to call lastline() only if needed by the `c' function.

Together with this change to sed go regression tests for the bugs
fixed (c1-c3).  A basic test of `c' (c0) is also added as it helped
me to spot my own error.

Discussed with:		dds
Tested by:		the regression tests
MFC after:		1 week
2007-04-01 13:25:03 +00:00
Colin Percival
a92fcfb26e Add tests for "bsdtar -t". These are useful primarily because they test
the archive_read_data_skip code.
2007-03-31 22:04:36 +00:00
Colin Percival
0260ab4f4e Split the append_archive function (used for processing @<archive> directives)
into separate append_archive and append_archive_filename functions; the first
takes a "struct archive *" as input, while the second takes a filename, opens
the archive, and calls the first.

There should be no changes in behaviour as a result of this commit; it simply
reorganizes code to make more sense.  At some point in the future it may be
possible to share code between append_archive and read_archive, but not yet.

Discussed with:	kientzle
2007-03-31 10:14:03 +00:00
Yaroslav Tykhiy
c691c0ed18 Make the comment for cspace() match reality. 2007-03-31 09:08:22 +00:00
Xin LI
095385a17b Update for bzip2 1.0.4 import. 2007-03-28 07:48:03 +00:00
Maxim Konovalov
7f61ad1c2b o Really commit typo fixes to HEAD.
PR:		docs/110809
Submitted by:	naddy
2007-03-25 18:37:59 +00:00