brooks [Tue, 15 Jan 2013 16:41:52 +0000 (16:41 +0000)]
MFC r244557:
Add libnetbsd, a thin compatibility layer intended to allow a limited
set of NetBSD software to compile as part of the FreeBSD build with
little or no modification. It is built as a static library and not
installed for general use. Likewise, its header files are not
installed.
bapt [Tue, 15 Jan 2013 09:14:18 +0000 (09:14 +0000)]
MFC r244553,244594,244608,244639
In preparation for making 'pkg -N' the one true method of determining
whether a system has been configured to use pkgng, cause /usr/sbin/pkg
recognise a -n option and exit with a failure code when the pkg port
is not installed
dim [Tue, 15 Jan 2013 07:41:50 +0000 (07:41 +0000)]
Revert the MFC to sys/dev/ath/ath_hal/ar9002/ar9285_attach.c again,
since it does not compile on stable/9. During testing, I had a
different local fix, so I failed to notice this did not work. Apologies
for the breakage.
brooks [Mon, 14 Jan 2013 22:00:43 +0000 (22:00 +0000)]
MFC r244401,245305,245308:
Replace our implementation of the vis(3) and unvis(3) APIs with
NetBSD's. This output size limited versions of vis and unvis functions
as well as a set of vis variants that allow arbitrary characters to be
specified for encoding.
Finally, MIME Quoted-Printable encoding as described in RFC 2045 is
supported.
dim [Mon, 14 Jan 2013 20:26:50 +0000 (20:26 +0000)]
Use a direct commit to fix a minor mistake in r245431, before it spreads
too far: use the correct FreeBSD version in clang's target triple. That
is, $ARCH-unknown-freebsd9.1 instead of $ARCH-unknown-freebsd9.2.
This will be bumped again for the 9.2 release, when it branches off.
zont [Mon, 14 Jan 2013 10:58:55 +0000 (10:58 +0000)]
MFC r244384:
- Fix locked memory accounting for maps with MAP_WIREFUTURE flag.
- Add sysctl vm.old_mlock which may turn such accounting off.
MFC r244385:
- Add sysctl to allow unprivileged users to call mlock(2)-family system
calls and turn it off for compatibility.
- Do not allow to call them inside jail.
zont [Mon, 14 Jan 2013 10:58:20 +0000 (10:58 +0000)]
MFC r244383:
- Set memorylocked limit to 64Kb for default login class.
This prevents unprivileged users to lock too much memory.
- Set memorylocked limit to 64Mb for daemon login class.
Some daemons such as amd(8) and watchdogd(8) calls mlockall(2) on
startup, they are run from init(8) which uses daemon login class.
- Set memorylocked limit to unlimited for root login class.
bapt [Sun, 13 Jan 2013 22:37:45 +0000 (22:37 +0000)]
MFC: r243883
if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead
of pkgbeta.FreeBSD.org
dim [Sun, 13 Jan 2013 20:35:08 +0000 (20:35 +0000)]
MFC r245272:
Add an ugly hack to libgcc's unwind code, to make it behave properly at
runtime on amd64, when it is compiled by clang. Some versions of clang
don't save and restore all callee registers, if a __builtin_eh_return()
intrinsic is used in a function. This is particularly bad on amd64.
Until the problem gets fixed by upstream, use an asm statement to force
clang to assume the registers in question are clobbered, when invoking
__builtin_eh_return(), so it will emit code to save and restore them.
This should fix the crashes reported on -current with some C++ programs,
particularly those that throw exceptions over multiple function
boundaries.
markj [Sun, 13 Jan 2013 04:14:46 +0000 (04:14 +0000)]
MFC r244995 r244996 r244997.
MFC r244995:
Fix a typo in an error message.
MFC r244996:
Have -n imply -r, since dry-run mode obviously doesn't require root
privileges.
MFC r244997:
Make sure to update the mtime of a logfile after archiving it. This
ensures that the next rotation happens at the correct time when using
interval-based rotations.
markj [Sun, 13 Jan 2013 04:13:45 +0000 (04:13 +0000)]
MFC r244719:
Add the NO_SYNC_CACHE quirk for all Apple USB MSC devices, as they
typically do not handle the SYNCHRONIZE_CACHE command - they either
return an error or the firmware enters a reset loop.
pfg [Sun, 13 Jan 2013 01:26:50 +0000 (01:26 +0000)]
ext2fs: cleanup the dinode structure.
It was plagued with style errors and the offsets had been lost.
While here took the time to update the fields according to the
latest ext4 documentation.
kib [Sun, 13 Jan 2013 00:46:39 +0000 (00:46 +0000)]
MFC r245262:
When nullfs mount is forcibly unmounted and nullfs vnode is reclaimed,
get back the leased write reference from the lower vnode. There is no
other path which can correct v_writecount on the lowervp.
kib [Fri, 11 Jan 2013 05:39:17 +0000 (05:39 +0000)]
MFC r244925:
Add yet another flag for the vfs_write_resume_flags() to avoid calling
suspension cleanup handler after the suspend is lifted, and use it in
the ffs_snapshot() call to vfs_write_resume.
kib [Fri, 11 Jan 2013 05:35:04 +0000 (05:35 +0000)]
MFC r244795:
Make it possible to atomically resume writes on the mount and account
the write start, by adding a variation of the vfs_write_resume(9) which
accepts flags.
Use the new function to prevent a deadlock between parallel suspension
and snapshotting a UFS mount.
wblock [Thu, 10 Jan 2013 23:06:32 +0000 (23:06 +0000)]
MFC r245012:
Document the output of the show command. Modified version of patch
provided by Bas Smeelen <b.smeelen@ose.nl>. Use of 'gpart list'
suggested by by Andrey V. Elsukov <ae@FreeBSD.org>.
brooks [Thu, 10 Jan 2013 22:15:13 +0000 (22:15 +0000)]
MFC r241731:
Replace our version of the pwcache(3) API with NetBSD's implementation.
This adds two features:
* uid_from_user() and gid_from_group() as the reverse of user_from_uid()
and groups_from_gid().
* pwcache_userdb() and pwcache_groupdb() which allow alternative lookup
functions to be used. For example lookups from passwd and group
databases in a non-standard location.
yongari [Tue, 8 Jan 2013 05:34:17 +0000 (05:34 +0000)]
MFC r244341:
Make sure to stop both TX and RX MACs in ale_stop_mac(). Previously
it used to stop TX MAC only such that MAC reconfiguration after
getting a link didn't work as expected.
rmacklem [Sun, 6 Jan 2013 01:41:14 +0000 (01:41 +0000)]
MFC: r244604, r244638, r245014
It was reported via email that some sshds create kerberos
credential cache files with names other than /tmp/krb5cc_<uid>.
The gssd daemon does not know how to find these credential caches.
This patch implements a new option "-s" that does a search for
credential cache files, using roughly the same algorithm as the
gssd daemon for Linux uses. The gssd behaviour is only changed
if the new "-s" option is specified.
rmacklem [Sun, 6 Jan 2013 00:38:25 +0000 (00:38 +0000)]
MFC: r244690
Attempt to clarify that for ZFS, all file systems under
the NFSv4 root must be exported. This is because ZFS
checks exports itself.
This is a content change.
rmacklem [Sun, 6 Jan 2013 00:35:10 +0000 (00:35 +0000)]
MFC: r244689
Attempt to clarify that for ZFS, all file systems under
the NFSv4 root must be exported. This is because ZFS
checks exports itself.
This is a content change.
markj [Sat, 5 Jan 2013 22:55:08 +0000 (22:55 +0000)]
- Add IFT_L2VLAN (vlan(4)) support.
- Add a -P option to support PID files. When -a is specified
/var/run/rarpd.pid is used by default, and when an interface is
specified /var/run/rarpd.<ifname>.pid is used by default.
MFC r244439:
The selectroute function does own account of EHOSTUNREACH errors,
no need to do it twice.
MFC r244440:
Make dst_sa initialization only when it is actually needed.
MFC r244441:
When we have some address to forward (e.g. it was specified with ipfw fwd),
we should pass it as first argument into in6_selectroute_fib function to
initiate new route lookup.
Disallow attaching preloaded memory disks via ioctl.
- The feature is dangerous because the kernel code didn't check
validity of the memory address provided from user space.
- It seems that mdconfig(8) never really supported attaching preloaded
memory disks.
- Preloaded memory disks are automatically attached during md(4)
initialization. Thus there shouldn't be much use for the feature.
pfg [Fri, 4 Jan 2013 04:03:21 +0000 (04:03 +0000)]
MFC r244941:
libedit: bind the correct command when using "bind -k".
"ed-argument-digit" (i. e. command 0) was incorrectly used
instead.
This bug comes from the original sources imported in 1994
and has been confirmed in upstream NetBSD.
Reported by: Yamagi Burmeister
Submitted by: Christoph Mallon
pfg [Fri, 4 Jan 2013 03:54:05 +0000 (03:54 +0000)]
MFC 244776, 244792:
gcc: avoid generating negative values to DW_AT_byte_size.
There is a bug in gcc (GCC/35998) where dwarf reports
sizes of unsigned -1 (0xffffffff).
On NetBSD this generated a faulty CTF entry which then
caused a segfault in ctfmerge. The issue was worked
around in NetBSD's Dtrace but since the issue originated
in gcc, it seems reasonable to fix it here.
Thanks to Christoph Mallon for pointing out a correct fix.
rmacklem [Thu, 3 Jan 2013 23:15:36 +0000 (23:15 +0000)]
MFC: r244370
Piete.Brooks at cl.cam.ac.uk reported via email a crash which was
caused by use of an invalid kgss_gssd_handle during an upcall to
the gssd daemon when it has exited. This patch seems to avoid the
crashes by holding a reference count on the kgss_gssd_handle until
the upcall is done. It also adds a new mutex kgss_gssd_lock used to
make manipulation of kgss_gssd_handle SMP safe.
rmacklem [Thu, 3 Jan 2013 23:09:16 +0000 (23:09 +0000)]
MFC: r244331
Fix the gssd daemon so that it uses syslog() to report
an error instead of calling err() when it is daemonized,
so that the error gets logged.
wblock [Thu, 3 Jan 2013 21:31:57 +0000 (21:31 +0000)]
MFC r242697,r242704:
r242697:
Add devd.conf(5) and devd(8) to SEE ALSO xrefs. Give users a pointer to
seemingly mysterious actions that are not done by ifconfig itself, but
by devd triggering on events caused by ifconfig.
r242704:
Remove fifteen-year-old notes on media selection (suggested by simon@).
Add commas after "e.g." and "i.e.".
delphij [Tue, 1 Jan 2013 07:00:42 +0000 (07:00 +0000)]
MFC r244369 (jimharris):
Use CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT to report nonexistent
LUNs for the virtual processor device. This removes lots of CAM warnings,
and follows similar recent changes to tws(4) and twa(4) drivers.
Also fix case where CAM_REQ_CMP was getting OR'd with CAM_DEV_NOT_THERE
in the nonexistent LUN case, resulting in different CAM status (CAM_UA_TERMIO)
getting reported to CAM. This issue existing previously, but was more subtle
because it changed CAM_SEL_TIMEOUT to CAM_CMD_TIMEOUT.
Sponsored by: Intel
Reported and tested by: Willem Jan Withagen <wjw@digiware.nl>
dim [Mon, 31 Dec 2012 14:21:31 +0000 (14:21 +0000)]
MFC r244600:
Fix a bug in ld --gc-sections: it strips out .note sections, while it
should never do so. This can cause global constructors and destructors
to not be executed at run-time, resulting in crashes and other strange
behaviour.
markj [Mon, 31 Dec 2012 03:34:52 +0000 (03:34 +0000)]
MFC 244523:
- Make sure that errno isn't modified before calling logerror() in error
conditions.
- Don't check for AF_INET6 when compiled without INET6 support.
gshapiro [Sat, 29 Dec 2012 19:06:04 +0000 (19:06 +0000)]
MFC: Properly define true/false when defining __bool_true_false_are_defined
for filters which pull in mfapi.h before stdbool.h. Issue reported by
Petr Rehor, maintainer of amavisd-milter port.
rmacklem [Fri, 28 Dec 2012 14:06:49 +0000 (14:06 +0000)]
MFC: r244226
The group list for a non-default export entry (a host/subnet one)
was being copied from the wrong place. This patch fixes that.
This could cause access failures for mapped users, when the group
permissions were needed.
PR: 147998
Submitted by: Christopher Key (cjk32@cam.ac.uk)
ume [Fri, 28 Dec 2012 10:58:03 +0000 (10:58 +0000)]
MFC r244770: Fix location of /var/audit/dist and /var/audit/remote.
Note that those who did installworld after r244398 should remove
wrongly created /var/dist and /var/remote.
pfg [Tue, 25 Dec 2012 17:39:37 +0000 (17:39 +0000)]
MFC r244475:
More constant renaming in preparation for newer features.
We also try to make better use of the fs flags instead of
trying adapt the code according to the fs structures. In
the case of subsecond timestamps and birthtime we now
check that the feature is explicitly enabled: previously
we only checked that the reserved space was available and
silently wrote them.
This approach is much safer, especially if the filesystem
happens to use embedded inodes or support EAs.
kib [Mon, 24 Dec 2012 13:29:22 +0000 (13:29 +0000)]
MFC r242476:
The r241025 fixed the case when a binary, executed from nullfs mount,
was still possible to open for write from the lower filesystem. There
is a symmetric situation where the binary could already has file
descriptors opened for write, but it can be executed from the nullfs
overlay.
Handle the issue by passing one v_writecount reference to the lower
vnode if nullfs vnode has non-zero v_writecount.
kib [Mon, 24 Dec 2012 13:22:32 +0000 (13:22 +0000)]
MFC r241025:
Fix the mis-handling of the VV_TEXT on the nullfs vnodes.
Add a set of VOPs for the VV_TEXT query, set and clear operations,
which are correctly bypassed to lower vnode.