Commit Graph

9380 Commits

Author SHA1 Message Date
Hajimu UMEMOTO
46f39347f5 Since the width is always 2, it is enough to put just one
trailing space is enough.

MFC after:	1 week
2009-06-18 16:40:00 +00:00
Hajimu UMEMOTO
bd97a998dc Fix column width of weekday names for multibyte locales.
Noticed by:	nyan
Discussed with:	matusita, takawata
MFC after:	1 week
2009-06-17 14:47:06 +00:00
Ed Schouten
7c7cef7278 Add revoke(1).
While hacking on TTY code, I often miss a small utility to revoke my own
(pseudo-)terminals. This small utility is just a small wrapper around
the revoke(2) call, so you can destroy your very own login sessions.

Approved by:	re
2009-06-15 21:52:27 +00:00
Ed Schouten
cb3ec8e0c1 Make the chpass Makefile honour NO_FSCHG.
The chpass Makefile tried to set the fschg flag on the binaries, even if
NO_FSCHG was passed to the installworld. This meant that if I installed
FreeBSD into a Jail, I couldn't installworld from within the Jail
anymore.

Now that it listens to NO_FSCHG, we can just make it bail out when it
fails, just like PRECIOUSPROG does.
2009-06-15 21:05:00 +00:00
Dag-Erling Smørgrav
c540146463 Add volatile to sig_atomic_t where it was missing.
MFC after:	1 week
2009-06-14 21:39:52 +00:00
Ed Schouten
33f5882ec0 Include <sys/module.h> for modfind().
Submitted by:	Pawel Worach
2009-06-14 12:47:27 +00:00
Alexander Nedotsukov
64fbf83d6d Fix bug in zphys offset calculation I introduced while retyping
original patch.
2009-06-09 04:09:31 +00:00
Alexander Nedotsukov
e29dea04cb Chase ZFS v13 import changes.
This is a temporary fix until we find a way to avoid fstat
to be broken each time we change the znode.

Approved by:	lulf
2009-06-09 03:35:42 +00:00
Brian Somers
22da50cfc8 Change the behaviour of -F slightly; it now persists (forever) in
trying to open files rather than giving up when it encounters an
error.  ENOENT errors are not reported.

As a result, files that are moved away then recreated are not at
risk of being 'lost' to tail.  Files that are recreated and
temporarily have unreadable permissions will be shown when they
are fixed.

This behaviour is consistent with the GNU version of tail but
without the verbiage that goes with the GNU version.

This change also fixes error messages accompanying -f and -F.
They no longer report problems with (null)!

MFC after:	3 weeks
2009-06-05 09:08:53 +00:00
Edwin Groothuis
5db5ccf42c [patch] calendar.music: Chuck Berry was born in St. Louis, Missouri, not California
The /usr/bin/calendar program reports that Chuck Berry was born
    in San Jose California but he was not born in California.

    Chuck Berry was born in St. Louis, Missouri in 1926 on October 18.

    http://www.chuckberry.com/about/bio.htm
    http://www.khaldea.com/charts/chuckberry.shtml
    http://en.wikipedia.org/wiki/Chuck_Berry

PR:		conf/128215
Submitted by:	comet--berkeley (aka Pablo Picasso) <comet@transbay.net>
MFC after:	2 days
2009-06-04 21:48:04 +00:00
Ed Schouten
89f98d57d6 Remove window(1) from the base system.
Some time ago Tom Rhodes sent me an email that he was willing to perform
various cleanups to the window(1) source code. After some discussion, we
both decided the best thing to do, was to move window(1) to the ports
tree. The application isn't used a lot nowadays, mainly because it has
been superseeded by screen, tmux, etc.

A couple of hours ago Tom committed window(1) to ports (misc/window), so
I'm removing it from the tree. I don't think people will really miss it,
but I'm describing the change in UPDATING anyway.

Discussed with:	trhodes, pav, kib
Approved by:	re
2009-06-02 13:44:36 +00:00
Doug Barton
536613bc35 Add support for the build options that are currently in the port:
WITH_BIND_IDN
	WITH_BIND_LARGE_FILE
	WITH_BIND_SIGCHASE
	WITH_BIND_XML
2009-06-01 21:58:59 +00:00
Gabor Kovesdan
25dd52cdb1 - Add Hungarian catalog 2009-06-01 21:54:59 +00:00
Rick Macklem
61a2fc1fbb Change the "-4" option flag to "-e" since it does not refer to IPv4
and to make it consistent with the flag used by nfsd and mountd.

Approved by:	kib (mentor)
2009-06-01 20:34:00 +00:00
Bjoern A. Zeeb
c2c2a7c11e Convert the two dimensional array to be malloced and introduce
an accessor function to get the correct rnh pointer back.

Update netstat to get the correct pointer using kvm_read()
as well.

This not only fixes the ABI problem depending on the kernel
option but also permits the tunable to overwrite the kernel
option at boot time up to MAXFIBS, enlarging the number of
FIBs without having to recompile. So people could just use
GENERIC now.

Reviewed by:	julian, rwatson, zec
X-MFC:		not possible
2009-06-01 15:49:42 +00:00
Marko Zec
1f7fcb28e6 Unbreak buildworld.
(not waiting for an approval from mentor (julian) due to emergency)
2009-05-31 15:41:46 +00:00
Jilles Tjoelker
6911f596a1 rm, find -delete: fix removing symlinks with uchg/uappnd set.
Formerly, this tried to clear the flags on the symlink's target
instead of the symlink itself.

As before, this only happens for root or for the unlink(1) variant of rm.

PR:		bin/111226 (part of)
Submitted by:	Martin Kammerhofer
Approved by:	ed (mentor)
MFC after:	3 weeks
2009-05-30 10:42:19 +00:00
Xin LI
896406c91a Use prototype for usage(). This makes perror(1) WARNS=6 clean.
Approved by:	gnn
2009-05-28 21:37:40 +00:00
Xin LI
948c1a68c6 Correct off-by-one issue in truss(1) which happens when system call number
is nsyscalls.

PR:		bin/134916
Submitted by:	Steven Hartland <steven hartland multiplay co uk>
MFC after:	2 weeks
2009-05-28 00:38:24 +00:00
Ed Schouten
96b676e999 Update ee(1) in the base system to version 1.5.0.
This version is now licensed under a 2-clause BSD license, instead of
the Artistic license. I've reverted a lot of local modifications we made
to ee, because they have been integrated upstream as well.

Only local modifications include:

- $FreeBSD$ ID.
- Pathname to init.ee.
- catopen() call, to honor LC_MESSAGES instead of LANG.

To keep SVN happy, I'm putting an application/octet-stream mime type on
the KOI8 translations.

Reviewed by:	current@
2009-05-27 17:27:03 +00:00
Andrew Thompson
11c63ede84 Delete the old USB stack. The new stack has settled in and has all the
drivers/functionality and then some.
2009-05-27 16:16:56 +00:00
Jamie Gritton
73d0971bf2 Add support for the arbitrary named jail parameters used by jail_set(2)
and jail_get(2).  Jail(8) can now create jails using a "name=value"
format instead of just specifying a limited set of fixed parameters; it
can also modify parameters of existing jails.  Jls(8) can display all
parameters of jails, or a specified set of parameters.  The available
parameters are gathered from the kernel, and not hard-coded into these
programs.

Small patches on killall(1) and jexec(8) to support jail names with
jail_get(2).

Approved by:	bz (mentor)
2009-05-27 14:30:26 +00:00
Ed Schouten
cfe04e82b1 Merge local changes to ee(1) into contrib space.
The source file, manual page and English translation are now directly
obtained from the contrib/ directory. This makes it a lot easier to
merge a newer version of ee(1) into the tree.

Thanks to:	des and jhb
2009-05-26 21:06:51 +00:00
Ed Schouten
15814131d4 Remove unused curses replacement implementation from ee(1) sources. 2009-05-26 19:06:56 +00:00
Ed Schouten
a982207b32 Vendor import of ee 1.4.2. 2009-05-26 18:50:01 +00:00
Brian Somers
f1b746f92d Bump the document date to reflect the recent address range enhancements.
Suggested by:	throdes
2009-05-25 21:29:06 +00:00
Ed Schouten
4b54fa116c Fix kdump build when building it by hand.
I don't entirely like this approach, but it will only be temporarily,
namely until we get rid of COMPAT_43TTY. I do want <sys/ioctl_compat.h>
to cause a compiler error when included, because it's just there for
binary compatibility.

Reported by:	Andrzej Tobola <ato iem pw edu pl>
2009-05-25 20:07:41 +00:00
Rick Macklem
bcdaa85069 Add the "-4" option to nfsstat, so that it will reports stats
for the experimental nfs subsystem when that option is specified.

Approved by:	kib (mentor)
2009-05-25 15:48:10 +00:00
Brian Somers
f879e8d923 Implement "addr1,+N" ranges - not dissimilar to grep's -A switch.
PR:		134856
Submitted by:	Jeremie Le Hen - jeremie at le-hen dot org
2009-05-25 06:45:33 +00:00
George V. Neville-Neil
1fdc45cd2e A few more style changes as well as a more broad allowance for
errors to be given by the caller.  Change output to be easier
for use in scripts.

Submitted by:	bce
2009-05-20 22:19:22 +00:00
Maxim Konovalov
2785354e68 o style.Makefile(5): remove SRCS. 2009-05-20 05:49:06 +00:00
George V. Neville-Neil
99000ae194 Fix a few style(9) nits.
Submitted by:	danfe
2009-05-19 20:16:18 +00:00
George V. Neville-Neil
9a3009b800 Add a new program, perror, which takes an errno as a command line argument
and outputs the associated textual message in the same way that
perror(3) would if called within a program.
2009-05-19 17:40:22 +00:00
Andriy Gapon
05e605b764 find: do not silently disable -L when -delete is used
First of all, current behavior is not documented and confusing,
and it can be very dangerous in the following sequence:
find -L . -type l
find -L . -type l -delete
(the second line is even suggested by find(1)).

Instead simply refuse to proceed when -L and -delete are both used.
A descriptive error message is provided.
The following command can be safely used to remove broken links:
find -L . -type l -print0 | xargs rm -0

To do:		update find(1)
PR:		bin/90687
Obtained from:	Anatoli Klassen <anatoli@aksoft.net>
Approved by:	jhb (mentor)
2009-05-19 14:23:54 +00:00
Xin LI
216fa4c607 Reduce diff against my local version: replace malloc+memset() cases to calloc(). 2009-05-15 19:41:10 +00:00
Diomidis Spinellis
1de3b2ff03 Fix print_syscall_ret parameter order. 2009-05-13 13:00:52 +00:00
Diomidis Spinellis
b53ae7114c Fix compilation error introduced in r192025. 2009-05-13 12:43:37 +00:00
Diomidis Spinellis
ee3b0f6e2e Add -c option to summarize number of calls, errors, and system time.
Reviewed by:	alfred
2009-05-12 20:42:12 +00:00
Ed Schouten
f31b4b6a80 Add support for old TTY ioctls to kdump.
At first I allowed ioctl_compat.h to be included, but it just returned
an empty file. I had to do this, to keep kdump happy. I really want to
raise a compiler error when including this header, so now it will just
throw an error if you don't set COMPAT_43TTY.
2009-05-09 15:09:40 +00:00
Steven Kreuzer
9330df7e5d Add my birthday
Approved by:	wxs (mentor)
2009-05-07 15:32:13 +00:00
Rene Ladan
da98b8a90d Add my birthday to the calendar.
Approved by:	remko
2009-05-05 16:45:25 +00:00
Sean Nicholas Barkas
d1884d416a Add myself as a mentee of dwmalone for the committers graph. Also add my
birthday to the calendar.

Approved by:	dwmalone (mentor)
2009-05-05 15:03:19 +00:00
David E. O'Brien
7dbb948b5f Merge vendor/file/dist@191739, bringing FILE 5.00 to 8-CURRENT. 2009-05-04 00:37:44 +00:00
Roman Divacky
7149aa0155 Mention -h in usage() and manpage. Rename term_{r,e} to term_{so,se}.
Suggested by:	ru
Approved by:	ed (mentor)
2009-05-02 07:02:31 +00:00
Ruslan Ermilov
0c4ffccadb Fixed multi-byte character support to actually work. 2009-04-30 13:53:00 +00:00
Ruslan Ermilov
65710fd2d2 Fixed missing dependency. 2009-04-30 13:30:27 +00:00
Warner Losh
d1588599c0 Report the next directory being scanned when a ^T is pressed (or any
SIGINFO).  Provides some progress report for the impatient.  This
won't report that we're blocking in our walk due to disk/network
problems, however.  There's no really good way to report that
condition that I'm aware of...
2009-04-30 01:24:53 +00:00
Bruce M Simpson
7d9d64ba0d Add MLDv2 statistic IDs to netstat for IPv6 stack. 2009-04-29 09:52:04 +00:00
Roman Divacky
0cd51de155 Couple of changes based on feedback
o	Change mr/me to so/se [1].
	o	Introduce a -h option to disable highlighting. [2]
	o	Spell STDOUT_FILENO as such and pass NULL to tgetent()
		to handle the case of unset TERM. [3]

Suggested by:	naddy mips.inka.de (Christian Weisgerber) [1]
Requested by:	danfe, deischen	[2]
Suggested by:	jmallett	[3]
Approved by:	ed (mentor)
2009-04-21 17:44:46 +00:00
Bruce M Simpson
86979280fc Bracket struct mfc and struct rtdetq with #ifdef _KERNEL.
Match the bracketing in netstat.
Since the cleanup of MROUTING, ports have broken because they
expect to include <netinet/ip_mroute.h> without including
<sys/queue.h>. Fix breakage at source.

The real fix, of course, is to fix the MROUTING APIs by blowing them
away and replacing them with something else...
2009-04-21 12:47:09 +00:00
Roman Divacky
e454a17158 Implement highlighting of today in month view of cal/ncal just like
gnu cal does. This is currently disabled for year view because of hard
coded padding in that case. This will hopefully be fixed soon.

Reviewed by:	Simon 'corecode' Schubert <corecode fs.ei.tum.de>
Approved by:	ed
2009-04-20 18:19:38 +00:00
Robert Watson
781202d7fd Pass int arguments to auditon(2)'s A_GETCOND API rather than long
arguments.  This change should be MFC'd with OpenBSM 1.1 since they
are interdependent.

MFC after:	2 weeks
Obtained from:	TrustedBSD Project
Sponsored by:	Apple, Inc.
2009-04-19 23:34:22 +00:00
Tim Kientzle
4f6b15547b When compiled for the release crunches, be a bit
more selective about what libarchive features we pull in:
 * No compression support
 * Only cpio and ustar writing
 * Only cpio and tar/pax readers
This reduces a statically linked, stripped binary from 900k to 680k
and completely eliminates the dependency on libcrypto.
2009-04-19 06:59:12 +00:00
Tim Kientzle
79cf3de423 Make -lcrypto usage dependent on whether or not we're building with OpenSSL. 2009-04-18 06:03:09 +00:00
Tim Kientzle
d46c56dcba Merge from libarchive.googlecode.com:
* Lots of new tests.
 * New -n / --numeric-uid-gid option
 * More sanity-checking of arguments
 * Various Windows portability improvements
 * Sync up version number to 2.7.0
2009-04-17 04:04:57 +00:00
Tim Kientzle
5191e7b552 Merge remaining changes from libarchive.googlecode.com:
* Add xz and lzma compression options
 * Rename --format-options to simply --options
 * Add --same-owner for GNU tar compat
 * Add -lmd and -lcrypto to fix link
 * Documentation
2009-04-17 03:45:15 +00:00
Tim Kientzle
4e350e9d6b Set options before opening the archive.
Catch and report close-time errors.
2009-04-17 03:40:40 +00:00
Tim Kientzle
6ffa10bc90 Minor portability improvement in calls to ctype.h macros. 2009-04-17 03:37:09 +00:00
Tim Kientzle
c7e120041d Merge from libarchive.googlecode.com: Numerous Windows-specific build tweaks. 2009-04-17 03:36:07 +00:00
Xin LI
d5303c8027 Don't exit until all truss children were exit. 2009-04-13 16:23:32 +00:00
Xin LI
f0bcd5c3fa Correct a bug where pr_data should have been assigned. 2009-04-13 16:22:38 +00:00
Max Khon
c2502d78e1 Avoid infinite loops when remaking makefiles not only
for Makefile targets but also for targets they depend on.
2009-04-07 19:49:38 +00:00
Christian S.J. Peron
ce8c6d71f5 Fixup the parameters to audit_submit(3) the order is errno then return
value.  This bug went un-noticed for so long because EPERM == 1

MFC after:	1 week
Spotted by:	sson, rwatson
2009-04-04 20:58:18 +00:00
Xin LI
534ad498af Signed/unsigned fixes, should be WARNS=2 clean now. 2009-04-02 21:44:55 +00:00
Xin LI
ab85842c90 Don't crash when we have an invalid count number.
PR:		bin/32686
Submitted by:	Jaakko Heinonen <jh saunalahti.fi>
MFC after:	1 week
2009-04-02 21:23:04 +00:00
Tom Rhodes
6abf213ba4 Fix punctuation.
PR:		132834
Submitted by:	"Alan R. S. Bueno" <alan.bsd@gmail.com>
2009-04-01 08:33:54 +00:00
Ed Schouten
95e7b94a05 Don't strip TTY device name to the last '/'.
We've seen this bug in other applications before: we have some
applications that use strrchr(tty, '/') on the TTY device name. This
isn't valid when using pts(4), because the device name will be stripped
to "0" instead of "pts/0".

This fixes issues with login(1) ignoring /etc/ttys and missing utmp
records.

Reported by:	Barney Cordoba <barney_cordoba yahoo com>
Reviewed by:	rwatson
2009-03-27 19:13:36 +00:00
Xin LI
1a604cfa07 Add two missing include files and prototype for sockfamilyname()
which is generated by mksubr.
2009-03-20 18:29:52 +00:00
Tim Kientzle
f05da0e980 Act like ranlib if our name ends in ranlib. In particular,
this works with some recent cross-building changes by Warner
that install ranlib as, e.g., "arm-freebsd7.1-ranlib".

Submitted by:	John Hein
2009-03-20 17:11:45 +00:00
Bruce M Simpson
8392059492 Fix size_t merge-o. 2009-03-19 10:23:26 +00:00
Bruce M Simpson
443fc3176d Introduce a number of changes to the MROUTING code.
This is purely a forwarding plane cleanup; no control plane
code is involved.

Summary:
 * Split IPv4 and IPv6 MROUTING support. The static compile-time
   kernel option remains the same, however, the modules may now
   be built for IPv4 and IPv6 separately as ip_mroute_mod and
   ip6_mroute_mod.
 * Clean up the IPv4 multicast forwarding code to use BSD queue
   and hash table constructs. Don't build our own timer abstractions
   when ratecheck() and timevalclear() etc will do.
 * Expose the multicast forwarding cache (MFC) and virtual interface
   table (VIF) as sysctls, to reduce netstat's dependence on libkvm
   for this information for running kernels.
   * bandwidth meters however still require libkvm.
 * Make the MFC hash table size a boot/load-time tunable ULONG,
   net.inet.ip.mfchashsize (defaults to 256).
 * Remove unused members from struct vif and struct mfc.
 * Kill RSVP support, as no current RSVP implementation uses it.
   These stubs could be moved to raw_ip.c.
 * Don't share locks or initialization between IPv4 and IPv6.
 * Don't use a static struct route_in6 in ip6_mroute.c.
   The v6 code is still using a cached struct route_in6, this is
   moved to mif6 for the time being.
 * More cleanup remains to be merged from ip_mroute.c to ip6_mroute.c.

v4 path tested using ports/net/mcast-tools.
v6 changes are mostly mechanical locking and *have not* been tested.
As these changes partially break some kernel ABIs, they will not
be MFCed. There is a lot more work to be done here.

Reviewed by:	Pavlin Radoslavov
2009-03-19 01:43:03 +00:00
David Malone
e8c2f0b3aa Fix some warns - mainly signedness and unused variables. 2009-03-17 19:37:47 +00:00
Fabien Thomas
a15a45ac9d Add information about me as a new committer to the src tree
Approved by:	jkoshy (mentor)
2009-03-17 14:53:42 +00:00
Robert Watson
ad71fe3c35 Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted.  Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):

  INP_TIMEWAIT
  INP_SOCKREF
  INP_ONESBCAST
  INP_DROPPED

Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.

MFC after:      1 week (or after dependencies are MFC'd)
Reviewed by:    bz
2009-03-15 09:58:31 +00:00
David Schultz
4646cea766 Multibyte character support for cal(1).
PR:		131578
2009-03-14 18:55:51 +00:00
Roman Divacky
192f3d53d8 Add myself.
Approved by:	ed (mentor)
2009-03-12 16:55:16 +00:00
John Baldwin
a56be37e68 Add a new type of KTRACE record for sysctl(3) invocations. It uses the
internal sysctl_sysctl_name() handler to map the MIB array to a string
name and logs this name in the trace log.  This can be useful to see
exactly which sysctls a thread is invoking.

MFC after:	1 month
2009-03-11 21:48:36 +00:00
Robert Watson
4cf172fd65 Remove unused v6 macro aliases for inpcb fields:
in6p_ip6_nxt
        in6p_vflag
        in6p_flags
        in6p_socket
        in6p_lport
        in6p_fport
        in6p_ppcb

Remove unused v6 macro aliases for inpcb flags:

        IN6P_HIGHPORT
        IN6P_LOWPORT
        IN6P_ANONPORT
        IN6P_RECVIF
        IN6P_MTUDISC
        IN6P_FAITH
        IN6P_CONTROLOPTS

References to in6p_lport and in6_fport in sockstat are also replaced with
normal inp_lport and inp_fport references.

MFC after:	3 days
Reviewed by:	bz
2009-03-10 17:57:41 +00:00
John Baldwin
a0b9e7e332 Update top and systat for vfs.bufcache now being a long rather than an int. 2009-03-10 15:25:19 +00:00
Bruce M Simpson
d10910e6ce Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD
IPv4 stack.

Diffs are minimized against p4.
PCS has been used for some protocol verification, more widespread
testing of recorded sources in Group-and-Source queries is needed.
sizeof(struct igmpstat) has changed.

__FreeBSD_version is bumped to 800070.
2009-03-09 17:53:05 +00:00
Tim Kientzle
05fa9d9f25 Update version to 2.6.901a to indicate this is synced up with r745 of
libarchive.googlecode.com (except for the lzma/xz support).
2009-03-08 06:20:35 +00:00
Tim Kientzle
abe5b073f4 Merge r492 from libarchive.googlecode.com: First cut at exposing the
new options mechanism to userland.  Documentation pending...
2009-03-08 06:19:28 +00:00
Tim Kientzle
ebf7581e4d Match a comment to reduce differences with libarchive.googlecode.com. 2009-03-08 06:09:20 +00:00
Tim Kientzle
66c8431841 Merge r709,r710 from libarchive.googlecode.com: More work on
Windows support.
2009-03-08 06:07:35 +00:00
Tim Kientzle
ac90bcdea0 Merge r687-689,691,693-701,720 from libarchive.googlecode.com:
Translate getdate.y into C for portability.  Make the get_date()
function easier to test as well:
 * Have it accept a time_t "now" to use as a reference so that test
   code can verify relative time specifications against known starting
   points.
 * Set up default date after parsing the string so that we
   can use the specified timezone (if any) instead of the local
   default.  Otherwise, local DST makes it almost impossible to
   reliably test time specifications such as "sunday UTC"
2009-03-08 06:03:15 +00:00
Tim Kientzle
74d5acaf4c Merger r629-631,633-646,648,654,678,681,682 from libarchive.googlecode.com:
Many changes for Windows compatibility.  bsdtar_test now runs successfully
on both POSIX platforms and Windows.
2009-03-08 05:47:21 +00:00
Tim Kientzle
503c6aa1ca Merge r368,496,625,626 from libarchive.googlecode.com: A number of
style and portability tweaks to the test harness.  Most significantly,
don't use getopt().
2009-03-08 05:38:45 +00:00
Tim Kientzle
97c382f46b Merge r622 from libarchive.googlecode.com: Avoid warning on platforms
that lack regex.h.
2009-03-08 05:35:59 +00:00
Tim Kientzle
a16b186182 Merge r552,r559 from libarchive.googlecode.com: High-resolution time
support on Tru64, AIX, and GNU Hurd, thanks to Björn Jacke.
2009-03-08 05:34:20 +00:00
Tim Kientzle
709693c65a Merge r529 from libarchive.googlecode.com: Fix how we read ext2fs_fs.h
headers on Linux.
2009-03-08 05:28:52 +00:00
Tim Kientzle
88b0df8855 Merge r435,r443 from libarchive.googlecode.com: Let the compiler options
determine how to read config.h.
2009-03-08 05:24:37 +00:00
Tim Kientzle
3ae673ed49 Merge r283,r423 from libarchive.googlecode.com: Use libarchive's new
archive_read_disk API to pull metadata off of disk.  This
removes a lot of platform-specific knowledge of things like
ACLs, file flags, and extended attributes from bsdtar.
2009-03-08 05:22:50 +00:00
Tim Kientzle
e8f0b45249 Merge r374 from libarchive.googlecode.com: Stupid typo in open() call. <sigh> 2009-03-08 05:19:36 +00:00
Tim Kientzle
c9dae218f2 Merge r369 from libarchive.googlecode.com: Test -s option. 2009-03-08 05:17:58 +00:00
Tim Kientzle
5ff33ec7ae Merge r278 from libarchive.googlecode.com: Reduce the number of
patterns tested here from 200 to 170, which seems to be the
most that Cygwin can handle.
2009-03-08 05:14:16 +00:00
Tim Kientzle
7bae205d49 Merge r273 from libarchive.googlecode.com: Use open() correctly. 2009-03-08 05:10:51 +00:00
Konstantin Belousov
65067cc8b0 Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2Gb sized segment
of shared memory.

This makes it possible to use > 2 Gb shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.

Reviewed by:	csjp
Tested by:	Nikolay Dzham <i levsha org ua>
MFC after:	2 weeks
2009-03-02 18:53:30 +00:00
Ed Schouten
b57fd79960 Fix compilation of newkey(8) with WITHOUT_NIS=yes.
Increasing WARNS seems to have broken compilation of this utility.
Instead of lowering WARNS, just fix to code to compile properly.

Submitted by:	<bf2006a yahoo com>
Tested by:	bms
2009-02-28 16:16:37 +00:00
David Schultz
8e31b96c07 Use getline() instead of fgets(). This enables nl(1) to handle
arbitrarily long lines and embedded NULs. The new functionality is
nugatory, but adding it is a simple way to improve the exposure of
getline() in -CURRENT.
2009-02-28 15:53:36 +00:00
Ed Schouten
c2c1433327 Fix compilation of fstat.
The udev should now be obtained from the dosmount instead of the denode.
2009-02-28 10:40:37 +00:00
Ed Schouten
b3aaa0cc21 Rename all symbols in libmp(3) to mp_*, just like Solaris.
The function pow() in libmp(3) clashes with pow(3) in libm. We could
rename this single function, but we can just take the same approach as
the Solaris folks did, which is to prefix all function names with mp_.

libmp(3) isn't really popular nowadays. I suspect not a single
application in ports depends on it. There's still a chance, so I've
increased the SHLIB_MAJOR and __FreeBSD_version.

Reviewed by:	deischen, rdivacky
2009-02-26 21:43:15 +00:00
Andrew Thompson
8b446f57a8 Install the old usb headers under /usr/include/legacy/dev/usb as they are
needed by the hal port. This will be removed before 8.0.

Add an exclusion to kdump as some structs will be redefined.

Requested by:	marcus
2009-02-24 00:53:10 +00:00
Andrew Thompson
bf41796c4e Build fixups for the new USB stack. 2009-02-23 18:36:54 +00:00
Xin LI
612f2a0575 Remove unnecessary opt* definations. 2009-02-21 03:53:06 +00:00
Xin LI
a751987ad5 Define extern **environ in global scope instead of in function. 2009-02-21 03:50:25 +00:00
Xin LI
61613f1912 Utilize calloc() instead of bzero'ing manually. 2009-02-21 03:43:20 +00:00
Xin LI
614595dcc7 Initialize 'sz' as 0. 2009-02-21 03:42:31 +00:00
Xin LI
1c8ee5f26c Utilize strlcpy(). 2009-02-21 03:38:46 +00:00
Warner Losh
b3ba0b1ed2 Include proper header files for system functions that are used and
that gcc complains about this code changing from the built-in
versions.
2009-02-19 20:07:59 +00:00
Max Brazhnikov
5e4de39e21 Add myself. 2009-02-19 16:16:44 +00:00
Bruce M Simpson
57e9cb8cda Now that ifmcstat(8) does not suck, retire host-mode netstat -g.
This change will not be back-ported.
2009-02-15 16:16:38 +00:00
Warner Losh
970a16678b Truss builds on mips, so don't filter it building there anymore. 2009-02-15 01:32:50 +00:00
Warner Losh
89fe547f2a Add preliminary support for truss on MIPS. It compiles, but has not
been extensively tested.  And the ELF64 stuff likely is not quite
right...

# There's a lot of cut-n-paste code here that could easily be
# refactored, at least for FreeBSD syscalls.
2009-02-15 01:26:49 +00:00
Ed Schouten
42dc9c5abd Let stat(1) use fdevname(3).
Because we now have a reliable library function that converts file
descriptors to character device names, let stat(1) use this. This means
it can now do the following:

	$ stat -f %N
	/dev/pts/0

I've changed main() to set file properly, so output() is never called
with file set to NULL.

Approved by:	dougb (older version, still used devname)
2009-02-11 20:36:17 +00:00
Maxim Konovalov
df8a2f1a4b o Print an octal representation of suid, sgid and sticky bits with -x flag.
PR:		bin/131569
Submitted by:	Jaakko Heinonen
Reported by:	Yannick Cadin
MFC after:	1 week
2009-02-11 10:50:26 +00:00
Tim Kientzle
f64d4bd0f7 Fix multiple -s options.
MFC after:	7 days
2009-02-08 22:04:17 +00:00
Tim Kientzle
ec9d8e0b01 When copying file data to the archive, don't write more
than was read.  This seems to have only affected the shar
writer, since other formats proactively truncate output
to the originally-advertised size.

PR:		bin/131244
MFC after:	7 days
2009-02-08 22:02:46 +00:00
Maksim Yevmenkin
d37245a0de Clenup code a bit and do not call fork(2) before dameon(3) where not needed.
MFC after:	1 month
2009-02-04 22:04:06 +00:00
David E. O'Brien
d9a0172df3 Partially revert r186559. 2009-02-03 15:27:29 +00:00
Robert Watson
75d7ed1ed6 Alow dirname(1) to accept multiple arguments in the same way that
basename(1) does.

(Two different PRs contained identical patches, both cited below)

PR:		121520, 86148
Submitted by:	Ighighi <ighighi at gmail dot com>
Submitted by:	Leif Neland <leif at neland dot dk>
MFC after:	3 days
2009-02-02 11:19:56 +00:00
Max Khon
2121816903 Remove duplicate OPTFLAGS definition. 2009-02-02 06:25:57 +00:00
Warner Losh
0c380aef5f Sort the options, per style(9).
Reviewed by:	obrien@
2009-02-02 02:05:58 +00:00
Alfred Perlstein
7e474656a6 src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by:	hps
2009-02-02 00:49:39 +00:00
Bjoern A. Zeeb
09f8c3ff36 Remove the single global unlocked route cache ip6_forward_rt
from the inet6 stack along with statistics and make sure we
properly free the rt in all cases.

While the current situation is not better performance wise it
prevents panics seen more often these days.
After more inet6 and ipsec cleanup we should be able to improve
the situation again passing the rt to ip6_forward directly.

Leave the ip6_forward_rt entry in struct vinet6 but mark it
for removal.

PR:		kern/128247, kern/131038
MFC after:	25 days
Committed from:	Bugathon #6
Tested by:	Denis Ahrens <denis@h3q.com> (different initial version)
2009-02-01 21:11:08 +00:00
Warner Losh
08581af2e9 David doesn't consider the prior -s behavior a bug. Back out this
change.
2009-01-31 23:17:33 +00:00
Warner Losh
e9b777e9cc Unbreak make -s. There's about a 10% performance improvement with -s
in many environments.  The recent --- blah --- reintroduction has
killed.  That output makes almost no sense when all the other output
is silenced.
2009-01-30 16:12:32 +00:00
Dag-Erling Smørgrav
1ccdc84fdd Make sure the entries don't run into each other when they're longer than
the allotted space.

PR:		bin/129318
Submitted by:	Ighighi <ighighi@gmail.com>
MFC after:	3 weeks
2009-01-30 14:28:50 +00:00
Tom Rhodes
cff548f0dd When "-b" is specified, one could easily create "smaller" files
that are much larger than expected (given the default size).
Change "smaller files" to "split files" which is more in line
with what "-b" actually does.

PR:		119329
Submitted by:	Julian Stacey <jhs@berklix.org>
2009-01-24 05:32:11 +00:00
Tom Rhodes
a88e970c56 Attaching to the init process returns EINVAL,
so give an example that is more likely to work.
Stolen from the ktrace(1) manual page.

PR:		128222
Submitted by:	Mateusz Guzik <mjguzik@gmail.com>
2009-01-23 00:58:14 +00:00
Roman Divacky
3f8760e331 Remove inlining of functions that are used mostly in different object files.
This gets rid of gnu89 style inlining. Also silence gcc by assigning two
variables NULL. This lets use to remove NO_WERROR.

Approved by:	kib (mentor)
Approved by:	harti
2009-01-20 17:15:12 +00:00
Dag-Erling Smørgrav
3187195884 The FTP_TIMEOUT and HTTP_TIMEOUT environment variables were ignored because
T_secs already had a non-zero default.  Unbreak by moving the default to
ftp_timeout / http_timeout.

Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
MFC after:	2 weeks
2009-01-17 13:34:56 +00:00
Ed Schouten
0bee4c2c74 Rename mail(1)'s aux.c to util.c.
The name `aux' is reserved on Windows file systems. aux.c in the mail(1)
directory contains some random utility functions. I'm renaming this file
to util.c to make it possible to check out this directory on Windows.

MFC after:	1 month
2009-01-16 15:00:30 +00:00
Maxim Konovalov
3ed817f149 o Respect -ss flags (suppress zero counters) for icmp6 "histogram
of error messages" section.

Submitted by:	naddy
MFC after:	1 week
2009-01-13 07:58:57 +00:00
David E. O'Brien
ef9977831f Don't enable -Q by default - I've fixed the rescue build issue. 2009-01-13 06:53:53 +00:00
David E. O'Brien
03ce187564 If running with "-K" really do not information about symbols from the a.out
argument.  Before this fix, after searching the currently-running kernel,
we would still search the a.out argument - completely override the in-kernel
list, essentially defeating the K flag's purpose.

PR:		47387
Submitted by:	Ryan Beasley <ryanb@goddamnbastard.org>
2009-01-12 21:49:42 +00:00
Ruslan Ermilov
82d383bc96 Fix usage() with SYNOPSIS. 2009-01-10 22:49:02 +00:00
Ruslan Ermilov
8bee8d8961 Fix markup and spelling. 2009-01-10 22:48:12 +00:00
Tom Rhodes
514262dd44 A bit of rewording for clarity, taken from OpenBSD.
Submitted by:	jmc@OpenBSD.org
2009-01-10 12:47:22 +00:00
Ruslan Ermilov
83708764a7 Fix crash with "netstat -m -N foo".
PR:		bin/124724
MFC after:	3 days
2009-01-10 12:39:12 +00:00
David E. O'Brien
fa600cb9ba Note that r186713 also contained a change to VarAdd where we propagate the
newly created 'Var' back to the caller.
Also, back out an accidentally commented WIP comment.
2009-01-06 16:24:22 +00:00
Ulf Lilleengen
174eb94d2b Merge support for CVSMode (aka. mirror mode) into csup. This means csup can now
fetch a complete CVS repository. Support for rsync update of regular files are
also included, but are not yet enabled. The change should not have an impact on
existing csup usage, as little of the existing code has changed.
2009-01-05 15:18:16 +00:00
David E. O'Brien
eee3404481 + Add the -Q be-quiet flag for parallel jobs.
- Enable -Q by default for the moment - there is something weird
  going on in the rescue build.
2009-01-03 10:14:01 +00:00
Maxim Konovalov
f1c0a78d99 o With -L flag show unix sockets listen queues stats. It is useful
to know number of not accepted connections for monitoring purposes.

PR:		bin/128871
Submitted by:	Anton Yuzhaninov
MFC after:	1 month
2008-12-31 08:56:49 +00:00
Robert Watson
4fbcc986d9 Include param.h instead of types.h before mount.h so that the nested
include of param.h can be removed from audit.h.

MFC after:	3 weeks
2008-12-29 19:00:28 +00:00
Robert Watson
e1f323f350 Include param.h instead of types.h before user.h so that the nested
include of param.h can be removed from audit.h.

MFC after:	3 weeks
2008-12-29 18:58:22 +00:00
David E. O'Brien
78885448f1 1. Add the ability to tweak the token output before targets in job mode.
E.g.,  .MAKE.JOB.PREFIX=${.newline}---[${.MAKE.PID}]
   would produce

   ---[1234] target ---

2. Added ${.newline} as a simple means of being able to include '\n' in the
   assignment of .MAKE.JOB.PREFIX

Obtained from:	NetBSD
2008-12-29 10:26:02 +00:00
David E. O'Brien
cfd6aac638 Consistently use Var_SetGlobal(). 2008-12-29 08:05:49 +00:00
Tom Rhodes
610c7c3155 Fix up after last commit:
Bump doc date;
Kill hard sentence breaks;
Fix commas by moving them off their own line.
2008-12-27 00:17:41 +00:00
Luigi Rizzo
5e7fbb7b5e Clarify the behaviour of conditionals when dealing with comparisons.
In particular, point out that string comparison can only use != and ==
(how weird, given that the underlying call to strcmp returns more
information), that floating point values are correctly interpreted
as numbers, and that the left-hand side must be a variable expansion.

MFC after:	3 weeks
2008-12-26 22:31:45 +00:00
Rui Paulo
491c34ec7e Right align the CPU column header. 2008-12-26 11:11:30 +00:00
Maxim Konovalov
c0c6601311 o Fix grammar.
PR:		bin/129938
Submitted by:	Bruce Cran
2008-12-26 07:16:20 +00:00
Tom Rhodes
0d186272b4 Remove reference to unimplemented "-c" option.
PR:		119338
2008-12-25 08:48:08 +00:00
Tom Rhodes
c92f699693 Update the description of -k, output files appear to
be left regardless of an error, signal, or complete
run.

PR:		69861
Submitted by:	vlad902@gmail.com
2008-12-24 10:08:39 +00:00
Doug Barton
125f2ee5e9 Update bmake glue for changes in 9.4.3 2008-12-23 22:51:10 +00:00
Tom Rhodes
d31572b0b8 Add a basic manual page for elf2aout.
Alter Makefile and remove NO_MAN.

PR:	109975
2008-12-23 01:22:57 +00:00
Garrett Wollman
ba29aec0d3 Implement a new feature for the "-m" option: if the month number is
followed by 'f' or 'p', use the following or preceding month of that
number, respectively.  Document this.  Also includes other minor
grammatical and punctuation fixes to the manual page (capitalize
Easter, etc.).

MFC after:	1 month
2008-12-22 21:22:42 +00:00
Wesley Shields
d5db4444c3 Fix a typo.
Approved by:	rwatson
2008-12-19 16:56:49 +00:00
Joe Marcus Clarke
08afefa814 Do not segfault when procstat -f or procstat -v is called on a process not
owned by the current user.  If kinfo_getfile() or kinfo_getvmmap() return
NULL, simply exit, and do not try and derefernce the memory.

Reviewed by:	peter
Approved by:	peter
2008-12-19 06:50:15 +00:00
Max Khon
a8e17a098e Exit with error code 2 when run with -k (continue if errors) and build failed. 2008-12-18 12:16:51 +00:00
Murray Stokely
e8f612b687 1. Update fetch to consistently return 1 on error, as the man page states,
rather than usually returning 1 but in a few instances using a sysexits(3)
   return value.

2. Remove a few unused variables from libfetch.

PR:		docs/122470  (1, only)
Reviewed by:	des
2008-12-17 18:00:18 +00:00
Ruslan Ermilov
49f8bb9a95 Fix printing of shared memory limits.
MFC after:	3 days
2008-12-16 09:17:05 +00:00
Murray Stokely
7f92799f67 Add support for HTTP 1.1 If-Modified-Since behavior.
fetch(1) accepts a new argument -i <file> that if specified will cause
the file to be downloaded only if it is more recent than the mtime of
<file>.

libfetch(3) accepts the mtime in the url structure and a flag to
indicate when this behavior is desired.

PR:		bin/87841
Submitted by:	Jukka A. Ukkonen <jau@iki.fi> (partially)
Reviewed by:	des, ru
MFC after:	3 weeks
2008-12-15 08:27:44 +00:00
Qing Li
6e6b3f7cbc This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
   possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,

The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.

Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:

- Kip Macy revised the locking code completely, thus completing
  the last piece of the puzzle, Kip has also been conducting
  active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
  provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
  me maintaining that branch before the svn conversion
2008-12-15 06:10:57 +00:00
Tim Kientzle
5d42c42369 Spell "substitution" correctly.
PR:		bin/128616
Submitted by:	Jaakko Heinonen
Pointy hat:	Tim Kientzle
MFC after:	30 days
2008-12-15 06:00:25 +00:00
Ruslan Ermilov
e801aa4856 Improve usage and sync SYNOPSIS with usage. 2008-12-13 17:48:06 +00:00
Ruslan Ermilov
13546eccd5 Sync manpage's synopsis with program's usage().
Trim whitespace at EOL.
2008-12-13 15:44:29 +00:00
Dag-Erling Smørgrav
2b8907e7e2 Apply the same defaults to https as to http.
Submitted by:	Mike Tancsa <mike@sentex.net>
MFC after:	1 week
2008-12-11 06:54:36 +00:00
Konstantin Belousov
20e76cb365 Add strndup(3) prototype to string.h.
This change was erronously ommitted from the r185690, and attempt
to simply add the prototype to string.h has revealed that several
contributed programs defined local prototypes for strndup(), controlled
by autoconfed config.h. So, manually change #undef HAVE_STRNDUP to
#define HAVE_STRNDUP 1. Next import of the corresponding program would
regenerate config.h, overriding the changes in this commit.

No objections from: kan
2008-12-08 21:04:24 +00:00
Giorgos Keramidas
f45dd01002 Add a -L option to wc(1), for finger compatibility with the GNU
wc utility.  The -L option can be used to report the length of
the longest line wc has seen in one or more files.  It is
disabled by default, and wc uses the standard `-lwc'.

Submitted by:	Sheldon Givens, sheldon at sigsegv.ca
Reviewed by:	kib
MFC after:	1 week
2008-12-06 19:21:56 +00:00
Tim Kientzle
2c2029ada9 bsdtar is synced up with 2.5.903a 2008-12-06 07:38:14 +00:00
Tim Kientzle
286e81aeb0 bsdtar always supports long options now, so we can remove
a documentation disclaimer.
2008-12-06 07:37:55 +00:00
Tim Kientzle
d47cf339f4 Only use GCC-specific __dead2 marker when building with GCC. 2008-12-06 07:37:14 +00:00
Tim Kientzle
4b058a88d8 Custom command line parser for cpio; this is a little more
code but should be a lot fewer cross-platform compatibility
headaches.
2008-12-06 07:30:40 +00:00
Tim Kientzle
5eca8160b5 Make the GCC-specific __dead2 markers conditional on whether
we're compiling under GCC.
2008-12-06 07:15:42 +00:00
Peter Wemm
41fbf4374b Update format string for kve_start/end. 2008-12-02 15:08:33 +00:00
Peter Wemm
43151ee6cf Merge user/peter/kinfo branch as of r185547 into head.
This changes struct kinfo_filedesc and kinfo_vmentry such that they are
same on both 32 and 64 bit platforms like i386/amd64 and won't require
sysctl wrapping.

Two new OIDs are assigned.  The old ones are available under
COMPAT_FREEBSD7 - but it isn't that simple.  The superceded interface
was never actually released on 7.x.

The other main change is to pack the data passed to userland via the
sysctl.  kf_structsize and kve_structsize are reduced for the copyout.
If you have a process with 100,000+ sockets open, the unpacked records
require a 132MB+ copyout.  With packing, it is "only" ~35MB.  (Still
seriously unpleasant, but not quite as devastating).  A similar problem
exists for the vmentry structure - have lots and lots of shared libraries
and small mmaps and its copyout gets expensive too.

My immediate problem is valgrind.  It traditionally achieves this
functionality by parsing procfs output, in a packed format.  Secondly, when
tracing 32 bit binaries on amd64 under valgrind, it uses a cross compiled
32 bit binary which ran directly into the differing data structures in 32
vs 64 bit mode.  (valgrind uses this to track file descriptor operations
and this therefore affected every single 32 bit binary)

I've added two utility functions to libutil to unpack the structures into
a fixed record length and to make it a little more convenient to use.
2008-12-02 06:50:26 +00:00
Tim Kientzle
5157f46024 Format the output of -itv for real. In particular:
* Lookup uname/gname if not provided by the archive (I copied the
   uname/gname lookup cache from bsdtar)
 * Format device number instead of size for device nodes
 * Format date.

There's still a few improvements that I could copy from
bsdtar, especially the locale-aware safe_fprintf() code
and the locale-aware setup for day_first date formatting.
(And, of course, I need to think through a clean way to
push this stuff down into libarchive.)

Thanks to Peter Wemm for reminding me of this overlooked TODO item.
2008-11-29 20:22:02 +00:00
Tim Kientzle
5af3583731 When deciding which characters (of a filename, for instance)
are safe to print, try to take into account the current locale.
This iterates over output strings using mbtowc() to identify
multi-byte sequences.  If iswprint() claims the corresponding
wide character is printable, the original bytes are passed
through.  Otherwise, we expand characters into C-style
\-escape sequences.

Submitted by:	Michihiro NAKAJIMA
MFC after:	30 days
2008-11-29 20:06:53 +00:00
Bjoern A. Zeeb
413628a7e3 MFp4:
Bring in updated jail support from bz_jail branch.

This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..

SCTP support was updated and supports IPv6 in jails as well.

Cpuset support permits jails to be bound to specific processor
sets after creation.

Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.

DDB 'show jails' command was added to aid debugging.

Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.

Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.

Bump __FreeBSD_version for the afore mentioned and in kernel changes.

Special thanks to:
- Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches
  and Olivier Houchard (cognet) for initial single-IPv6 patches.
- Jeff Roberson (jeff) and Randall Stewart (rrs) for their
  help, ideas and review on cpuset and SCTP support.
- Robert Watson (rwatson) for lots and lots of help, discussions,
  suggestions and review of most of the patch at various stages.
- John Baldwin (jhb) for his help.
- Simon L. Nielsen (simon) as early adopter testing changes
  on cluster machines as well as all the testers and people
  who provided feedback the last months on freebsd-jail and
  other channels.
- My employer, CK Software GmbH, for the support so I could work on this.

Reviewed by:	(see above)
MFC after:	3 months (this is just so that I get the mail)
X-MFC Before:   7.2-RELEASE if possible
2008-11-29 14:32:14 +00:00
George V. Neville-Neil
94f138fe60 Fix a printing problem when using the -L flag to netstat caused
by adding the -x flag earlier.

Submitted by:	Anton Yuzhaninov
MFC after:	3 days
2008-11-28 18:35:14 +00:00
Tim Kientzle
2f01c75815 After visiting a subdirectory, we use chdir("..") or
fchdir() to return back to the parent.  If those fail,
we're just dead in the water.  Add a new error value
TREE_ERROR_FATAL to indicate that directory traversal
cannot continue.  Have write.c honor that by exiting
immediately.

MFC after:	30 days
2008-11-27 05:49:52 +00:00
Tim Kientzle
e4504a7d06 If we're unable to chdir() to a directory that we know exists,
that should result in a non-zero return value.

In particular, this should address the issue that David Wolfskill
ran into with a somewhat flaky NFS mount resulting in a damaged
archive even though tar returned success.

MFC after:	4 days
2008-11-27 05:14:36 +00:00
Ulf Lilleengen
8658b90899 - Add missing rsyncfile from Makefile 2008-11-23 19:43:45 +00:00
Xin LI
5c13cfe080 Use strlcpy() where appropriate. 2008-11-19 00:14:15 +00:00
Roman Divacky
257072a6dd ANSIfy the wwend function.
Approved by:	kib (mentor)
2008-11-18 21:06:49 +00:00
Peter Holm
21543d8055 Add myself
Approved by:	kib (mentor)
2008-11-18 14:05:11 +00:00
Pawel Jakub Dawidek
1ba4a712dd Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.
This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

	Allows regular users to perform ZFS operations, like file system
	creation, snapshot creation, etc.

- L2ARC

	Level 2 cache for ZFS - allows to use additional disks for cache.
	Huge performance improvements mostly for random read of mostly
	static content.

- slog

	Allow to use additional disks for ZFS Intent Log to speed up
	operations like fsync(2).

- vfs.zfs.super_owner

	Allows regular users to perform privileged operations on files stored
	on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

	Not all the flags are supported. This still needs work.

- ZFSBoot

	Support to boot off of ZFS pool. Not finished, AFAIK.

	Submitted by:	dfr

- Snapshot properties

- New failure modes

	Before if write requested failed, system paniced. Now one
	can select from one of three failure modes:
	- panic - panic on write error
	- wait - wait for disk to reappear
	- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

	Just quota and reservation properties, but don't count space consumed
	by children file systems, clones and snapshots.

- Sparse volumes

	ZVOLs that don't reserve space in the pool.

- External attributes

	Compatible with extattr(2).

- NFSv4-ACLs

	Not sure about the status, might not be complete yet.

	Submitted by:	trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from:	OpenSolaris
2008-11-17 20:49:29 +00:00
Diomidis Spinellis
46da6c4869 Fix the code to conform to the "or more" part of the following POSIX
specification and regression test regress:25.

  "A function can be preceded by one or more '!' characters, in which
  case the function shall be applied if the addresses do not select
  the pattern space."

MFC after:	2 weeks
2008-11-11 17:15:57 +00:00
Tim Kientzle
8666079cdb Include more detailed explanation of this case, since it's pretty
subtle why it comes out the way it does.  Once you realize that it
depends on the archiving order, it's also important to realize that
filesystem differences aren't going to break this case.  (Some of the
other tests have had to be extensively rewritten to make them
independent of the order in which a particular filesystem returns file
entries.)

(This commit also serves to note the PR number that I accidentally
omitted from the previous commit.)

PR:		bin/128562
MFC after:	30 days
2008-11-10 05:24:13 +00:00
Tim Kientzle
c4a52c7226 Test --strip-components and fix it to actually work. Jaakko did a
good job writing this test; it exercises a lot of subtle cases.  The
trickiest one is that a hardlink to something that didn't get
extracted should not itself be extracted.  In some sense, this is not
the desired behavior (we'd rather restore the file), but it's the best
you can do in a single-pass restore of a tar archive.

The test here should be extended to exercise cpio and newc formats as
well, since their hardlink models are different, which will lead to
different handling of some of these edge cases.

Submitted by:	Jaakko Heinonen
MFC after:	30 days
2008-11-10 05:04:55 +00:00
Hiroki Sato
d3d0d3a3b5 Add workaround for a back reference when no corresponding
parenthesized subexpression is defined.  For example, the
following command line caused unexpected behavior like
segmentation fault:

 % echo test | sed -e 's/test/\1/'

PR:		bin/126682
MFC after:	1 week
2008-11-09 01:10:21 +00:00
Tim Kientzle
85ae3122e9 New command-line parser for bsdtar.
This replaces the getopt()/getopt_long() wrapper, the old-style
argument rewriter and the associated configuration glue with a more
straightforward custom command parser.  In particular, this ensures
that bsdtar will have consistent option parsing on every platform,
regardless of whether the platform supports getopt_long().

MFC after:	30 days
2008-11-08 04:43:24 +00:00
Max Laier
246b6a6d70 Restore (intmax_t) casts I lost during the last change & unbreak the build. 2008-11-06 23:55:28 +00:00
Max Laier
fd543f2759 Add two new options to du(1):
-A      Display the apparent size instead of the disk usage.  This can be
             helpful when operating on compressed volumes or sparse files.

     -B blocksize
             Calculate block counts in blocksize byte blocks.  This is differ-
             ent from the -k, -m options or setting BLOCKSIZE and gives an
             estimate of how much space the examined file hierachy would
             require on a filesystem with the given blocksize.  Unless in -A
             mode, blocksize is rounded up to the next multiple of 512.

The former is similar to GNU's du(1) --apparent-size.  The latter is
different from what GNU's du(1) -B does, which is equivalent to setting
BLOCKSIZE in our implementation and is rather pointless as it doesn't add
any real value (i.e. you can achieve the same with a simple awk-script).

No change in the normal output or processing.

Reviewed by:			keramida@, Peter French
Otherwise silience from:	freebsd-hackers@
2008-11-06 16:30:38 +00:00
Craig Rodrigues
c65e3b1854 Merge latest DTrace changes from Perforce.
Approved by:	jb
2008-11-05 19:39:37 +00:00
Tim Kientzle
025b20f6e5 When comparing, cast to the larger size, off_t in this case.
Once we know which one is smaller, then we cast to the smaller size.

Thanks to Xin Li (delphij@)
Pointy hat: /me
2008-11-05 06:40:53 +00:00
Tim Kientzle
f4e24c4e7a Fix compile warnings building on amd64. This is modified slightly
from Jaakko's original patch: I have misgivings about the portability
of the 'z' printf modifier so opted to cast the arguments to (int)
instead.

PR:		bin/128561
Submitted by:	Jaakko Heinonen
MFC after:	30 days
2008-11-05 05:26:11 +00:00
Max Laier
0551897af2 Declare functions and variables static and save a few byte. This is a
style(9)-change, too.  Separate commit as it changes the object.
2008-11-04 19:23:48 +00:00
Max Laier
40850176c9 style(9): mostly avoiding line wrap by not indenting cases. No obj change. 2008-11-04 19:17:32 +00:00
Giorgos Keramidas
e9d8f84b73 Fix comment typo that managed to sneak in when I copy pasted some
comments & code from iostat.
2008-11-04 18:20:54 +00:00
Giorgos Keramidas
4fb6032f19 Repeat vmstat header after window.rows instead of a hardcoded 20.
Use ioctl() to get the window size in vmstat(8), and force a new
header to be prepended to the output every time the current window
size changes.  Change the number of lines before each header to the
current lines of the terminal when the terminal is resized, so that
the full terminal length can be used for output lines.

Inspired by:	svn change 175562 (same feature for iostat)
Reviewed by:	ru (who fixed some of my bugs too)
MFC after:	1 week
2008-11-04 18:02:35 +00:00
Ulf Lilleengen
3d4e599494 - Import csup work from p4. 2008-10-19 09:08:59 +00:00
Ulf Lilleengen
fc84e5f31b - Import the Makefile from HEAD for building csup. 2008-10-19 08:43:16 +00:00
Ulf Lilleengen
d7f03759d5 - Import the HEAD csup code which is the basis for the cvsmode work. 2008-10-19 08:41:10 +00:00
Xin LI
1c10962832 Use strlcpy() when we mean it. 2008-10-17 21:14:50 +00:00
Poul-Henning Kamp
65a9b18218 Free old arrays if we increase them.
Pointed out by:	mlaier
2008-10-16 20:56:09 +00:00
Poul-Henning Kamp
c4f431a628 Make ministat(1) vastly faster on huge datasets. 2008-10-16 20:39:02 +00:00
Xin LI
1b0fa6fa40 ANSIfy, plus constify interfaces where possible. 2008-10-13 23:10:19 +00:00
Xin LI
3a4e1f4703 Use strlcpy() instead of strncpy() when we want the string to be
NUL-terminated.
2008-10-13 22:50:38 +00:00
John Baldwin
b2ce972537 Make the CPU column in top always be 2 characters and print in decimal
rather than hex.

Requested by:	rwatson
2008-10-01 22:01:07 +00:00
Andrey A. Chernov
a3d1e4d95a Since in some cases (when found obsolete) 'make' can be builded earlier
at 'upgrade_checks' target, put arc4random_uniform() into
__FreeBSD_version ifdef.
2008-09-29 16:13:28 +00:00
John Baldwin
338b0cb957 Support for CPU sets is going to appear in 7.1 before 8.0.
MFC after:	3 days
2008-09-29 15:44:48 +00:00
Marius Strobl
69e01db9cb Add back ar(1) which was accidentally decoupled in r183242.
Approved by:	sam
2008-09-24 20:41:35 +00:00
Sam Leffler
690f477d75 add new build knobs and jigger some existing controls to improve
control over the result of buildworld and installworld; this especially
helps packaging systems such as nanobsd

Reviewed by:	various (posted to arch)
MFC after:	1 month
2008-09-21 22:02:26 +00:00
Kai Wang
2529884112 Fix build. 2008-09-21 00:27:16 +00:00
Kai Wang
0c099281a3 Add support for option "-M", which is used to operate ar(1) in a
script mode like the MRI(Microtec Research Inc.) "librarian" program.

Originally this option is provided by Binutils ar(1) to ease the
transition for developers who are used to writing "librarian" scripts.

We added this option to BSD ar(1) because:

1. Further improve the compatibility with Binutils ar(1).
2. There are still a few software using this -M option. (at least one
in our ports collection)

Suggested by:	rink & erwin
2008-09-20 22:10:10 +00:00
Tim Kientzle
8cd2f9bcd0 Clean up flags support just a tad: FreeBSD support depends on
HAVE_STRUCT_STAT_ST_FLAGS, Linux support depends on the
existence of the appropriate ioctl() options.  In particular,
this should fix some nagging compile errors on Linux platforms
that don't have e2fsprogs-devel installed.
2008-09-14 03:49:00 +00:00
Tim Kientzle
1756b590c9 Test handling of restores relative to symlinks.
In particular:
  * tar -x -P follows symlinks to existing dirs, but not without -P
  * symlinks to files are always replaced
  * broken symlinks are always replaced
2008-09-14 02:16:04 +00:00
Stephane E. Potvin
c975a48dee Display the sum of the runtime of all the threads in a process when it's
multithreaded instead of picking the time of the first thread found.

Reviewed by:	jhb
Approved by:	kan (mentor)
MFC after:	1 month
2008-09-12 17:54:50 +00:00
Tim Kientzle
33cbc37d91 Don't destroy the archive until after you finish pulling useful
information out of it.  As reported by Giorgos Keramidas.
2008-09-04 05:20:46 +00:00
Ed Schouten
a583eb0809 Add support for RLIMIT_NPTS to limits(1).
After the MPSAFE TTY import we support an additional rlimit, called
RLIMIT_NPTS. This limit allows you to cap the amount of pseudo-terminals
allocated by one user.

We forgot to add support for this limit to limits(1), which means it
crashed. Add the proper bits to make it work like it should.
Unfortunately not all shells actually implement the RLIMIT, so
unfortunately I suspect it to be broken with certain shells.

Submitted by:	Yuriy Tsibizov <yuriy tsibizov gfk ru>
2008-09-02 19:13:24 +00:00
David E. O'Brien
47490ee583 Add gprof MIPS MD header and enable building gprof.
Obtained from:	Juniper Networks
2008-09-02 15:35:47 +00:00
Kevin Lo
4c6ea66f44 Use RUSAGE_SELF for the current process instead of hardcoded value 2008-09-02 02:59:38 +00:00
David E. O'Brien
668dbd57c1 Truss and gprof doesn't build for MIPS. 2008-09-01 18:03:09 +00:00
Yaroslav Tykhiy
db6fc08364 Correct a silly typo I introduced: withing -> within.
Noticed by:	das
2008-09-01 17:48:40 +00:00
David E. O'Brien
dd335a1577 Minimize changes CURRENT<->releng7. 2008-09-01 15:04:38 +00:00
Yaroslav Tykhiy
21be3b3183 pkill(1) first appeared in /usr/bin, but later it was moved to /bin
for the convenience of rc.d.  Now it has happily lived there for quite
a while.  So move the pkill(1) source files from usr.bin to bin, too.

Approved by:	gad
2008-08-31 14:27:59 +00:00
Rui Paulo
4816ba93ac Add ECN stats. 2008-08-26 15:12:29 +00:00
Tim Kientzle
0f5e12d1d9 MfP4: Verify correct interaction with umask: Add another
file with different permissions and set a non-zero umask
during the actual copy tests.  The extra entry increases
the size of the test archives of course, so adjust the
expected sizes.
2008-08-25 06:39:29 +00:00
Yaroslav Tykhiy
625451f9f4 Explicitly tell that one needs to start a context address with a
backslash if he/she wants to use a non-traditional delimiter, i.e.,
anything other than a slash.  That is, /abc/ works as is, but xabcx
needs to be spelled as \xabcx.

Add appropriate markup.

Bump Dd.

Checked with:	IEEE Std 1003.1, 2004 Edition
MFC after:	3 days
2008-08-24 13:47:53 +00:00
Tim Kientzle
3269dc16fd Update the total archive byte counters when writing entries to disk using
archive_write_disk.
Update cpio to use this to emit block counts in -p mode.
Update cpio tests to verify these block counts.
2008-08-24 06:21:00 +00:00
Tim Kientzle
21353e7f83 straighten out the "clean" target 2008-08-24 05:49:36 +00:00
Tim Kientzle
47317d6e6d cpio -v emits a line for every item copied. 2008-08-24 05:40:42 +00:00
Tim Kientzle
631631e45b Update the passthrough_dotdot test to reproduce a
problem reported by Kris Kennaway.

PR:		bin/124924
2008-08-24 05:24:52 +00:00
Tim Kientzle
ea66e24484 Test for proper handling of "cpio -p .."
PR:		bin/124924
2008-08-24 05:14:03 +00:00
Tim Kientzle
c9c5c49045 Test for a bug reported by Bernd Walter: In passthrough mode,
copying "dir/file" and then copying "dir" results in
"File on disk is not older; skipping" for the "dir" because
it was implicitly created by "dir/file."  Among other sins,
this means that "dir" ends up with the wrong permissions
and ownership.

This is actually a libarchive bug; fix is forthcoming.
2008-08-24 04:58:22 +00:00
Tim Kientzle
5d5624c080 Comment a couple of places where bsdcpio and gcpio 2.9 disagree.
The number of blocks read from ustar archives is just an implementation
difference.  The failure of bsdcpio to emit a block count to stderr
in -p mode is a real bug in bsdcpio.
2008-08-22 02:27:06 +00:00
Tim Kientzle
643cd4ffe7 The newc-format verification is now a little smarter about
following the archive structure.  In particular, it no longer
crashes if you run it against GNU cpio 2.9 (although it does
still complain a lot more than it should).
2008-08-22 02:09:10 +00:00
Tim Kientzle
83cb61fa3a Minor cleanup of the -q test: Assert that stdout/stderr are empty for each
extraction.
2008-08-22 01:35:08 +00:00
Tim Kientzle
ca926f6fbd Don't clean before running tests. 2008-08-22 01:31:13 +00:00
Tim Kientzle
ba1a633912 Explain how the test_option_q test works. 2008-08-22 01:26:55 +00:00
Tim Kientzle
3873424684 Test for -q (aka --fast-read).
Fix the error uncovered by this test.
2008-08-22 01:22:55 +00:00
Tim Kientzle
b1feec2392 The results for test 2 here are short enough to just be included inline.
There's no need to go through the hassle of having a checked-in uuencoded
reference file for comparison.
2008-08-21 22:28:00 +00:00
David E. O'Brien
8acee1c0ca Use the SCHEME_ knobs rather than knowing what they expand to.
Reviewed by:	des
2008-08-21 14:12:34 +00:00
David Malone
7f15c32d76 Lockf was exiting with status 1 if the command did not exit normally.
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.

MFC after:	1 month
2008-08-21 07:36:17 +00:00
Tim Kientzle
503b743566 Add some more tests to verify that "./foo" matches "foo" but "/foo" does not. 2008-08-21 07:04:57 +00:00
Tim Kientzle
e0e53b4111 Always display the unedited pathname in -t output.
I would like to provide a way to preview the effects of pathname edits,
but pattern selection has to happen against the unedited path, so it
seems that we have to show people the unedited path to help in
designing selection patterns.
2008-08-21 06:41:14 +00:00
Tim Kientzle
630d7662c3 cpio should restore file flags and ACLs when they're available 2008-08-20 16:39:18 +00:00
Andrey A. Chernov
e39ee4216c w(1) uses strftime %b with to print the abbreviated month name
if a user logged in more than a week ago.
This may contain multibyte characters (e.g. when using UTF-8).
This string is then aligned on byte-length rathern than char-length,
resulting in misalignment and unfinished multibyte characters.

PR:             126657
Submitted by:   Johan van Selst <johans@stack.nl>
2008-08-20 12:32:19 +00:00
Ed Schouten
bc093719ca Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

  The old TTY layer has a driver model that is not abstract enough to
  make it friendly to use. A good example is the output path, where the
  device drivers directly access the output buffers. This means that an
  in-kernel PPP implementation must always convert network buffers into
  TTY buffers.

  If a PPP implementation would be built on top of the new TTY layer
  (still needs a hooks layer, though), it would allow the PPP
  implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

  With the old TTY layer, it isn't entirely safe to destroy TTY's from
  the system. This implementation has a two-step destructing design,
  where the driver first abandons the TTY. After all threads have left
  the TTY, the TTY layer calls a routine in the driver, which can be
  used to free resources (unit numbers, etc).

  The pts(4) driver also implements this feature, which means
  posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

  One of the major improvements is the per-TTY mutex, which is expected
  to improve scalability when compared to the old Giant locking.
  Another change is the unbuffered copying to userspace, which is both
  used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from:		//depot/projects/mpsafetty/...
Approved by:		philip (ex-mentor)
Discussed:		on the lists, at BSDCan, at the DevSummit
Sponsored by:		Snow B.V., the Netherlands
dcons(4) fixed by:	kan
2008-08-20 08:31:58 +00:00