Commit graph

5772 commits

Author SHA1 Message Date
Bryan Drewery eed74b2360 Always install pkg.conf. Don't depend on MK_PKGBOOTSTRAP.
This file is used by pkg(8) from ports as well. Someone may
choose to not install pkg(7) but still want to consume
official packages by building or installing pkg(8) manually.

Discussed with:	bapt
MFC after:	1 day (Working on EN)
2014-04-13 20:21:56 +00:00
Devin Teske 99082d19f1 Loosen the processing of *_IF_aliasN vars to be less strict. Previously,
the first alias had to be _alias0 and processing stopped at the first non-
defined variable (preventing gaps). Allowing gaps gives the administrator
the ability to group aliases in an adhoc manner and also lifts the
requirement to renumber aliases simply to comment-out an existing one.
Aliases are processed in numerical ascending order.

Discussed on:	-rc
MFC after:	1 week
2014-04-07 22:40:29 +00:00
Julio Merino 912eec3015 Add atf m4 files from the vendor branch.
These were originally deleted as "not important" but, actually we need them
in place if we want to be able to use autoconf on software that provides
atf-based tests.  (That includes being able to rebuild autotest from scratch
on the Kyua cluster machines, as the automated setup does.)
2014-04-01 13:47:08 +00:00
Bryan Drewery f9374f0724 Give hint on how to disable the default repository.
Discussed with:	bapt
MFC after:	instantly (preparing EN)
2014-03-30 15:24:17 +00:00
Mateusz Guzik ee38f2e004 Update userspace users of hw.bus.devctl_disable.
This fixes breakage resulting from r263754.

Reported by:	AN <andy@neu.net>
Reviewed by:	imp
Pointy hat to:	me
2014-03-26 02:25:40 +00:00
Alan Somers f227705fdb Add several ATF tests that deal with multiple fibs. They're described in
several different PRs, but the tests share some common code, so I'm
committing them together.

sbin/ifconfig/tests
sbin/ifconfig/tests/fibs_test.sh
sbin/ifconfig/tests/Makefile
sbin/ifconfig/Makefile
	Add fibs_test.sh, which regresses bin/187551

tests/sys/netinet
tests/sys/netinet/fibs_test.sh
tests/sys/netinet/udp_dontroute.c
tests/sys/netinet/Makefile
tests/sys/Makefile
	Add fibs_test.sh, which regresses kern/167947, kern/187552
	kern/187549, kern/187550, and kern/187553

etc/mtree/BSD.tests.dist
	Add newly created directories

PR:		bin/187551
PR:		kern/167947
PR:		kern/187552
PR:		kern/187549
PR:		kern/187550
PR:		kern/187553
Discussed with:	melifaro
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corporation
2014-03-20 20:39:41 +00:00
Julio Merino 65c3cfc1aa Migrate tools/regression/usr.bin/pkill to the new tests layout.
Interestingly, the pkill tool lives in bin, not usr.bin.  Haven't bothered
to check if this is because the tool moved or because the tests were
originally added in the wrong place.
2014-03-19 12:46:04 +00:00
Julio Merino d525bcd959 Migrate tools/regression/usr.bin/make/ to the new tests layout.
Note that these tests are for fmake, not bmake, and thus they are not
installed nor run when bmake is selected (the default).  Yes, I have
wasted a *ton* of time on moving tests for no real reason other than
ensuring they are not left behind.

But maybe, just maybe, it was not work in vain: the majority of these
tests also work with bmake and the few that don't may point at broken
stuff.  For example, the tests for the "archive" feature do not work
with bmake, but bmake's manpage and source tree seem to imply that they
should.  So... to be investigated later; need to poke sjg@.
2014-03-19 12:29:20 +00:00
Julio Merino f743627b41 Expand tabs that sneaked in into spaces.
Problem introduced by r263227.  Spotted by Alan Somers.
2014-03-19 12:06:51 +00:00
Julio Merino 3a92d97ff0 Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
2014-03-16 08:04:06 +00:00
Julio Merino d14afb2adc Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout.
This change was originally going to only migrate the usr.sbin tests but, as
it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/
so it's better to just also migrate the latter at the same time.  The other
usr.bin tests will be moved separately.

To make these tests work within the test suite, some of them have required
changes to prevent modifying the source directory and instead just rely on
the current directory for file manipulation.
2014-03-16 04:09:22 +00:00
Julio Merino c68de7484a Migrate tools/regression/sbin/ to the new tests layout.
Pretty much all that this change does is shuffles the code around and hooks
it into the regular build.  The code of the old tests has not changed.
2014-03-16 02:07:08 +00:00
Gleb Smirnoff 45c203fce2 Remove AppleTalk support.
AppleTalk was a network transport protocol for Apple Macintosh devices
in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was
a legacy protocol and primary networking protocol is TCP/IP. The last
Mac OS X release to support AppleTalk happened in 2009. The same year
routing equipment vendors (namely Cisco) end their support.

Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 06:29:43 +00:00
Gleb Smirnoff 2c284d9395 Remove IPX support.
IPX was a network transport protocol in Novell's NetWare network operating
system from late 80s and then 90s. The NetWare itself switched to TCP/IP
as default transport in 1998. Later, in this century the Novell Open
Enterprise Server became successor of Novell NetWare. The last release
that claimed to still support IPX was OES 2 in 2007. Routing equipment
vendors (e.g. Cisco) discontinued support for IPX in 2011.

Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
2014-03-14 02:58:48 +00:00
Baptiste Daroussin 2c4c3f6750 Add a mailer.conf example to use dma 2014-03-10 14:36:27 +00:00
Marcel Moolenaar bc0770d707 Change the terminal type/class for enabled serial lines to 3wire. This
allows us to change the uart(4) driver to not hardcode specific line
settings for the serial console.

A terminal type of 3wire makes sure the console still works when no DCD
signal is present, which preserves behviour. When it is known that the
terminal server (or DCE in general) provides DCD, a terminal type/class
of std can be used. This has the effect of being logged out when one
disconnects from the console -- improving security overall.

Likewise, when uart(4) does not fixate the baudrate, one can change
the terminal type/class to set a specific baudrate. An operator can use
this to change the console speed mid-flight, without needing a reboot.
Of course it helps in this respect if and when the firmware can be
configured from the OS.

The above mentioned capabilities depend on uart(4) being changed, which
is to happen next.
2014-03-09 21:06:22 +00:00
Marcel Moolenaar 489dd78441 Add 3wire and std as terminal types/classes. These are similar to
the existing terminal types/classes that have the baudrate suffix,
but differ in that no baudrate is set/defined.

The purpose of these new types/classes is to allow them to be used
for the serial console. Currently the uart(4) driver fixates the
baudrate and the CLOCAL flag, which means that it doesn't matter
whether you give it std.<baud> or 3wire.<baud> as the terminal type
to getty and what exactly <baud> is set to. It's being overridden
by uart(4). The goal is to change uart(4) not to override these
settings.
2014-03-09 20:51:14 +00:00
Alexander Motin ea9ed3d85b Disable libwrap (TCP wrappers) support in rpcbind by default, introducing
new command line options -W, to enable it when needed.

On my tests this change by almost ten times improves rpcbind performance.

No objections:	many, net@
2014-03-06 17:33:27 +00:00
Baptiste Daroussin 6a54f620e5 Rename WITHOUT_DMA into WITHOUT_DMAGENT to avoid confusion
Requested by:	ian
2014-02-22 13:05:23 +00:00
Baptiste Daroussin a1bf0ec834 Install a default configuration file for dma
Suggested by:	flo
2014-02-21 21:02:19 +00:00
Baptiste Daroussin 63aed9d0c7 Fix typo 2014-02-21 10:34:59 +00:00
Baptiste Daroussin a9e8641da9 Import Dragonfly Mail Agent into base system
It is a small and lightweight Mail Transport Agent.
It accepts mails from locally installed Mail User Agents (MUA) and delivers the
mails either locally or to a remote destination. Remote delivery includes
several features like TLS/SSL support, SMTP authentication and NULLCLIENT.

Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL

Reviewed by:	peter
Discussed with:	emaste, bz, peter
2014-02-21 07:26:49 +00:00
Christian Brueffer 84beb433c0 Further refine the auth fail regex to catch more auth failures and
reduce false positives.

The committed patch was provided by Christian Marg.

PR:		91732
Submitted by:	Daniel O'Connor <doconnor at gsoft.com.au>
		Skye Poier <spoier at gmail.com>
		Alan Amesbury <amesbury at umn.edu>
		Christian Marg <marg at rz.tu-clausthal.de>
MFC after:	1 month
2014-02-20 23:43:49 +00:00
Dimitry Andric f785676f2a Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
2014-02-16 19:44:07 +00:00
Marcel Moolenaar d0c2bbbe6c Start getty(8) on ttyu1 as well. It's not uncommon for HP hardware
to have that be the iLO console (e.g. pluto).
2014-02-16 19:08:10 +00:00
Bryan Drewery 87d236ddee Allow overriding rctl.conf(5) file location for /etc/rc.d/rctl
Reviewed by:	trasz
Approved by:	bapt (mentor)
MFC after:      1 week
2014-02-15 14:50:47 +00:00
Andriy Gapon 06e79198cb move devd rules for zfs events into a separate file and fix stale event types
Also, extend with some new events.
Additionally, tag syslog messages with 'ZFS' instead of using explicit "ZFS: "
prefix in the messages themselves.

Tested by:	Daniel O'Connor <doconnor@gsoft.com.au>
MFC after:	8 days
Sponsored by:	HybridCluster
2014-02-14 15:31:48 +00:00
Hans Petter Selasky c79a4afc20 Regenerate usb.conf
MFC after:	2 weeks
2014-02-06 10:52:51 +00:00
Hans Petter Selasky 0da629d403 Regenerate usb.conf
MFC after:	2 days
2014-02-04 09:11:50 +00:00
Dag-Erling Smørgrav f7167e0ea0 Upgrade to OpenSSH 6.5p1. 2014-01-31 13:12:02 +00:00
Dimitry Andric 4f7ab58ee6 Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y.

MFC after:	3 weeks
2014-01-30 07:44:22 +00:00
Hans Petter Selasky eed447b59b Add support for trackpads found in Apple MacBook products. While at it
add some missing devd entries.

Submitted by:	Huang Wen Hui <huanghwh@gmail.com>
MFC after:	1 week
2014-01-29 10:42:01 +00:00
Gregory Neil Shapiro 96e1fa9b9f Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.14.8/cf tree.

MFC after:	5 days
2014-01-26 23:51:16 +00:00
Glen Barber b3f2918a25 Temporarily turn off the services.db generation during distributeworld.
I'll work on an update to test for endianness-compatibility.

Submitted by:	many
Sponsored by:	The FreeBSD Foundation
2014-01-25 00:03:33 +00:00
Alan Somers a8eb96d593 Replace the old unix_seqpacket and unix_seqpacket_exercise tests, which
were a little broken and not automatable, with unix_seqpacket_test.
It's coverage is a superset of the old tests and it uses ATF.  It
includes test cases for bugs kern/185813 and kern/185812.

PR:		kern/185812
PR:		kern/185813
Sponsored by:	Spectra Logic
MFC after:	2 weeks
2014-01-23 17:26:28 +00:00
Glen Barber 8fcaeb45bb Disable output about duplicate services, which were not output during
testing.

MFC after:	1 month
X-MFC-After:	r261031
Sponsored by:	The FreeBSD Foundation
2014-01-22 23:00:29 +00:00
John Baldwin 385d6d4738 Generate /var/db/services.db during 'make distribution' so that it is
present during new installs.  Update etcupdate and mergemaster to
ignore the generated file.

Tested by:	gjb (release build)
MFC after:	1 month
2014-01-22 16:59:53 +00:00
Baptiste Daroussin 6c23872995 Remove pkg_* related info from periodic.conf
Reported by:	Robin Brocks <robin.brocks@brocks.de>
MFC after:	3 days
2014-01-22 14:22:44 +00:00
Dmitry Sivachenko eea6404df7 Do not exit with non-zero return code if sysctl.conf or sysctl.conf.local files
are absent.

Approved by:	delphij
2014-01-21 18:57:49 +00:00
Julio Merino 762c167ede Respect the original layout of the atf-{c,c++} tests.
Put test programs for internal modules into a 'detail' subdirectory of the
libatf-c and libatf-c++ test directories, just as the upstream distribution
does.  This is necessary because the tests assume such layout to find the
process_helper program, and currently fail because of this divergence.

MFC after:	1 week
2014-01-10 23:38:33 +00:00
Alexander Motin 977929e179 Remove very low default limit of 4 nfsd threads. nfsd's own default is
8 * hw.ncpu, that sounds more appropriate for these SMP/NCQ/... days.
2014-01-09 15:55:55 +00:00
Kevin Lo 2f95141e5f Regen. 2014-01-03 06:02:08 +00:00
Xin LI b2c730e011 Tighten default restrictions for ntpd(8) server and provide a link
to NTP access restriction documentation.

The new default restrictions would allow only time queries from a
remote system and will KoD all other requests, but still allow
localhost to do make all requests.

These restrictions are also recommended for all Internet-facing
public NTP servers.

This changeset is intended for an instant MFC to stable/10 and
releng/10.0.
2013-12-27 23:06:15 +00:00
Kevin Lo bd106e837e Regen. 2013-12-27 08:06:23 +00:00
Glen Barber fa804a465d Honor WITHOUT_CASPER.
Sponsored by:	The FreeBSD Foundation
2013-12-21 15:02:47 +00:00
Pawel Jakub Dawidek f01f744647 Make the world a bit more secure place (hopefully) and turn the casperd on
by default.

Sponsored by:	The FreeBSD Foundation
2013-12-19 00:53:11 +00:00
Pawel Jakub Dawidek 49a6d80306 Start-up script for casperd daemon.
Sponsored by:	The FreeBSD Foundation
2013-12-16 11:03:59 +00:00
Alan Somers f0038a8e98 sbin/devd/devd.cc
Promoting the SIGINFO handler's log message from LOG_INFO to
	LOG_NOTICE, and promoting the "Processing event ..." message from
	LOG_DEBUG to LOG_INFO.  Setting the logfile to LOG_NOTICE with this
	change will have the same result as setting it to LOG_INFO without
	this change.  Setting it to LOG_INFO with this change will include
	the useful "Processing event ..." messages that were previously at
	LOG_DEBUG, without including useless messages like "Pushing table".

	The intent of this change is that one can log "Processing event ..."
	without logging "Pushing table" and related messages that are sent
	for every event.  The number of lines actually logged is reduced by
	about 75% by making this change and setting syslog to LOG_INFO vs
	setting syslog to LOG_DEBUG.

etc/syslog.conf
	Changing the recommended loglevel to notice instead of info.

Sponsored by:	Spectra Logic Corp
MFC after:	4 weeks
2013-12-13 22:58:57 +00:00
Julio Merino 13de33a5dc Migrate tools/regression/bin/ tests to the new layout.
This change is a proof of concept on how to easily integrate existing
tests from the tools/regression/ hierarchy into the /usr/tests/ test
suite and on how to adapt them to the new layout for src.

To achieve these goals, this change:

- Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/.
- Renames the previous regress.sh files to legacy_test.sh.
- Adds Makefiles to build and install the tests and all their supporting
  data files into /usr/tests/bin/.
- Plugs the legacy_test test programs into the test suite using the new
  TAP backend for Kyua (appearing in 0.8) so that the code of the test
  programs does not have to change.
- Registers the new directories in the BSD.test.dist mtree file.

Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-12-11 04:09:17 +00:00
Peter Wemm 3843e98991 Rev 256256 had an undocumented side effect of breaking existing behavior
for ipv6 jails.

Among the harmful side effects included putting a route to an entire /64
onto an interface even if you were in a smaller network - eg: /80.
This broke the freebsd.org cluster hosted at ISC which has /80 networks.
2013-12-08 05:55:55 +00:00
Kevin Lo 8c1afc15c5 Regen. 2013-12-06 15:27:42 +00:00
Aleksandr Rybalko 4874c0802c Install teken.h for userland.
Part of VT(9) project merge.
Reviewed by:	nwhitehorn
MFC_to_10_after:	re approval

Sponsored by:	The FreeBSD Foundation
2013-12-05 22:56:37 +00:00
Colin Percival b6ae696fc9 The rc system aggressively caches the contents of /etc/rc.conf in order to
improve boot performance; this produces arguably astonishing (non-)results
if /etc/rc.conf is modified during the boot process.

Since performance considerations make it infeasible to automatically detect
if the cached /etc/rc.conf parameters should be invalidated, provide a
mechanism for explicitly requesting that /etc/rc.conf be reloaded: Catch
SIGALRM and reload /etc/rc.conf if it is received.

Discussed on:	freebsd-rc
MFC after:	3 days
2013-12-03 21:55:57 +00:00
Eitan Adler c9f609a92f Add DragonFly BSD fingerprints to pf.os
Obtained From:	DragonFly BSD (commit 321b0bb006b0857d2c212dc8cd12a36d750bcf9a)
2013-12-03 04:32:02 +00:00
Eitan Adler 326f183e4b Add an autologin entry for the console.
Obtained From:	DragonFly BSD (commit f95025e8c9a4471edb610557263b12acd8e7fb3a)
2013-12-03 04:13:55 +00:00
Eitan Adler edf06f9a53 Add Veritas NetBackup
Obtained From:	DragonFly BSD
2013-12-03 04:03:19 +00:00
Eitan Adler 67e7600bcc Add the Short Message Peer-to-Peer protocol
PR:		conf/183398
Submitted by:	olgeni
2013-12-03 03:57:22 +00:00
Pawel Jakub Dawidek 42a8595256 Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
	- gethostbyname(3),
	- gethostbyname2(3),
	- gethostbyaddr(3),
	- getaddrinfo(3),
	- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by:	The FreeBSD Foundation
2013-12-02 08:21:28 +00:00
Xin LI 45475f1761 Create /var/cache with mode 0755 instead of 0750.
This directory is used by many third party applications and having
permission 0750 makes it impossible to drop group privileges.

MFC after:	3 days
2013-11-26 20:03:25 +00:00
Don Lewis a2c0f474c4 Regenerate after r258363 (alternate ID for Novatel MiFi 2200) and
r258333 (bus_autoconf.sh tweak).
2013-11-20 02:20:27 +00:00
Mark Johnston 39be692974 Regenerate usb.conf after r258331. 2013-11-19 00:40:38 +00:00
Julio Merino 21203fdd06 Add some sample test programs.
This change adds some sample test cases to share/examples/tests/
demonstrating the basic usage of the atf and plain interfaces.

These test programs are fully-functional and are installed as part
of the test suite, which guarantees that the sample code remains
correct.  However, they currently mostly serve as a placeholder for
additional examples and may be incomplete (depending on how you
look at them).  I will see what else can be useful while working on
documentation.

As a bonus, the addition of these tests exercise the *.test.mk files,
one of which (plain.test.mk) was not yet in use, and also demonstrates
that it's possible to mix different kinds of test programs into the
same test suite.

Approved by:	rpaulo (mentor)
2013-11-18 12:57:46 +00:00
Julio Merino 5efcd27a34 Move all atf directories to the tests mtree.
This is to ensure that test-related directories don't get needlessly
created (and later deleted) when MK_TESTS=no.

Problem found by jhb@.

Approved by:	rpaulo (mentor)
2013-11-16 19:42:40 +00:00
Julio Merino 8496b1293a Install BSD.tests.mtree when MK_TESTS is yes.
Problem found by jhb@.

Approved by:	rpaulo (mentor)
2013-11-16 19:41:04 +00:00
Baptiste Daroussin 63af4435d9 Enabled should be a boolean, not a string
MFC after:	2 days
2013-11-16 15:54:46 +00:00
Josh Paetzel e2838b315a Add support for multiple instances of ftp-proxy
and pflog devices.

PR:	conf/158171
Submitted by:	Thomas Johnson <tom@claimlynx.com>
2013-11-13 03:50:31 +00:00
John Baldwin 25c58526a3 Revert r257715. This breaks the case where devd isn't running. The
real solution to this is still being discussed and probably won't look
quite like this.
2013-11-12 18:59:23 +00:00
Julio Merino fba3cde907 Build and install the atf tests.
Reviewed by:	freebsd-testing
Approved by:	rpaulo (mentor)
2013-11-08 14:33:41 +00:00
John Baldwin 765f1c5ae7 Don't explicitly invoke ifn_start on new child interfaces (vaps and
subinterfaces) after they are created.  Interfaces are already started
by devd invoking /etc/pccard_ether when they are created, so the explicit
calls in childif_create() resulted in interfaces being started twice.

Note that interfaces created via cloned_interfaces are not explicitly
started but depend on the devd mechanism already.

MFC after:	1 week
2013-11-05 19:49:53 +00:00
Gleb Smirnoff 3e0f3c1e42 Remove remnants of BIND from /etc, since there is no BIND in base now.
Sorry, that would break users running head and BIND from ports, since
ports rely on these scripts. The ports will be fixed soon.

Reviewed by:	erwin
2013-11-05 09:30:06 +00:00
Bryan Drewery cecc016791 Use proper capitalization for FreeBSD.org
Approved by:	bapt
MFC after:	2 days
2013-11-05 02:22:04 +00:00
Bryan Drewery 5ca9b3ca8e Enable fingerprint checking as the currently known
fingerprint has an uploaded signature on all mirrors.

Approved by:	bapt
MFC after:	2 days
2013-11-05 02:20:49 +00:00
Baptiste Daroussin c92d635ad3 After around 20 years of duty it is time for pkg_install to retire 2013-10-31 13:00:35 +00:00
Jeremie Le Hen a5198c41bc Fix indentation.
MFC after:     4 days
2013-10-29 20:38:19 +00:00
Jeremie Le Hen 1f00510804 Fix compatibility function for old daily_status_security_${name}_enable
variable

PR:	        conf/183137
Reported by:    Adam McDougall <mcdouga9 at egr msu edu>
MFC after:	3 days
2013-10-29 20:35:35 +00:00
Bryan Drewery 8d20be1e22 Move /etc/keys to /usr/share/keys where users are less likely to modify them.
Requested by:	secteam (cperciva, des)
Approved by:	bapt
2013-10-29 15:07:54 +00:00
Gleb Smirnoff a7a36fea40 Remove more remnants of ng_fec(4).
The ng_create_one() and ng_mkpeer() functions in network.subr are
now not used anywhere, but I left them, since they can be useful
in future in netgraph scripting.

Submitted by:	pluknet
2013-10-28 16:21:31 +00:00
Gleb Smirnoff 75bf2db380 Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with:		bz
2013-10-27 16:25:57 +00:00
Bryan Drewery b8fc65696b Fix indentation
Reported by:	zont
Approved by:	bapt (implicit)
MFC after:	2 days
X-MFC-With:	r257145
2013-10-26 16:19:14 +00:00
Bryan Drewery a4c821f9b2 Add missing /etc/pkg to BSD.root.dist
Approved by:	bapt
MFC after:	2 days
X-MFC-With:	r257145
2013-10-26 15:02:34 +00:00
Bryan Drewery 914d05f14e Disable fingerprint checking for now as the pkg repository mirrors will
not receive the signature until later this week.

Approved by:	bapt
2013-10-26 14:19:57 +00:00
Bryan Drewery 24a2212906 Add infrastructure for installing pkg(8) keys into /etc/keys/pkg and add
the current test key that packages will be signed with until 10.0-RELEASE.

Approved by:	bapt
Discussed by:	bapt with des
MFC after:	2 days
2013-10-26 03:53:24 +00:00
Bryan Drewery f12db248e7 Support checking signature for pkg bootstrap.
If the pkg.conf is configured with SIGNATURE_TYPE: FINGERPRINTS,
and FINGERPRINTS: /etc/keys/pkg then a pkg.sig file is fetched along
with pkg.txz. The signature contains the signature provided by the
signing server, and the public key. The .sig is the exact output
from the signing server in the following format:

  SIGNATURE
  <openssl signed>
  CERT
  <rsa public key>
  END

The signature is verified with the following logic:

 - If the .sig file is missing, it fails.
 - If the .sig doesn't validate, it fails.
 - If the public key in the .sig is not in the known trusted fingerprints,
   it fails.
 - If the public key is in the revoked key list, it fails.

Approved by:	bapt
MFC after:	2 days
Discussed by:	bapt with des, jonathan, gavin
2013-10-26 03:43:02 +00:00
Bryan Drewery bc5e9ac08d Add support for reading configuration files from /etc/pkg.
For now only /etc/pkg/FreeBSD.conf is supported. Its style is:

Repo: {
   URL: "...",
   MIRROR_TYPE: "...",
   ...
}

The configuration will be read from /usr/local/etc/pkg.conf if exists,
otherwise /etc/pkg/FreeBSD.conf

Approved by:	bapt
MFC after: 	2 days
2013-10-26 03:31:05 +00:00
Rui Paulo e2197f8018 Set up the /usr/tests hierarchy.
Populate /usr/tests with the only test programs that currently live
in the tree (those in lib/libcrypt/tests/) and add all the build
machinery to accompany this change.

In particular:

- Add a WITHOUT_TESTS variable that users can define to request that
  no tests be put in /usr/tests.
- Add a top-level Kyuafile for /usr/tests and a way to create similar
  Kyuafiles in top-level subdirectories.
- Add a BSD.tests.dist file to define the directory layout of
  /usr/tests.

Submitted by:	Julio Merino jmmv google.com
Reviewed by:	sjg
MFC after:	2 weeks
2013-10-25 05:25:19 +00:00
Andrey Zonov 34f41cb067 Cleanup empty directories
PR:	conf/167133
2013-10-24 21:58:14 +00:00
Dag-Erling Smørgrav c614125e67 Add a reload command.
Reviewed by:	hrs
MFC after:	3 days
2013-10-22 07:44:26 +00:00
Dag-Erling Smørgrav 0be7f787bb Start rtsold if necessary.
Reviewed by:	hrs
MFC after:	3 days
2013-10-22 06:53:01 +00:00
Konstantin Belousov 85a0ddfd0b Add a resource limit for the total number of kqueues available to the
user.  Kqueue now saves the ucred of the allocating thread, to
correctly decrement the counter on close.

Under some specific and not real-world use scenario for kqueue, it is
possible for the kqueues to consume memory proportional to the square
of the number of the filedescriptors available to the process.  Limit
allows administrator to prevent the abuse.

This is kernel-mode side of the change, with the user-mode enabling
commit following.

Reported and tested by:	pho
Discussed with:	jmg
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2013-10-21 16:46:12 +00:00
Hiroki Sato 3ad6f56a5a - Fix jail_parallel_start="YES".
- Fix ip[46].addr when interface parameter is not defined.

Spotted by:	rpaulo
2013-10-21 08:49:46 +00:00
Colin Percival cabad26453 Add support for "first boot" rc.d scripts. [1]
These scripts, containing
# KEYWORD: firstboot
will only be run if a sentinel file (default: /firstboot, configurable
via the rc.conf ${firstboot_sentinel} variable) exists; this sentinel
file will be deleted at the end of the boot process.

Scripts can request that the system reboot after the first boot by
creating the file ${firstboot_sentinel}-reboot.

This functionality is expected to be useful for embedded systems and
virtual machine images, where it may be desirable to
(a) download and install updates which became available between when
the image was created and when it was "turned on";
(b) download and install packages which may be newer than those
which were available when the image was created;
(c) install packages which run binaries during their install process,
bypassing the problem of cross-architecture installs;
(d) resize filesystems to match the disk onto which a VM image was
installed;
(e) perform initialization tasks relevant to cloud systems (e.g.,
Amazon's Elastic Compute Cloud);
and likely to perform many other one-time initialization functions.

Document this new functionality in rc.conf(5) and rc(8). [2]

Reviewed by:	freebsd-current, freebsd-rc [1]
Reviewed by:	Warren Block [2]
MFC after:	3 days
2013-10-19 21:37:06 +00:00
John-Mark Gurney ff14d523bb Enable the automatic creation of a certificate (if one does not exists)
and enable the usage by sendmail if sendmail is enabled.  Include and
document knobs to disable this feature and also set the Common Name of
the certificate created.

As the certificate is signed w/ a discarded key, it only helps prevent
Eve, but not Malory from knowing the contents of the emails.

This means that new installs (and people that use the updated freebsd.mc
file) will automaticly have STARTTLS enabled allowing incoming email to
be encrypted in most cases.

Reviewed by:	gshapiro
MFC after:	3 days
Security:	Yes, please.
2013-10-19 18:51:06 +00:00
Dag-Erling Smørgrav 487a635bdc Last few remnants of BIND (hopefully...)
MFC after:	3 days
2013-10-19 10:00:51 +00:00
Hiroki Sato d3b57253ee - Fix a bug which prevented jails from starting when $jail_conf was used and
no jail name was specified.
- Display error messages when start/stop fails.

Reported by:	swills
2013-10-18 03:44:16 +00:00
Hiroki Sato b290250058 - Fix "ifname|addr" syntax support in jail_{jname}_ip.
- Create /var/run/jail_{jname}.id because ezjail-admin depends on it.
2013-10-15 04:54:49 +00:00
Alan Somers 0ec3dc36e5 etc/rc.d/zfsd
Remove set_rcvar, in accordance with rev 230103.

Submitted by:	will
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic Corporation
2013-10-15 00:09:22 +00:00
Alan Somers 31b1be9cfa Extract devctl event processing support out of zfsd and into a new library:
libdevctl.

	etc/mtree/BSD.include.dist:
		Add the /usr/include/devctl directory to the base system.

	lib/Makefile:
	lib/libdevctl/Makefile:
		Build support for the new library.

	lib/libdevctl/consumer.cc:
	lib/libdevctl/consumer.h:
	cddl/sbin/zfsd/zfsd.cc:
	cddl/sbin/zfsd/zfsd.h:
		New class, DevCtl::Consumer, from functionality extracted
		from ZfsDaemon, which can connect to devd, parse an event
		stream, and invoke event handlers.

	lib/libdevctl/event.cc:
	lib/libdevctl/event.h:
	cddl/sbin/zfsd/dev_ctl_event.cc:
	cddl/sbin/zfsd/dev_ctl_event.h:
		Strip Zfsd specific event handling from Zfsd's event classes
		to create DevCtl::Event, DevCtl::DevfsEvent, and
		DevCtl::ZfsEvent.

	lib/libdevctl/event_buffer.cc:
	lib/libdevctl/event_buffer.h:
	cddl/sbin/zfsd/zfsd.cc:
	cddl/sbin/zfsd/zfsd.h:
		DevCtl::EventBuffer: buffer for incoming devctl stream used
		to parse/extract individual event strings.

	lib/libdevctl/event_factory.cc:
	lib/libdevctl/event_factory.h:
	cddl/sbin/zfsd/zfsd.cc:
	cddl/sbin/zfsd/zfsd.h:
		DevCtl::EventFactory: Method map for converting event
		strings to Devctl::Event objects.

	lib/libdevctl/exception.cc:
	lib/libdevctl/exception.h:
	cddl/sbin/zfsd/zfsd_exception.cc:
	cddl/sbin/zfsd/zfsd_exception.h:
		DevCtl::Exception and DevCtl::ParseException, the exceptions
		which are thrown by this library.

	lib/libdevctl/guid.cc:
	lib/libdevctl/guid.h:
	cddl/sbin/zfsd/guid.cc:
	cddl/sbin/zfsd/guid.h:
		DevCtl::Guid: Helper routines for dealing with 64bit GUIDs
		such as found in Zfs pools and vdevs.

	lib/libdevctl/reader.cc:
	lib/libdevctl/reader.h:
	cddl/sbin/zfsd/zfsd.cc:
	cddl/sbin/zfsd/zfsd.h:
		DevCtl::Reader class hierarchy.  Used to direct a Consumer
		to an event stream (e.g. from devd or a local/saved file).

	cddl/sbin/zfsd/zfsd_event.cc:
	cddl/sbin/zfsd/zfsd_event.h:
		Zfsd specialization of DevCtl::Event types.

	cddl/sbin/zfsd/zfsd_exception.cc:
	cddl/sbin/zfsd/zfsd_exception.h:
		Zfsd specific exception types, now derived from
		DevCtl::Excpetion.

	cddl/sbin/zfsd/Makefile:
	cddl/sbin/zfsd/callout.cc:
	cddl/sbin/zfsd/callout.h:
	cddl/sbin/zfsd/case_file.cc:
	cddl/sbin/zfsd/case_file.h:
	cddl/sbin/zfsd/vdev.cc:
	cddl/sbin/zfsd/vdev.h:
	cddl/sbin/zfsd/vdev_iterator.cc:
	cddl/sbin/zfsd/vdev_iterator.h:
	cddl/sbin/zfsd/zfsd.cc:
	cddl/sbin/zfsd/zfsd.h:
	cddl/sbin/zfsd/zfsd_event.cc:
	cddl/sbin/zfsd/zfsd_event.h:
	cddl/sbin/zfsd/zfsd_exception.cc:
	cddl/sbin/zfsd/zfsd_exception.h:
	cddl/sbin/zfsd/zfsd_main.cc:
	cddl/sbin/zfsd/zpool_list.cc:
	cddl/sbin/zfsd/zpool_list.h:
		Miscelaneuous refactoring to support using libdevctl instead
		of local implementation.

	cddl/sbin/zfsd/Makefile:
	cddl/sbin/zfsd/Makefile.common:
	tools/regression/zfsd/Makefile:
		Export common build information for zfsd and its unit tests
		to a "Makefile.common".

Submitted by:	gibbs
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic Corporation
2013-10-14 22:58:48 +00:00
Hiroki Sato 6fbfa3731b - Normalize jailname. "example.com" is converted to "example_com".
- Fix a bug that some $jail_{jname}_foo variables did not work.
- Fix a bug which prevented $jail_devfs_ruleset from working[1].
- Move $jail_parameters to the last of the configuraiton lines[1].

Reported by:	Jase Thew[1]
Approved by:	re (glebius)
2013-10-14 11:05:13 +00:00
Hiroki Sato fbd868c9d8 - Add mount.fdescfs parameter to jail(8). This is similar to
mount.devfs but mounts fdescfs.  The mount happens just after
  mount.devfs.

- rc.d/jail now displays whole error message from jail(8) when a jail
  fails to start.

Approved by:	re (gjb)
2013-10-12 17:27:59 +00:00
Mark Murray cc4d059c03 Merge from project branch. Uninteresting commits are trimmed.
Refactor of /dev/random device. Main points include:

* Userland seeding is no longer used. This auto-seeds at boot time
on PC/Desktop setups; this may need some tweeking and intelligence
from those folks setting up embedded boxes, but the work is believed
to be minimal.

* An entropy cache is written to /entropy (even during installation)
and the kernel uses this at next boot.

* An entropy file written to /boot/entropy can be loaded by loader(8)

* Hardware sources such as rdrand are fed into Yarrow, and are no
longer available raw.

------------------------------------------------------------------------
r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines

Add a RANDOM_RWFILE option and hide the entropy cache code behind it.
Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA.
Add the RANDOM_* options to LINT.

------------------------------------------------------------------------
r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines

Define RANDOM_PURE_RNDTEST for rndtest(4).

------------------------------------------------------------------------
r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines

staticize struct random_hardware_source

------------------------------------------------------------------------
r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines

Wrap some policy-rich code in 'if NOTYET' until we can thresh out
what it really needs to do.

------------------------------------------------------------------------
r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines

Re-add /dev/urandom for compatibility purposes.

------------------------------------------------------------------------
r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines

Add missing include guards and move the existing ones out of the
implementation namespace.

------------------------------------------------------------------------
r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines

Fix some just-noticed problems:

o Allow this to work with "nodevice random" by fixing where the
MALLOC pool is defined.

o Fix the explicit reseed code. This was correct as submitted, but
in the project branch doesn't need to set the "seeded" bit as this
is done correctly in the "unblock" function.

o Remove some debug ifdeffing.

o Adjust comments.

------------------------------------------------------------------------
r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines

Time to eat crow for me.

I replaced the sx_* locks that Arthur used with regular mutexes;
this turned out the be the wrong thing to do as the locks need to
be sleepable. Revert this folly.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com> (In original diff)

------------------------------------------------------------------------
r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines

Add YARROW_RNG and FORTUNA_RNG to sys/conf/options.

Add a SYSINIT that forces a reseed during proc0 setup, which happens
fairly late in the boot process.

Add a RANDOM_DEBUG option which enables some debugging printf()s.

Add a new RANDOM_ATTACH entropy source which harvests entropy from the
get_cyclecount() delta across each call to a device attach method.

------------------------------------------------------------------------
r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines

Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use
EVENTHANDLER(mountroot) instead.

This means we can't count on /var being present, so something will
need to be done about harvesting /var/db/entropy/... .

Some policy now needs to be sorted out, and a pre-sync cache needs
to be written, but apart from that we are now ready to go.

Over to review.

------------------------------------------------------------------------
r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines

Snapshot.

Looking pretty good; this mostly works now. New code includes:

* Read cached entropy at startup, both from files and from loader(8)
preloaded entropy. Failures are soft, but announced. Untested.

* Use EVENTHANDLER to do above just before we go multiuser. Untested.

------------------------------------------------------------------------
r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines

Fix up the man page for random(4). This mainly removes no-longer-relevant
details about HW RNGs, reseeding explicitly and user-supplied
entropy.

------------------------------------------------------------------------
r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines

As userland writing to /dev/random is no more, remove the "better
than nothing" bootstrap mode.

Add SWI harvesting to the mix.

My box seeds Yarrow by itself in a few seconds! YMMV; more to follow.

------------------------------------------------------------------------
r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines

Debug run. This now works, except that the "live" sources haven't
been tested. With all sources turned on, this unlocks itself in
a couple of seconds! That is no my box, and there is no guarantee
that this will be the case everywhere.

* Cut debug prints.

* Use the same locks/mutexes all the way through.

* Be a tad more conservative about entropy estimates.

------------------------------------------------------------------------
r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines

Don't use the "real" assembler mnemonics; older compilers may not
understand them (like when building CURRENT on 9.x).

# Submitted by:	Konstantin Belousov <kostikbel@gmail.com>

------------------------------------------------------------------------
r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines

SNAPSHOT.

Simplify the malloc pools; We only need one for this device.

Simplify the harvest queue.

Marginally improve the entropy pool hashing, making it a bit faster
in the process.

Connect up the hardware "live" source harvesting. This is simplistic
for now, and will need to be made rate-adaptive.

All of the above passes a compile test but needs to be debugged.

------------------------------------------------------------------------
r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines

Snapshot. This passes the build test, but has not yet been finished or debugged.

Contains:

* Refactor the hardware RNG CPU instruction sources to feed into
the software mixer. This is unfinished. The actual harvesting needs
to be sorted out. Modified by me (see below).

* Remove 'frac' parameter from random_harvest(). This was never
used and adds extra code for no good reason.

* Remove device write entropy harvesting. This provided a weak
attack vector, was not very good at bootstrapping the device. To
follow will be a replacement explicit reseed knob.

* Separate out all the RANDOM_PURE sources into separate harvest
entities. This adds some secuity in the case where more than one
is present.

* Review all the code and fix anything obviously messy or inconsistent.
Address som review concerns while I'm here, like rename the pseudo-rng
to 'dummy'.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com> (the first item)

------------------------------------------------------------------------
r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines

Yarrow wants entropy estimations to be conservative; the usual idea
is that if you are certain you have N bits of entropy, you declare
N/2.

------------------------------------------------------------------------
r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines

Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the
usual harvest queues. It was a nifty idea, but too heavyweight.

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines

Separate out the Software RNG entropy harvesting queue and thread
into its own files.

# Submitted by:	 Arthur Mesh <arthurmesh@gmail.com>

------------------------------------------------------------------------
r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines

Remove the short-lived namei experiment.

------------------------------------------------------------------------
r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines

Snapshot; Do some running repairs on entropy harvesting. More needs
to follow.

------------------------------------------------------------------------
r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines

Snapshot of current work;

1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific
or close enough to the Yarrow algorithm. For the rest use a neutral
name.

2) Tidy up headers; put private stuff in private places. More could
be done here.

3) Streamline the hashing/encryption; no need for a 256-bit counter;
128 bits will last for long enough.

There are bits of debug code lying around; these will be removed
at a later stage.

------------------------------------------------------------------------
r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines

1) example (partially humorous random_adaptor, that I call "EXAMPLE")
 * It's not meant to be used in a real system, it's there to show how
   the basics of how to create interfaces for random_adaptors. Perhaps
   it should belong in a manual page

2) Move probe.c's functionality in to random_adaptors.c
 * rename random_ident_hardware() to random_adaptor_choose()

3) Introduce a new way to choose (or select) random_adaptors via tunable
"rngs_want" It's a list of comma separated names of adaptors, ordered
by preferences. I.e.:
rngs_want="yarrow,rdrand"

Such setting would cause yarrow to be preferred to rdrand. If neither of
them are available (or registered), then system will default to
something reasonable (currently yarrow). If yarrow is not present, then
we fall back to the adaptor that's first on the list of registered
adaptors.

4) Introduce a way where RNGs can play a role of entropy source. This is
mostly useful for HW rngs.

The way I envision this is that every HW RNG will use this
functionality by default. Functionality to disable this is also present.
I have an example of how to use this in random_adaptor_example.c (see
modload event, and init function)

5) fix kern.random.adaptors from
kern.random.adaptors: yarrowpanicblock
to
kern.random.adaptors: yarrow,panic,block

6) add kern.random.active_adaptor to indicate currently selected
adaptor:
root@freebsd04:~ # sysctl kern.random.active_adaptor
kern.random.active_adaptor: yarrow

# Submitted by:	Arthur Mesh <arthurmesh@gmail.com>

Submitted by:	Dag-Erling Smørgrav <des@FreeBSD.org>, Arthur Mesh <arthurmesh@gmail.com>
Reviewed by:	des@FreeBSD.org
Approved by:	re (delphij)
Approved by:	secteam (des,delphij)
2013-10-12 12:57:57 +00:00