Commit Graph

16494 Commits

Author SHA1 Message Date
Marcelo Araujo
71866e627e Use NULL instead of 0 for pointers.
getenv(3) returns NULL if the variable name is not in the current
environment.
getservent(3) returns NULL on EOF or error

MFC after:	4 weeks
2016-04-15 03:50:33 +00:00
Marcelo Araujo
2c6167310e Use NULL instead of 0 for pointers.
fopen(3) returns NULL in case it can't open the STREAM.
fgetln(3) returns NULL if it can't get a line from a STREAM.
malloc returns NULL if it can't allocate memory.
2016-04-15 03:38:58 +00:00
Marcelo Araujo
960536b69f Use NULL instead of 0 for pointers and memory allocation.
malloc and realloc will return NULL pointer if it can't alloc memory.

MFC after:	4 weeks
2016-04-15 02:14:11 +00:00
Warren Block
4a2e0710e1 Remove a link to the CTM section of the Handbook, which no longer exists.
MFC after:	1 week
2016-04-14 21:56:36 +00:00
Marcelo Araujo
a5de41c600 Use NULL instead of 0 for pointers.
fopen(3) will return NULL in case it can't open the STREAM.
2016-04-14 12:53:38 +00:00
Marcelo Araujo
d11537c785 Use NULL instead of 0 for pointers.
The malloc will return a pointer to the allocated memory if successful,
otherwise a NULL pointer is returned.
2016-04-14 12:51:06 +00:00
Marcelo Araujo
45be165f23 Use NULL instead of 0 for pointers.
The strchr(3) returns a NULL if the character does not appears in the string.
The malloc will return NULL if cannot allocate memory.
2016-04-14 12:46:46 +00:00
Marcelo Araujo
fa02fc2d8f Use NULL instead of 0 for pointers.
fopen(3) will return NULL in case it can't open the STREAM.
The malloc will return a pointer to the allocated memory if successful,
otherwise a NULL pointer is returned.

Also add an extra DEBUG1 to print out the error to open a file.

Reviewed by:	ed
Differential Revision:	https://svnweb.freebsd.org/changeset/base/297959
2016-04-14 12:25:00 +00:00
Marcelo Araujo
f9e059ac83 Use NULL instead of 0 for pointers.
fopen(3) returns a FILE pointer, otherwise NULL is returned.

MFC after:	2 weeks
2016-04-14 11:41:30 +00:00
John Baldwin
5c40acf8b5 Handle PBA that shares a page with MSI-X table for passthrough devices.
If the PBA shares a page with the MSI-X table, map the shared page via
/dev/mem and emulate accesses to the portion of the PBA in the shared
page by accessing the mapped page.

Reviewed by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5919
2016-04-13 18:39:33 +00:00
Glen Barber
010855174a MFH
Sponsored by:	The FreeBSD Foundation
2016-04-13 16:19:50 +00:00
Marcelo Araujo
eaf209de36 Convert ypldap_addr list to a tailq(queue(3)).
Obtained from:	OpenBSD r1.11, r1.17 and r1.36
2016-04-13 03:36:34 +00:00
Glen Barber
9c831bbd69 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-13 02:04:09 +00:00
Marcelo Araujo
0e3562425e Apply revisions 1.4 and 1.5 from ldapd's ber.c to ypldap's copy, so it can
deal with messages that haven't been fully read from the server yet.

Obtained from:	OpenBSD r1.11
2016-04-13 01:54:33 +00:00
Glen Barber
a123f26e92 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-12 17:00:13 +00:00
Edward Tomasz Napierala
e321146fc5 Make the usage() mention the -u option added in r295212.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-04-12 16:07:41 +00:00
Glen Barber
876d357fa7 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-11 15:24:59 +00:00
Pedro F. Giffuni
bc17d12da3 lpr: replace 0 with NULL for pointers.
Found with devel/coccinelle.

Reviewed by:	gad
2016-04-10 23:47:40 +00:00
Peter Grehan
5ccf6ce169 Allow the location of the kernel source tree to be overridden.
This makes it easier for the bhyve executable to be built
out of the tree.
2016-04-10 05:58:19 +00:00
Allan Jude
b3f7b13945 bsdinstall/zfsboot should create /tmp and /var/tmp if they do not exist
PR:		208629
PR:		208568
Submitted by:	Galael LAPLANCHE <ganael.laplanche@corp.ovh.com>
MFC after:	2 weeks
2016-04-08 15:08:22 +00:00
Allan Jude
6b5e33ba48 Do not add swap to fstab when swapsize is 0
If a user requested encrypted swap, but 0 sized, it would still be added to fstab

PR:		208630
Submitted by:	Ganael LAPLANCHE <ganael.laplanche@corp.ovh.com>
MFC after:	2 weeks
Sponsored by:	ScaleEngine Inc.
2016-04-08 15:05:06 +00:00
Enji Cooper
ce570b1e96 Chase r296204 by renaming tzsetup(1) to tzsetup(8) in the tests
MFC after: 3 days
X-MFC with: r296204
Sponsored by: EMC / Isilon Storage Division
2016-04-06 03:12:44 +00:00
Glen Barber
2263fb580e MFH
Sponsored by:	The FreeBSD Foundation
2016-04-06 01:44:21 +00:00
Pedro F. Giffuni
8f61276d40 bhyveload: fix from loading undefined size.
We were setting an incorrect/undefined size and as it came out the st
struct was not really being used at all. This was actually a bug but
by sheer luck it had no visual effect.

CID:		1194320
Reviewed by:	grehan
2016-04-06 00:01:03 +00:00
Pedro F. Giffuni
91e34616df bhyve: Remove unneeded variable ncq.
ncq was not being inititialized properly but it was not actually
necessary either, so make the code smaller by removing it.

CID:		1248842
Reviewed by:	grehan
2016-04-05 19:30:19 +00:00
Glen Barber
d60840138f MFH
Sponsored by:	The FreeBSD Foundation
2016-04-04 23:55:32 +00:00
John Baldwin
0b03514943 Output information about PCI-e devices with slots.
In particular this includes additional information on HotPlug capable
slots.
2016-04-02 01:59:53 +00:00
John Baldwin
c36c6e72c6 Various updates to the PCI-express capability output.
- Group the output so that it follows the capability register set more
  closely.  The first line now contains device information and the
  second line contains link information.  As a result, ARI status is now
  output on the first line, and the link width is moved down to the second
  line of link information.
- Only read the DEVICE_CAP2 register to check for ARI if the capability
  version is >= 2.
- Don't output any link information if the link capability and status
  registers are zero.
- Label the MSI interrupt index value as "MSI" instead of "IRQ".
2016-04-02 01:55:43 +00:00
Pedro F. Giffuni
2b5554fec0 mtest: Prevent access to uninitialized value.
case 'g' makes use of value n, which is initialized for case 'b'
and passe through to case 'g'. If case 'g' is called directly
value 'n' is not initialized.

Avoid the issue by initializing n before entering the switch.

CID:		1006375
Reviewed by:	bms
2016-04-01 01:35:52 +00:00
Pedro F. Giffuni
6e43f3ed6d pci_emul_dior(): fix uninitialized scalar variable.
Prevent from returning an unitialized value in case the
ior size is unknown.

CID:		1194319
Reviewed by:	grehan
2016-03-31 19:07:03 +00:00
Bryan Drewery
497e80911e Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.
Reviewed by:	emaste, hselasky (partial), brooks (brief)
Discussed on:	arch@
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5742
2016-03-30 23:50:23 +00:00
Warren Block
579a636f2a Adjust misleading wording of the -G option and simplify a few
surrounding sentences.  From a discussion on -ports.

Reviewed by:	David Wolfskill <david@catwhisker.org>
2016-03-28 02:05:35 +00:00
Baptiste Daroussin
1427ff7da9 Cleanup headers
Found by:	include-what-you-use
2016-03-26 12:11:46 +00:00
Baptiste Daroussin
41328b4417 Remove some unneeded headers
Found by 'include-what-you-use'
2016-03-26 11:41:35 +00:00
Maksim Yevmenkin
52a4455b80 fix incorrect usage of hid_set_data() which causes crash
in bthidd(8) on amd64 WITH_SSP builds

Submitted by:	rakuco
Reviewed by:	rakuco
Tested by:	rakuco
MFC after:	1 week
2016-03-23 22:07:13 +00:00
Warner Losh
1ed9c427e5 Implement suggestion by jhb@ to have _PATH_FIRMWARE instead of hard
coding it to be "/usr/share/firmware".
2016-03-23 04:18:57 +00:00
Justin Hibbits
da1b038af9 Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions.
Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but
type `long' is only 32-bit.  This extends rman's resources to uintmax_t.  With
this change, any resource can feasibly be placed anywhere in physical memory
(within the constraints of the driver).

Why uintmax_t and not something machine dependent, or uint64_t?  Though it's
possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on
32-bit architectures.  64-bit architectures should have plenty of RAM to absorb
the increase on resource sizes if and when this occurs, and the number of
resources on memory-constrained systems should be sufficiently small as to not
pose a drastic overhead.  That being said, uintmax_t was chosen for source
clarity.  If it's specified as uint64_t, all printf()-like calls would either
need casts to uintmax_t, or be littered with PRI*64 macros.  Casts to uintmax_t
aren't horrible, but it would also bake into the API for
resource_list_print_type() either a hidden assumption that entries get cast to
uintmax_t for printing, or these calls would need the PRI*64 macros.  Since
source code is meant to be read more often than written, I chose the clearest
path of simply using uintmax_t.

Tested on a PowerPC p5020-based board, which places all device resources in
0xfxxxxxxxx, and has 8GB RAM.
Regression tested on qemu-system-i386
Regression tested on qemu-system-mips (malta profile)

Tested PAE and devinfo on virtualbox (live CD)

Special thanks to bz for his testing on ARM.

Reviewed By: bz, jhb (previous)
Relnotes:	Yes
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D4544
2016-03-18 01:28:41 +00:00
Allan Jude
6203e46b84 Remove 50% ZFS conditional from bsdinstall/zfsboot
Remove the requirement that the resulting partition table be atleast 50% ZFS

PR:		208094
Requested by:	brooks
Sponsored by:	ScaleEngine Inc.
2016-03-17 17:53:38 +00:00
Ed Maste
8c0d1b4798 kbdcontrol: add -P path option to add keymap search paths
PR:		193865
Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5645
2016-03-16 04:05:02 +00:00
Edward Tomasz Napierala
535bd9beaf Make fail() preserve the errno.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-15 11:10:08 +00:00
Edward Tomasz Napierala
e19462c33b Use the log_errno value passed to the function instead of the errno global
variable.

Suggested by:	Daniel Braniss
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-03-15 11:03:45 +00:00
Warner Losh
486607d0b6 Just install ar5523.bin into /usr/share/firmware and stop compiling it
in.

Differential Review: https://reviews.freebsd.org/D5639
2016-03-15 04:42:37 +00:00
Glen Barber
538354481e MFH
Sponsored by:	The FreeBSD Foundation
2016-03-14 18:54:29 +00:00
Ryan Stone
faf139cc5d Clean up repeated "All rights reserved" 2016-03-14 17:41:17 +00:00
George V. Neville-Neil
69ab30910f Fix typo: nmd->cur_tx_ring should be used in pci_vtnet_netmap_writev()
The buffer length should be checked to avoid overflow, but there
is no API to get the slot length, so the hardcoded value is used.
Return the currently-first request chain back to the available
queue if there are no more packets.
Report the link as up if we managed to open vale port.
Use consistent coding style.

Submitted by: btw
MFC after: 1 week
Differential Revision:	https://reviews.freebsd.org/D5595
2016-03-14 08:48:16 +00:00
Jakub Wojciech Klama
bb3844b388 Check value returned from ucl_parser_add_file().
Reviewed by:	trasz
Approved by:	trasz (mentor)
MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2016-03-13 19:50:17 +00:00
Alexander Motin
2c4f4af7a8 dd report short write as error, so don't halt on it. 2016-03-12 23:04:10 +00:00
Dimitry Andric
e74d991d69 Fix gcc warnings about possibly uninitialized variables in gpioctl.c.
Noticed by:	bz
2016-03-12 15:10:30 +00:00
Oleksandr Tymoshenko
3b2bb13317 Make it possible for operations to refer to GPIO pins by name
- Try to guess what is provided as a pin spec for -t or for get/set
    operation: number or name. Fails in case of ambiguity.
- Add -p and -N switches to force pin specification interpretation:
    -p forces spec to be pin number, -N forces it to be name

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision:	https://reviews.freebsd.org/D5201
2016-03-11 21:05:16 +00:00
Justin Hibbits
bf081e9948 Add to CFLAGS, rather than replacing.
This allows additional CFLAGS, as set in bsd.cpu.mk, to go through.
2016-03-11 20:04:32 +00:00
Alexander Motin
b8eb229d6f Oops, remove debugging forgotten in r296655.
MFC after:	2 weeks
2016-03-11 17:39:54 +00:00
Alexander Motin
5f7bd9a1c5 Don't bother to invoke gmirror or zpool if the module is not loaded. 2016-03-11 14:24:32 +00:00
Alexander Motin
edfb94f75b Unify and improve metadata wiping.
MFC after:	2 weeks
2016-03-11 14:14:15 +00:00
Alexander Motin
cdba914b3f Use geom disk list instead camcontrol identify.
The new way works for almost any disk, while the old only for ATA.

MFC after:	2 weeks
2016-03-11 13:06:11 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber
b655ec9752 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-06 04:13:17 +00:00
Marcelo Araujo
5707468385 Set argument encode/result decode call backs for 'maplist' and 'all'.
Note: Listing a map is still not fully implemented.

Obtained from:	OpenBSD (r1.16, r1.17)
2016-03-04 03:10:08 +00:00
Marcelo Araujo
619d20a133 Implement the 'master' request.
Obtained from:	OpenBSD (r1.15)
2016-03-04 02:14:32 +00:00
Maxim Konovalov
64778f377f o -t comman line option added to the usage(). 2016-03-03 07:07:44 +00:00
Glen Barber
42d27ee343 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 23:53:08 +00:00
Conrad Meyer
112bfcf5e4 daemon(8): Add -t option to set process title
The default process title is taken from the argv[0] value (any
particular hardlink name).  Add a -t option to override the default.

PR:		205016
Submitted by:	Yuri <yuri@rawbw.com>
No objection from:	freebsd-current@
Sponsored by:	EMC / Isilon Storage Division
2016-03-02 19:10:39 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Mark Johnston
429008a9ca Fix a typo that prevented pw(8) from setting a user's UID to 0.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-03-02 04:56:36 +00:00
Jason Helfman
7bd680e19d - update portsnap(8) to direct users to pkg-version
PR:		202971
Submitted by:	adamw@FreeBSD.org
Reviewed by:	bdrewery@
Approved by:	wblock@
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5429
2016-03-01 22:13:20 +00:00
Edward Tomasz Napierala
4c66acc9d7 Fix typo.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:40:37 +00:00
Edward Tomasz Napierala
8f6e650985 jls(1) -> jls(8)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:30:34 +00:00
Edward Tomasz Napierala
4b69ad25d0 Fix typo.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:25:13 +00:00
Edward Tomasz Napierala
3c9ac704ee tzsetup(1) -> tzsetup(8)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:24:34 +00:00
Edward Tomasz Napierala
4b9f77e45e Autofs is section 5, not 4.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 17:14:04 +00:00
Edward Tomasz Napierala
d7ab4963ec Fix typo.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-29 16:50:28 +00:00
Edward Tomasz Napierala
0fc124ccdd Fix .Xr - autofs(5) is section 5, not 8.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-28 10:40:09 +00:00
Pedro F. Giffuni
733191a56c pciconf: Silence a GCC warning.
Fix the build on sparc64 and powerpc.

Taken from:	wma
2016-02-26 23:12:59 +00:00
Bryan Drewery
3055a28d44 Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:15 +00:00
Marcel Moolenaar
568e3a8d7f Add option -C to have the guest memory included in core files.
This aids in debugging OS loaders.
2016-02-26 16:15:02 +00:00
Marcel Moolenaar
48f337b82c Support version 4 of the userboot structure by implementing the
vm_set_register() and vm_set_desc() callbacks.
2016-02-26 16:12:20 +00:00
Wojciech Macek
98179b624c Change format string in pciconf EA to jx
Fix compilation error introduced by r296081
2016-02-26 10:24:24 +00:00
Wojciech Macek
a2862b1169 Add support for Enhanced Allocation in pciconf
* Modified pciconf to print EA capability structure
 * Added register description to pcireg.h

Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           jhb
Differential revision: https://reviews.freebsd.org/D5440
2016-02-26 08:35:04 +00:00
Mariusz Zaborski
c501d73c7e Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.

Discussed with:		pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by:	drysdale@google.com, bdrewery
Approved by:		pjd (mentor)
Differential Revision:	https://reviews.freebsd.org/D4277
2016-02-25 18:23:40 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber
86b234d2f5 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-23 16:01:34 +00:00
David Malone
95bcaf513b Following revision r295924, the changes to a db file should be fsynced
before the file is closed. Consequently, it shouldn't be necessary to
open the file with O_SYNC any more.

This improves the performance of building large .db files for large
password files a lot and should resolve this problem:

	https://forums.freebsd.org/threads/10-2-pre-pwd_mkdb-slow-on-larger-master-passwd.52700/

Differential Revision:	https://reviews.freebsd.org/D5186
Reviewed by:	garga, vangyzen, bapt, se
MFC after:	1 week
2016-02-23 15:28:13 +00:00
Alan Somers
01368cfa26 Fix the usr.sbin/iostat build with GCC, broken by r295768
Renamed some local variables for compatibility with -Wshadow

Reported by:	Andrew Turner
Tested by:	ken
MFC after:	4 weeks
X-MFC-with:	295768
Sponsored by:	Spectra Logic Corp
2016-02-22 21:40:53 +00:00
Glen Barber
317cec3c43 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-22 12:28:23 +00:00
Ian Lepore
8be85b352b Document the ability to override compiled-in env and hints using variables
in the bootloader-provided env.
2016-02-21 18:58:05 +00:00
Stefan Eßer
a28a4d77b6 Fix possible out-of-bounds access detected by Ulrich Spörleins "scan-build".
Some invalid PCI device selectors could cause read access to an initialized
variable next to the array (local loop index variable).

While here, the parser has been made more strict with regard to the syntax
of PCI device selectors as documented in the man-page. E.g. "pci:" used to
be interpreted as "pci0:0".

MFC after:	3 days
2016-02-19 14:01:35 +00:00
Stefan Eßer
873e155c03 Use __unused instead of casting to void to silence the unused parameter
warning.

Fix the indentation of 2 lines to conform with the style of this file.

Submitted by:	jhb
2016-02-18 20:20:36 +00:00
Alan Somers
a59c2129f3 Fix compiler warnings in iostat
Raise WARNS from 1 to 6 (the default)
Fix warnings:
* Use C99 designated initializers for structs, and initialize all fields
* Mark global variables as static
* Mark unused function arguments
* Be careful about signed/unsigned comparisons

Reviewed by:	eadler
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D5328
2016-02-18 20:08:01 +00:00
Stefan Eßer
a4ed9e4f78 Make WARNS=6 safe.
Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64.
2016-02-18 15:23:25 +00:00
Mark Johnston
0386a98bd0 Use the _SAFE loop variant, since the loop body may remove queue entries.
PR:		207146
MFC after:	3 days
2016-02-18 01:58:26 +00:00
Glen Barber
72c3aa02dc MFH
Sponsored by:	The FreeBSD Foundation
2016-02-18 00:37:58 +00:00
Pedro F. Giffuni
e78e0c43ba crontab: ftruncate() with ftello() instead of ftell().
Obtained from:	OpenBSD (CVS rev. 1.47)
2016-02-16 21:19:39 +00:00
Pedro F. Giffuni
b83c6ff578 cron: use (char *)NULL instead of (char *)0 in execle.
Obtained from:	OpenBSD (CVS Rev 1.25)
2016-02-16 20:59:49 +00:00
Bryan Drewery
b265efb65b Revert r295648 for now.
This builds fine with FAST_DEPEND but the mkdep method requires that
include/ generates the headers during 'make depend' so the subsequent
directories can find them when running mkdep.

Sponsored by:	EMC / Isilon Storage Division
2016-02-16 16:07:12 +00:00
Bryan Drewery
9d8a81b4e4 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:30 +00:00
Bryan Drewery
e443683de2 Remove the need for overriding depend.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:21 +00:00
Bryan Drewery
956be76595 Add missing dependency on sys/conf/newvers.sh.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:18 +00:00
Glen Barber
0fe0fe112f MFH
Sponsored by:	The FreeBSD Foundation
2016-02-15 21:58:52 +00:00
Alexander Motin
c85285a96b Don't check CmdSN for initial login request.
This fixes connection errors for some initiators not starting CmdSN
from zero.

While there, fix wrong status details reported for couple errors.

MFC after:	3 days
2016-02-12 10:58:13 +00:00
Dag-Erling Smørgrav
0de4f1bf64 Use the new insecure-lan-zones option instead of listing each AS112 zone
separately.

MFC after:	3 days
2016-02-11 17:37:02 +00:00
Dag-Erling Smørgrav
8232a681f5 Remove unbound-contrl-setup since we use a local control socket which
does not require keys.

MFC after:	3 days
Relnotes:	yes
2016-02-11 17:33:55 +00:00
Jamie Gritton
e94b881ba1 Remove man page references to rndassociates.com, which has been taken over
by a domain squatter.
2016-02-10 14:48:49 +00:00
Stefan Eßer
fde0af719b Remove O_SYNC from the options passed to dbmopen().
The services db is created as a temporary file that is moved over the
existing file after completion. Thus there is no need to immediately
flush all created db records to the temporary file.

This speeds up creation of the services db by a factor of 500 on my
ZFS based /var/db filesytem (from 110 seconds to 0.235 seconds).

MFC after:	1 week
2016-02-10 09:40:45 +00:00
Glen Barber
30922917c8 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-10 04:20:39 +00:00
Glen Barber
7de1daeb93 Create packages for atm, ccdconfig, devd, ipf, ipfw,
iscsi, natd, nandfs, pf, quotacheck, and routed.

Add ping6 and rtsol to the runtime package.

Sponsored by:	The FreeBSD Foundation
2016-02-09 19:30:31 +00:00
Konstantin Belousov
db57c70a5b Rename P_KTHREAD struct proc p_flag to P_KPROC.
I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL()
definition.

Suggested by:	jhb
Sponsored by:	The FreeBSD Foundation
2016-02-09 16:30:16 +00:00
Glen Barber
9c4fa87c23 Create a package for sendmail(8).
Sponsored by:	The FreeBSD Foundation
2016-02-08 18:41:46 +00:00
Glen Barber
bbb51924bb MFH
Sponsored by:	The FreeBSD Foundation
2016-02-08 12:16:01 +00:00
Gleb Smirnoff
dd917c79b4 Provide a future release as an example, instead of a historical one. 2016-02-05 21:57:50 +00:00
Glen Barber
1f4bcc459a More 'tests' packaging fixes.
Sponsored by:	The FreeBSD Foundation
2016-02-03 19:08:45 +00:00
Jakub Wojciech Klama
5c734b0410 Add an additional, libucl-based configuration file parser to ctld.
Default ctld behavior remains unchanged - libucl parser can be selected
explicitly by adding -u switch to ctld command line.

Reviewed by:	trasz
Approved by:	trasz (mentor)
MFC after:	1 month
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D4534
2016-02-03 15:45:13 +00:00
Devin Teske
437455deb8 f_substr(): Optimized recipe if running under bash
This makes runnig f_substr() faster than it was when running under bash,
but both sh and dash are still faster when using the non-bash recipe which
features dynamically unrolled loops.
2016-02-03 04:02:50 +00:00
Devin Teske
d1eef61dae Remove SIG prefix from trapped signals
Makes traps functional if running under shells/dash
2016-02-03 03:55:08 +00:00
Devin Teske
9e81c4fb73 f_substr: Write to stdout when no `-v var_to_set'
Fixes ``setvar: : bad variable name''
2016-02-03 03:03:04 +00:00
Devin Teske
679f1eab00 Remove trailing whitespace 2016-02-03 02:46:00 +00:00
Glen Barber
3bea1c132c MFH
Sponsored by:	The FreeBSD Foundation
2016-02-03 02:02:01 +00:00
Devin Teske
7883f9204b Define f_sprintf() dynamically at inclusion time
No need to check/re-check capabilities that won't change at runtime.
2016-02-03 00:51:38 +00:00
Devin Teske
97ee039909 Revert r295169 and switch \ ' to " "'
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r295169, r295170, r295173, r295177
2016-02-02 23:54:07 +00:00
Devin Teske
d2ac785ed2 Fix a typo in a comment 2016-02-02 23:51:39 +00:00
John Baldwin
0fd00e0caa - Note that devctl(8) will appear in 10.3 first.
- Add missing devctl_set_driver entry to namelist in devlist(3).
- Fix sorting of function prototypes in devlist(3).

MFC after:	3 days
2016-02-02 22:55:03 +00:00
Devin Teske
0bcc841c3c Bump version to 7.1 for +=/-= fix
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r295169, r295170
2016-02-02 22:34:48 +00:00
Glen Barber
221b349912 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:27:48 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Devin Teske
6350eae8e4 For +=/-=, add . and / to convenience characters
sysrc(8) supports key+=value and key-=value, but can be told what the
delimiter is by being passed as char1 (e.g., "sysrc key+=",value" to use a
comma as the delimiter instead of space). For convenience, if the first char
is alpha-numeric, it is assumed you wanted whitespace as the delimiter.

However, if you naively (as I just did) execute:
	sysrc rc_conf_files+=/etc/rc.conf.other
the result is unexpected.

This commit makes `.' and `/' in-addition to alpha-numeric first-characters
to cause the default of whitespace to be used as the delimiter. This also
means that you can no longer use these as a delimiter.
2016-02-02 22:18:43 +00:00
Devin Teske
613d7da7d5 Replace (Qo \ Qc) with (Qo (space) Qc)
When using col(1) piped to vim(1) as pager for man(1), the former sequence
of (Qo \  Qc) renders as "" without the space. Replace with (Qo (space) Qc)
which renders properly in more (all?) pagers.
2016-02-02 21:58:17 +00:00
Glen Barber
dd181aca6c Create a package for autofs(5)
Sponsored by:	The FreeBSD Foundation
2016-02-02 17:33:37 +00:00
Devin Teske
d356ca0c3f Utilize new `-v var_to_set' of f_snprintf() 2016-02-01 00:54:26 +00:00
Devin Teske
0f9fec9d30 Move awk(1)-dependent recipes to the bottom 2016-01-31 21:34:25 +00:00
Devin Teske
92db38426f Move f_isinteger() to the top
Grouping builtins-only algos together
2016-01-31 21:33:24 +00:00
Devin Teske
e4f08d49c1 Move f_vsprintf() below f_sprintf()
Variable argument versions grouped with standard versions
2016-01-31 21:31:24 +00:00
Devin Teske
3c8cd13bf1 Move f_sprintf() above f_snprintf()
Ordering functions by appearance of use
2016-01-31 21:30:02 +00:00
Devin Teske
0cb8bea7ed Optimize f_substr() to use built-ins only
Change f_snprintf() to use optimzed f_substr()
2016-01-31 21:28:41 +00:00
Devin Teske
fcb16c1036 Optimize f_sprintf() for bash
bash lacks the ksh93 optimization that makes sub-shells fast if they do
not alter io. bash 3.1-alpha1 introduced printf -v var_to_set which is not
as fast but is still significantly faster than var_to_set=$( printf ) when
using any version of bash. If we find our interpreter to somehow be bash
by invocation or inclusion, use the feature that provides fastest results.
2016-01-31 21:22:10 +00:00
Devin Teske
57ef9b750b Reset OPTIND to 1 in f_device_find() 2016-01-31 21:14:31 +00:00
Allan Jude
0edc8cc831 The zfsboot automated part of bsdinstall now supports UEFI
MFC after:	3 days
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4960
2016-01-30 15:53:28 +00:00
Glen Barber
c8296cbb96 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-29 14:52:54 +00:00
Edward Tomasz Napierala
7aebc1bce2 Improve reporting of connection problems in iscsid(8).
Obtained from:	Mellanox Technologies
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-01-27 18:12:42 +00:00
Alan Somers
f32e43a6a8 syslogd: Enable repeated line compression for lines of any length.
Enable repeated line compression for lines of any length, instead of only
short lines. AFAICT repeated line compression was limited to short lines as
a RAM optimization, which made sense when karels added it in 1988, but no
longer.  The penalty is a paltry 904B of RAM per file logged.

Reviewed by:	rpaulo
MFC after:	32 days
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4475
2016-01-27 16:17:15 +00:00
Glen Barber
0e186c0aab MFH
Sponsored by:	The FreeBSD Foundation
2016-01-27 14:16:13 +00:00
Enji Cooper
0bd9b70036 Require /sbin/mount_cd9660 when running the cd9660 tests
In some cases the test system might not have mount_cd9660(8). Don't
implicitly rely on it while testing cd9660 support; explicitly rely
on it

MFC after: 1 week
Reported by: mjohnston
Sponsored by: EMC / Isilon Storage Division
2016-01-27 06:14:20 +00:00
Devin Teske
0f913ed5f9 Replace awk with more efficient builtins-only algo 2016-01-27 02:11:58 +00:00
Devin Teske
22fc021043 Use dpv(1) in `bsdconfig packages' 2016-01-27 00:12:58 +00:00
Devin Teske
c4ba688294 Fix ABI parsing 2016-01-27 00:09:53 +00:00
Devin Teske
938443fdf6 Change incorrect path 2016-01-27 00:08:23 +00:00
Ruslan Bukin
8f9bf0d661 Remove uathload from build due to issue with GCC 5.2.0:
"ld: --relax and -r may not be used together."
Requires fixing ld command line arguments and testing.
2016-01-26 14:34:40 +00:00
Marcelo Araujo
305b5a14e4 Cleanup unused-but-set-variable spotted by gcc-4.9.
Reviewed by:	neel
Approved by:	rodrigc (mentor)
Differential Revision:	https://reviews.freebsd.org/D5042
2016-01-26 07:17:21 +00:00
Glen Barber
f9421853ad MFH
Sponsored by:	The FreeBSD Foundation
2016-01-25 14:13:28 +00:00
Edward Tomasz Napierala
592d6e850a The <libutil.h> is an ordinary header file; should sort just like any other.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-01-24 18:11:36 +00:00
Devin Teske
33291485ae Fix a typo in a comment
MFC after:	3 days
X-MFC-to:	stable/10
2016-01-24 17:15:42 +00:00
Xin LI
68ba7e87e7 MFV r294491: ntp 4.2.8p6.
Security:	CVE-2015-7973, CVE-2015-7974, CVE-2015-7975
Security:	CVE-2015-7976, CVE-2015-7977, CVE-2015-7978
Security:	CVE-2015-7979, CVE-2015-8138, CVE-2015-8139
Security:	CVE-2015-8140, CVE-2015-8158
With hat:	so
2016-01-22 07:32:39 +00:00
Marcelo Araujo
db891e2149 Switch from FD_SETSIZE to getdtablesize(2) as it can make the FD to be
tunable. Also it gets more close with the original implementation from
OpenBSD.

Requested by:	rodrigc
Approved by:	rodrigc (mentor)
Differential Revision:	https://reviews.freebsd.org/D4970
2016-01-22 03:02:38 +00:00
Glen Barber
396953934d Create a package for apm(8).
Sponsored by:	The FreeBSD Foundation
2016-01-21 18:41:55 +00:00
Glen Barber
4ffb51fe89 Create a package for amd(8) and related tools.
While here, fix accounting rc script installation.

Sponsored by:	The FreeBSD Foundation
2016-01-21 18:19:33 +00:00
Glen Barber
d3d8fcf2c6 Create an acct package for accounting tools.
Sponsored by:	The FreeBSD Foundation
2016-01-21 17:49:10 +00:00
Glen Barber
2971191a94 Create a rcmds package.
Sponsored by:	The FreeBSD Foundation
2016-01-21 17:33:31 +00:00
Glen Barber
ed0d921874 Add a package for jail(8) and related utilities.
Sponsored by:	The FreeBSD Foundation
2016-01-20 17:07:13 +00:00
Glen Barber
59d43d11fe MFH
Sponsored by:	The FreeBSD Foundation
2016-01-20 09:50:54 +00:00
Edward Tomasz Napierala
449d10e56e Add "vidcontrol -i active", to print out active vty number,
to be used with eg "vidcontrol -s".

Reviewed by:	emaste@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D4968
2016-01-19 13:09:20 +00:00
Joel Dahl
5837aafd13 mdoc: sort Xr 2016-01-18 20:21:38 +00:00
Jamie Gritton
5160b6a7e6 Don't bother checking an ip[46].addr netmask/prefixlen. This is already
handled by ifconfig, and it was doing it wrong when the paramater included
extra ifconfig options.

PR:		205926
MFC after:	5 days
2016-01-16 22:32:57 +00:00
Allan Jude
a94af9543d Never 4k align the MBR bootpool because zfsldr can not deal with a gap
If the bootpool does not start at the first sector of the BSD partition
then zfsldr seeks to the wrong offset inside the ZFS vdev label, and is
unable to find zfsboot, so the system does not boot

If 4k alignment is requested, align the BSD partition in the MBR table,
and align the swap and data pool, but the bootpool must start at sector 1

While here, if 4k alignment is requested, disable MBR CHS alignment, as
this results in not-4k aligned partitions.

Reported by:	Alex Wilkinson
MFC after:	5 days
Sponsored by:	ScaleEngine Inc.
2016-01-16 19:25:16 +00:00
Jamie Gritton
fcc43d065a Clear errno before calling getpw*. 2016-01-16 18:13:28 +00:00
John Baldwin
a6c9d35c23 Adjust previous fix to conform to the existing style in this file. 2016-01-14 15:49:24 +00:00
Glen Barber
a11378bd93 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-14 13:29:12 +00:00
Eric van Gyzen
50d901977a bsdinstall: Suggest the GPT+Active workaround on Dell T5810
The Dell Precision Tower 5810 fails to boot from GPT in Legacy/BIOS mode
without the Active flag in the Protective MBR.  Suggest the workaround
during installation.

Since an increasing number of Dell systems exhibit this behavior,
I imagine all Dells past a certain date will do so.  I would like
to suggest the workaround for all Dells with a BIOS date of, say,
2014 or later, but I would need to test a variety of systems before
committing such a change.

Reviewed by:	allanjude, dteske
MFC after:	5 days
Relnotes:	We should probably suggest using GPT+Active on "recent" Dells.
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D4075
2016-01-14 00:31:00 +00:00
Andrew Turner
f5e45e53f9 Add support for relocating AArch64 modules to kldxref. This fixes an error
message where it fails to read the module as the unrelocated addresses
are zero.

Sponsored by:	ABT Systems Ltd
2016-01-13 21:34:15 +00:00
Baptiste Daroussin
1da56163f2 Remove some unneeded headers 2016-01-13 17:59:12 +00:00
Alan Somers
0191f57ff1 Fix Coverity warnings regarding r293229
rpcbind/check_bound.c
	Fix CID1347798, a memory leak in mergeaddr.

rpcbind/tests/addrmerge_test.c
	Fix CID1347800 through CID1347803, memory leaks in ATF tests.  They
	are harmless because each ATF test case runs in its own process, but
	they are trivial to fix.  Fix a few other leaks that Coverity didn't
	detect, too.

Coverity CID:	1347798, 1347800, 1347801, 1347802, 1347803
MFC after:	2 weeks
X-MFC-With:	293229
Sponsored by:	Spectra Logic Corp
2016-01-13 17:33:50 +00:00
Glen Barber
0ca935a8f0 MFH
Sponsored by:	The FreeBSD Foundation
2016-01-13 04:11:04 +00:00
Marcelo Araujo
3bf7d9a6eb ypldap(8) is a feature ready to be used to translate nis(8) database to ldap(3).
This commit, fix a core dump on ypldap(8) related with memory allocation.
Also an example of how to set the ypldap.conf(5) properly is added to
examples files.

A new user _ypldap is required to be able to run ypldap(8) as well as
in a chroot mode.

Reviewed by:	rodrigc (mentor), bjk
Approved by:	bapt (mentor)
Relnotes:	Yes
Sponsored by:	gandi.net
Differential Revision:	https://reviews.freebsd.org/D4744
2016-01-13 01:49:35 +00:00
Glen Barber
79119a977d MFH
Sponsored by:	The FreeBSD Foundation
2016-01-12 14:33:17 +00:00
Christian Brueffer
799d68c024 Add a basic bhyvectl manpage.
Reviewed by:	neel
MFC after:	2 weeks
2016-01-12 10:16:15 +00:00
Glen Barber
e60680024a MFH
Sponsored by:	The FreeBSD Foundation
2016-01-12 01:23:45 +00:00
Gleb Smirnoff
5ffa1d26c0 Fix bhyve(1) operation on vmnet devices, broken in r293459. 2016-01-10 20:10:34 +00:00
Devin Teske
7cf0da249a Fix improper duration for f_dialog_pause() API
MFC after:	3 days
X-MFC-to:	stable/10
2016-01-09 23:13:43 +00:00
Xin LI
1c2b1cecf1 Fix version number. 2016-01-09 09:33:24 +00:00
George V. Neville-Neil
b60204754b Add netmap support for bhyve
Submitted by:	btw
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4826
2016-01-09 03:08:21 +00:00
Xin LI
3311ff84ea MFV r293415:
ntp 4.2.8p5

Reviewed by:	cy, roberto
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D4828
2016-01-08 15:53:48 +00:00
Bryan Drewery
e3ebb82118 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-01-07 19:58:23 +00:00
Glen Barber
0c9da521fa MFH
Sponsored by:	The FreeBSD Foundation
2016-01-07 17:23:43 +00:00
Renato Botelho
3aefe8928a Make cap_mkdb and services_mkdb file operations sync
Similar fix was done for passwd and group operations in r285050. When a
temporary file is created and then renamed to replace official file there
are no checks to make sure data was written to disk and if a power cycle
happens at this time, system can end up with a 0 length file

Approved by:	bapt
MFC after:	1 week
Sponsored by:	Netgate
Differential Revision:	https://reviews.freebsd.org/D2982
2016-01-07 10:39:13 +00:00
Josh Paetzel
b875c2e96d Allow /etc/exports to contain usernames/groups with spaces in them.
If you are getting your users/groups from a directory service such
as LDAP or AD it's possible for those usernames or groupnames to
contain spaces.

Submitted by:	Sean E. Fagan
Reviewed by:	rmacklem
MFC after:	1 week
Sponsored by:	iXsystems
2016-01-07 05:34:39 +00:00
Alan Somers
a85f12322c "source routing" in rpcbind
Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.

usr.sbin/rpcbind/check_bound.c
	If the address on which a request was received is known, pass that
	to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
	comment indicates the parameter is supposed to mean. The previous
	behavior is that clnt_uaddr would contain the address from which the
	client sent the request.

usr.sbin/rpcbind/util.c
	Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
	if one is found. Refactor the relevant portion of the function for
	clarity, and to reduce the number of ifdefs.

etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
	Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.

usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
	Constify some function arguments

Reviewed by:	imp
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4690
2016-01-06 00:00:11 +00:00
Glen Barber
1a5c9277ca MFH
Sponsored by:	The FreeBSD Foundation
2016-01-05 21:12:49 +00:00
Glen Barber
8834318685 Merge ^/projects/release-install-debug:
- Rework MANIFEST generation and parsing via bsdinstall(8).
- Allow selecting debugging distribution sets during install.
- Rework bsdinstall(8) to fetch remote debug distribution sets
  when they are not available on the local install medium.
- Allow selecting additional non-GENERIC kernels during install.
  At present, GENERIC is still required, and installed by default.

Tested with:	head@r293203
Sponsored by:	The FreeBSD Foundation
2016-01-05 21:05:17 +00:00
Jilles Tjoelker
43d53dba8f Add sbin and /usr/local directories to _PATH_DEFPATH.
Set _PATH_DEFPATH to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the
path in the default class in the default /etc/login.conf,
excluding ~/bin which would not be expanded properly in a string
constant.

For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf,
~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a
default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and
by cron. Especially the latter is a common trap (most recently in PR
204813).

PR:		204813
Reviewed by:	secteam (delphij), alfred
2016-01-05 16:21:20 +00:00
Glen Barber
b626f5a73a MFH r289384-r293170
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:19:48 +00:00
Ed Maste
647129e382 kbdmap.5: Use current names for ASCII control codes lf, ff, us
Refer to the old names nl, np, ns as historical aliases.

PR:		205776, 205778
MFC After:	1 week
Sponsored by:	The FreeBSD Foundation
2016-01-02 18:35:11 +00:00
Josh Paetzel
21d7e927b5 Unset the gss kernel state when gssd exits
When gssd exits it leaves the kernel state set by
gssd_syscall().  nfsd sees this and waits endlessly
in an unkillable state for gssd to come back.  If you
had acidentally started gssd then stopped it, then
started nfsd you'd be in a bad way until you either
restarted gssd or rebooted the system.  This change
fixes that by setting the kernel state to "" when
gssd exits.
Reviewed by:	rmacklem
MFC after:	1 week
Sponsored by:	iXsystems
2016-01-01 17:06:16 +00:00
Bjoern A. Zeeb
cc398e2151 Remove unused variable after r292981 to unbreak the build. 2015-12-31 10:55:50 +00:00
Marcelo Araujo
3ec1cff529 Clean up unused-but-set-variable spotted by gcc-4.9.
Reviewed by:	grehan
Approved by:	rodrigc (mentor)
Differential Revision:	https://reviews.freebsd.org/D4734
2015-12-31 07:08:21 +00:00
Marcelo Araujo
09df572391 Clean up unused-but-set-variable spotted by gcc-4.9.
Approved by:	bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D4736
2015-12-31 01:57:55 +00:00
Marcelo Araujo
d74fdc6a35 Clean up unused-but-set-variable spotted by gcc-4.9.
Reviewed by:	grehan
Approved by:	bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D4735
2015-12-31 01:55:51 +00:00
Enji Cooper
5e25b19e29 Fix getopt(3) argument after r290180; I forgot to change -r to -R
by accident

MFC after: 3 days
Pointyhat to: ngie
Reported by: vangyzen
Sponsored by: EMC / Isilon Storage Division
2015-12-29 20:17:40 +00:00
Ulrich Spörlein
c9e1c304c1 Fix type mismatches for malloc(3) and Co.
This is rather pedantic, as for most architectures it holds that
sizeof(type *) == sizeof(type **)

Found by:	clang static analyzer
Reviewed by:	ed
Differential Revision: https://reviews.freebsd.org/D4722
2015-12-29 11:24:41 +00:00
Baptiste Daroussin
49d448f523 Simplify code for parsing extra groups 2015-12-29 00:08:32 +00:00
Baptiste Daroussin
4fc9390e7e Remove useless assignement of linelen 2015-12-29 00:02:08 +00:00
Baptiste Daroussin
36a8b62f3a Restore dryrun support for pw groupmod 2015-12-28 23:57:22 +00:00
Devin Teske
ed27536fd5 Explicitly set permissions on entropy files
Differential Revision:	https://reviews.freebsd.org/D3933
Submitted by:	jmg
Reviewed by:	delphij, markm
Approved by:	secteam (delphij)
MFC after:	3 days
X-MFC-to:	stable/10 stable/9
2015-12-28 17:27:20 +00:00
Xin LI
ca001338d8 Eliminate unneeded includes.
Reviewed by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D4716
2015-12-28 08:53:31 +00:00
Marcelo Araujo
daa3baeb1d The sdp opens the database with PERM_SECURE mode and it is different than
dp that opens the database with PERM_INSECURE, so we need to check sdp->put
against sdp instead of use dp->put.

PR:		bin/191720
Submitted by:	Miles Ohlrich <turingsboy@yahoo.com>
Approved by:	rodrigc (mentor)
Differential Revision:	https://reviews.freebsd.org/D4255
2015-12-28 05:48:22 +00:00
Allan Jude
b5e81ea6b0 Fix includes in usr.sbin/fstyp/zfs.c
Approved by:	bapt (mentor)
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4710
2015-12-26 19:48:36 +00:00
Baptiste Daroussin
8c18e026ba camadd does not require linking to libsbuf or libbsdxml directly 2015-12-24 11:43:32 +00:00
Pedro F. Giffuni
587d674e16 Undo change from r292607 that was not meant to be there
Pointyhat: me
2015-12-22 15:42:53 +00:00
Pedro F. Giffuni
d985028157 cron: Check the return value of pipe(2)
Fix inspired by:	OpenBSD (rev 1.56)
CID:	1009830
2015-12-22 15:32:45 +00:00
Pedro F. Giffuni
7044922b39 crontab: properly free an entry
This should close memory leak.

Obtained from:	OpenBSD (rev. 1.62)
CID:		271773
2015-12-22 15:30:26 +00:00
Pedro F. Giffuni
c28c984689 crontab: replace malloc + bzero with calloc
Obtained from:	OpenBSD (Rev 1.20)
2015-12-22 15:20:08 +00:00
Enji Cooper
e830a247a1 Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur
if the memory wasn't allocated again later on

Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-22 05:57:23 +00:00
Craig Rodrigues
cbbaf9b2b1 Add libxo support to jls
PR:                    200746
Submitted by:          Emmanuel Vadot <manu bidouilliste com>
Reviewed by:           allanjude
Relnotes:              yes
Differential Revision: https://reviews.freebsd.org/D4452
2015-12-22 00:58:35 +00:00
Ian Lepore
91ee346313 Make the building of libsmb and mount_smbfs unconditional, now that r292552
has eliminated alignment and endian problems that were making it fail on
some platforms.

PR:        180438
PR:        189415
2015-12-21 17:41:08 +00:00
Ed Maste
203b6f692c makefs: use ENTRY macro for diff reduction with NetBSD
Sponsored by:	The FreeBSD Foundation
2015-12-21 16:12:41 +00:00
Hajimu UMEMOTO
cf245b1092 Fix indent after r292333. 2015-12-19 09:18:01 +00:00
John Baldwin
32960dd10a Fix the precious change to check the pointer returned by malloc().
Submitted by:	luke <luke.tw@gmail.com>
Pointy hat to:	jhb
2015-12-18 17:52:08 +00:00
Hajimu UMEMOTO
00022bd089 Generate ipnodes.by{addr,name} from /etc/hosts for compatibility with
FreeBSD local name resolution.
If /var/yp/ipnodes exists, we generate them from it for backward
compatibility.

Inspired by:	NetBSD
MFC after:	1 week
2015-12-18 17:30:22 +00:00
Hajimu UMEMOTO
4ba79bb433 - Keep hosts.by{name,addr} IPv4 only.
- Add comment how we handle hosts and ipnodes. (from NetBSD)

MFC after:	1 week.
2015-12-18 11:20:50 +00:00
John Baldwin
b128c3c395 Exit cleanly if malloc() fails to allocate a buffer for a copy of the
current MBR.

PR:		205322
Submitted by:	Alexander Kuleshov <kuleshovmail@gmail.com>
MFC after:	1 week
2015-12-17 20:42:05 +00:00
Ian Lepore
7f84b7b298 Build mount_smbfs for arm. Also sort the subdirs. 2015-12-16 15:26:31 +00:00
Alexander V. Chernikov
427c2f4ef0 Provide additional lle data in IPv6 lltable dump used by ndp(8).
Before the change, things like lle state were queried via
  SIOCGNBRINFO_IN6 by ndp(8) for _each_ lle entry in dump.
This ioctl was added in 1999, probably to avoid touching rtsock code.

This change maps SIOCGNBRINFO_IN6 data to standard rtsock dump the
 following way:
  expire (already) maps to rtm_rmx.rmx_expire
  isrouter -> rtm_flags & RTF_GATEWAY
  asked -> rtm_rmx.rmx_pksent
  state -> rtm_rmx.rmx_state (maps to rmx_weight via define)

Reviewed by:	ae
2015-12-16 10:14:16 +00:00
Marcelo Araujo
6d652b139e Remove a garbage printf used for debug.
Approved by:	bapt (mentor implicit)
2015-12-15 15:46:14 +00:00
Marcelo Araujo
84e29f233a Remove the null checker before free.
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D4549
2015-12-15 15:42:42 +00:00
Marcelo Araujo
474fa6a744 Remove wrong header and the NULL check before free().
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D4548
2015-12-15 15:41:09 +00:00
Marcelo Araujo
7433efffe3 EAGAIN handling for imsg_read.
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D4547
2015-12-15 15:37:58 +00:00
Baptiste Daroussin
60f466403f Show the enclosure name and id in sesutil map
Sponsored by:	Gandi.net
2015-12-15 13:01:14 +00:00
Christian Brueffer
9f9d157d82 Flesh out the SEE ALSO section.
PR:		202929
Submitted by:	jhs@berklix.com
MFC after:	1 week
2015-12-14 15:44:34 +00:00
Baptiste Daroussin
96e6c444c3 Fix sesutil locate when a sesid is passed to locate command 2015-12-11 21:11:02 +00:00
Baptiste Daroussin
d7654478d3 sesutil: Add extra information specific to some SES devices to sesutil map
Rework stat2ascii preparing a buffer of what could be printed. This prevent the
risk of overflowing a static buffer.

Do not print those informations anymore in the "status" but into a new
"extra status" only printed if there are actually extra things to print.

Now add those extra informations:

* Thermal sensor temperature
* Cooling devices speed
* Voltage sensors, current consumption

Tested by:	AllanJude
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D4520
2015-12-11 20:45:39 +00:00
Ed Maste
c8daf7a00f crunchide: add RISC-V to supported machine types
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-12-11 13:55:31 +00:00
Baptiste Daroussin
f57605fb7d sesutils, pass the correct element type when printing the status of a given
element of the ses.

Sponsored by:	Gandi.net
2015-12-11 11:08:00 +00:00
Baptiste Daroussin
845614cd22 sesutil: fix map not printing the status of the LED device in an array
Sponsored by:	Gandi.net
2015-12-11 10:58:26 +00:00
Warner Losh
493b2041d6 Augment kldxref to find the new MODULE_PNP_INFO records now in
modules, simplify them into a more normal form and write them to
linker.hints.

Differential Review: https://reviews.freebsd.org/D3461
2015-12-11 05:27:55 +00:00
Randall Stewart
eef0660a7f Fix several typos and bugs within pmcstudy. Also highlight the one SB test
that is failing (and is likely a problem in the actual PMC defintions). Add
to this also the -A option to run all canned tests.

Sponsored by:	Netflix Inc.
2015-12-10 01:52:29 +00:00
Randall Stewart
385e27bfab Update the manual page to include Broadwell. 2015-12-09 21:54:33 +00:00
Randall Stewart
058ccb7564 White space changes. 2015-12-09 21:50:06 +00:00
Randall Stewart
ade40db3a2 Proper support of Broadwell tool by the pmc_study based on the
Intel Itune guide for 5th generation processors. There is at least
one formula missing in that guide, which I extrapolated and put a ? by
in the help.

Sponsored by:	Netflix Inc
2015-12-09 21:49:31 +00:00
Alan Somers
da61e79c42 When iostat(8) receives SIGINT while running with "-w" or "-c", it will now
print statistics one more time before exiting. Also, it now implements the
wait using setitimer instead of sleep, so the waits will be more consistent
when the system is heavily loaded.

MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4473
2015-12-09 18:07:26 +00:00
Bryan Drewery
b2fe867a0f DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2015-12-07 23:53:01 +00:00
Nathan Whitehorn
159ca5c844 Adapt to new wireless scheme where base wlan interfaces do not show up in
ifconfig anymore.
2015-12-06 00:20:45 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Bryan Drewery
7aab86d59d For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
the real build file.

This lessens the need to define DPADD_<lib> and LDADD_<lib> to just very
special cases.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:17 +00:00
Kenneth D. Merry
52c98bc2fd Fix typos in the camdd(8) usage() function output caused by an error in
my diff filter script.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-12-03 22:07:01 +00:00
Bryan Drewery
fea60e240e Convert to LIBADD
Sponsored by:	EMC / Isilon Storage Division
2015-12-03 21:16:52 +00:00
Bryan Drewery
f0f6270c40 Use proper LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-03 21:13:08 +00:00
Bryan Drewery
dbd87a2e37 DIRDEPS_BUILD: Connect usr.sbin/camdd
Sponsored by:	EMC / Isilon Storage Division
2015-12-03 21:13:05 +00:00
Kenneth D. Merry
a9934668aa Add asynchronous command support to the pass(4) driver, and the new
camdd(8) utility.

CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and
completed CCBs may be retrieved via the CAMIOGET ioctl.  User
processes can use poll(2) or kevent(2) to get notification when
I/O has completed.

While the existing CAMIOCOMMAND blocking ioctl interface only
supports user virtual data pointers in a CCB (generally only
one per CCB), the new CAMIOQUEUE ioctl supports user virtual and
physical address pointers, as well as user virtual and physical
scatter/gather lists.  This allows user applications to have more
flexibility in their data handling operations.

Kernel memory for data transferred via the queued interface is
allocated from the zone allocator in MAXPHYS sized chunks, and user
data is copied in and out.  This is likely faster than the
vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in
configurations with many processors (there are more TLB shootdowns
caused by the mapping/unmapping operation) but may not be as fast
as running with unmapped I/O.

The new memory handling model for user requests also allows
applications to send CCBs with request sizes that are larger than
MAXPHYS.  The pass(4) driver now limits queued requests to the I/O
size listed by the SIM driver in the maxio field in the Path
Inquiry (XPT_PATH_INQ) CCB.

There are some things things would be good to add:

1. Come up with a way to do unmapped I/O on multiple buffers.
   Currently the unmapped I/O interface operates on a struct bio,
   which includes only one address and length.  It would be nice
   to be able to send an unmapped scatter/gather list down to
   busdma.  This would allow eliminating the copy we currently do
   for data.

2. Add an ioctl to list currently outstanding CCBs in the various
   queues.

3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do
   that.

4. Test physical address support.  Virtual pointers and scatter
   gather lists have been tested, but I have not yet tested
   physical addresses or scatter/gather lists.

5. Investigate multiple queue support.  At the moment there is one
   queue of commands per pass(4) device.  If multiple processes
   open the device, they will submit I/O into the same queue and
   get events for the same completions.  This is probably the right
   model for most applications, but it is something that could be
   changed later on.

Also, add a new utility, camdd(8) that uses the asynchronous pass(4)
driver interface.

This utility is intended to be a basic data transfer/copy utility,
a simple benchmark utility, and an example of how to use the
asynchronous pass(4) interface.

It can copy data to and from pass(4) devices using any target queue
depth, starting offset and blocksize for the input and ouptut devices.
It currently only supports SCSI devices, but could be easily extended
to support ATA devices.

It can also copy data to and from regular files, block devices, tape
devices, pipes, stdin, and stdout.  It does not support queueing
multiple commands to any of those targets, since it uses the standard
read(2)/write(2)/writev(2)/readv(2) system calls.

The I/O is done by two threads, one for the reader and one for the
writer.  The reader thread sends completed read requests to the
writer thread in strictly sequential order, even if they complete
out of order.  That could be modified later on for random I/O patterns
or slightly out of order I/O.

camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from
the pass(4) driver and also to send request notifications internally.

For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR)
per CAM CCB on the reading side, and a scatter/gather list
(CAM_DATA_SG) on the writing side.  In addition to testing both
interfaces, this makes any potential reblocking of I/O easier.  No
data is copied between the reader and the writer, but rather the
reader's buffers are split into multiple I/O requests or combined
into a single I/O request depending on the input and output blocksize.

For the file I/O path, camdd(8) also uses a single buffer (read(2),
write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list
(readv(2), writev(2), preadv(2), pwritev(2)) on writes.

Things that would be nice to do for camdd(8) eventually:

1.  Add support for I/O pattern generation.  Patterns like all
    zeros, all ones, LBA-based patterns, random patterns, etc. Right
    Now you can always use /dev/zero, /dev/random, etc.

2.  Add support for a "sink" mode, so we do only reads with no
    writes.  Right now, you can use /dev/null.

3.  Add support for automatic queue depth probing, so that we can
    figure out the right queue depth on the input and output side
    for maximum throughput.  At the moment it defaults to 6.

4.  Add support for SATA device passthrough I/O.

5.  Add support for random LBAs and/or lengths on the input and
    output sides.

6.  Track average per-I/O latency and busy time.  The busy time
    and latency could also feed in to the automatic queue depth
    determination.

sys/cam/scsi/scsi_pass.h:
	Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue
	and fetch asynchronous CAM CCBs respectively.

	Although these ioctls do not have a declared argument, they
	both take a union ccb pointer.  If we declare a size here,
	the ioctl code in sys/kern/sys_generic.c will malloc and free
	a buffer for either the CCB or the CCB pointer (depending on
	how it is declared).  Since we have to keep a copy of the
	CCB (which is fairly large) anyway, having the ioctl malloc
	and free a CCB for each call is wasteful.

sys/cam/scsi/scsi_pass.c:
	Add asynchronous CCB support.

	Add two new ioctls, CAMIOQUEUE and CAMIOGET.

	CAMIOQUEUE adds a CCB to the incoming queue.  The CCB is
	executed immediately (and moved to the active queue) if it
	is an immediate CCB, but otherwise it will be executed
	in passstart() when a CCB is available from the transport layer.

	When CCBs are completed (because they are immediate or
	passdone() if they are queued), they are put on the done
	queue.

	If we get the final close on the device before all pending
	I/O is complete, all active I/O is moved to the abandoned
	queue and we increment the peripheral reference count so
	that the peripheral driver instance doesn't go away before
	all pending I/O is done.

	The new passcreatezone() function is called on the first
	call to the CAMIOQUEUE ioctl on a given device to allocate
	the UMA zones for I/O requests and S/G list buffers.  This
	may be good to move off to a taskqueue at some point.
	The new passmemsetup() function allocates memory and
	scatter/gather lists to hold the user's data, and copies
	in any data that needs to be written.  For virtual pointers
	(CAM_DATA_VADDR), the kernel buffer is malloced from the
	new pass(4) driver malloc bucket.  For virtual
	scatter/gather lists (CAM_DATA_SG), buffers are allocated
	from a new per-pass(9) UMA zone in MAXPHYS-sized chunks.
	Physical pointers are passed in unchanged.  We have support
	for up to 16 scatter/gather segments (for the user and
	kernel S/G lists) in the default struct pass_io_req, so
	requests with longer S/G lists require an extra kernel malloc.

	The new passcopysglist() function copies a user scatter/gather
	list to a kernel scatter/gather list.  The number of elements
	in each list may be different, but (obviously) the amount of data
	stored has to be identical.

	The new passmemdone() function copies data out for the
	CAM_DATA_VADDR and CAM_DATA_SG cases.

	The new passiocleanup() function restores data pointers in
	user CCBs and frees memory.

	Add new functions to support kqueue(2)/kevent(2):

	passreadfilt() tells kevent whether or not the done
	queue is empty.

	passkqfilter() adds a knote to our list.

	passreadfiltdetach() removes a knote from our list.

	Add a new function, passpoll(), for poll(2)/select(2)
	to use.

	Add devstat(9) support for the queued CCB path.

sys/cam/ata/ata_da.c:
	Add support for the BIO_VLIST bio type.

sys/cam/cam_ccb.h:
	Add a new enumeration for the xflags field in the CCB header.
	(This doesn't change the CCB header, just adds an enumeration to
	use.)

sys/cam/cam_xpt.c:
	Add a new function, xpt_setup_ccb_flags(), that allows specifying
	CCB flags.

sys/cam/cam_xpt.h:
	Add a prototype for xpt_setup_ccb_flags().

sys/cam/scsi/scsi_da.c:
	Add support for BIO_VLIST.

sys/dev/md/md.c:
	Add BIO_VLIST support to md(4).

sys/geom/geom_disk.c:
	Add BIO_VLIST support to the GEOM disk class.  Re-factor the I/O size
	limiting code in g_disk_start() a bit.

sys/kern/subr_bus_dma.c:
	Change _bus_dmamap_load_vlist() to take a starting offset and
	length.

	Add a new function, _bus_dmamap_load_pages(), that will load a list
	of physical pages starting at an offset.

	Update _bus_dmamap_load_bio() to allow loading BIO_VLIST bios.
	Allow unmapped I/O to start at an offset.

sys/kern/subr_uio.c:
	Add two new functions, physcopyin_vlist() and physcopyout_vlist().

sys/pc98/include/bus.h:
	Guard kernel-only parts of the pc98 machine/bus.h header with
	#ifdef _KERNEL.

	This allows userland programs to include <machine/bus.h> to get the
	definition of bus_addr_t and bus_size_t.

sys/sys/bio.h:
	Add a new bio flag, BIO_VLIST.

sys/sys/uio.h:
	Add prototypes for physcopyin_vlist() and physcopyout_vlist().

share/man/man4/pass.4:
	Document the CAMIOQUEUE and CAMIOGET ioctls.

usr.sbin/Makefile:
	Add camdd.

usr.sbin/camdd/Makefile:
	Add a makefile for camdd(8).

usr.sbin/camdd/camdd.8:
	Man page for camdd(8).

usr.sbin/camdd/camdd.c:
	The new camdd(8) utility.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-12-03 20:54:55 +00:00
Baptiste Daroussin
8ab28c4e4b pw_checkname since the beginning if too strict on GECOS field,
relax it a bit so gecos can be used to store multibytes data.

This was unseen before FreeBSD 10.2 as this validation function was motly unused
since FreeBSD 10.2 the usage of this function has been generalized to improve
validation.

Reported by:	des
MFC after:	1 week
2015-12-02 22:35:25 +00:00
Baptiste Daroussin
c514e5a523 Fix handling of numeric-only names with pw lock
Add a regression test about it

PR:		204968
MFC after:	1 week
2015-12-02 22:01:37 +00:00
Bryan Drewery
9728842cf3 META MODE: Connect MK_NAND directories.
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 05:31:01 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
cf990407e1 Update dependencies after r291406 added libelf to libkvm.
Unfortunately filemon/meta mode tracks all indirect dependencies here
since ld(1) is reading libelf when linking in libkvm.  Churn would be
reduced if this was able to be limited to direct dependencies.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:48 +00:00
Rick Macklem
3367fa32b1 Document the new "-manage-gids" option for the nfsuserd daemon.
This is a content change.

Suggested by:	jpaetzel
Tested by:	jpaetzel
MFC after:	2 weeks
2015-11-30 22:16:30 +00:00