Commit Graph

15935 Commits

Author SHA1 Message Date
melifaro
4fed811000 rtsock requests for deleting interface address lles started to return EPERM
instead of old "ignore-and-return 0" in r287789. This broke arp -da /
  ndp -cn behavior (they exit on rtsock command failure). Fix this by
  translating LLE_IFADDR to RTM_PINNED flag, passing it to userland and
  making arp/ndp ignore these entries in batched delete.

MFC after:	2 weeks
2015-09-27 04:54:29 +00:00
jpaetzel
bd730ad2f4 Increase group limit for kerberized NFSv4
PR:	202659
Submitted by:	matthew.l.dailey@dartmouth.edu
Reviewed by:	rmacklem dfr
MFC after:	1 week
Sponsored by:	iXsystems
2015-09-26 16:30:16 +00:00
bdrewery
2079a2c894 Revert r288268. Wrong change committed. 2015-09-26 14:27:21 +00:00
bdrewery
e0518d17d1 Hookup mkcsmapper_static and mkesdb_static for all but install.
These are only handled as 'build-tools' in Makefile.inc1.  This causes
'make clean' from the top of the tree to not clean the directories.  It also
effectively has kept them disconnected and risks them bitrotting.  The
buildworld process never cleans them either.

Connect them so they will always be built, cleaned, etc, but never installed.

Discussed with:	imp (briefly)
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 14:26:08 +00:00
bdrewery
8f7e12f5af Add more SUBDIR_PARALLEL.
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 14:13:51 +00:00
mav
70f018005e Remove some duplicate, legacy, dead and questionable code. 2015-09-26 11:28:45 +00:00
emaste
413dafc9c4 Build ofwdump(8) on MIPS too
It will be useful as FDT sees increasing usage on FreeBSD/mips.

Sponsored by:	DARPA, AFRL
2015-09-25 20:26:59 +00:00
bdrewery
459799dc3d META_MODE: Remove DEP_MACHINE from Makefile.depend files.
This has not been needed since r246865 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:44:01 +00:00
bdrewery
8b983366ab META_MODE: Checkin a proper Makefile.depend.
Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:33:38 +00:00
bdrewery
f37faa57f7 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
jpaetzel
003e64c1ef Fix typo.
Sponsored by:	iXsystems
2015-09-25 03:46:06 +00:00
bdrewery
71fccfc30f Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
amdmi3
e84416dd44 Fix crash on parsing some inf files
ndiscvt uses 16 entry array for words into which it parses
comma-separated lists of strings, like AddReg line in

    [somesection]
        AddReg = foo.reg, bar.reg, baz.reg, quiz.reg

Overflows were not checked so it crashed on a line with 17 words
encountered in some Broadcom/Dell Wireless 1704 802.11b-g-n driver

So extend the array up to 32 entries and add an overflow check.

Reviewed by:	bapt
Approved by:	bapt
MFC after:	2 weeks
Differential Revision:	D3713
2015-09-22 16:59:41 +00:00
jkim
d8c7e0bbfa Remove unsupported S5 (power off) state since r170976.
Reported by:	Iam Smith (smithi at nimnet dot asn dot au)
MFC after:	3 days
2015-09-22 16:35:32 +00:00
cem
d588782054 ngctl dot: Drop invalid trailing semi-colon
PR:		203257
Submitted by:	Daniel O'Connor
Sponsored by:	EMC / Isilon Storage Division
2015-09-22 01:31:01 +00:00
mav
e968ae531f Make cltd ignore HA ports. 2015-09-21 10:27:30 +00:00
hrs
9217785474 - Remove unused union p_un.
- Use NI_MAXHOST-long buffer for getnameinfo().
  Although INET6_ADDRSTRLEN was designed to hold the longest
  IPv6 address in IPv4-mapped address format a long time ago,
  getnameinfo() can return scope identifier in addition to it.

MFC after:	1 day
2015-09-19 23:48:06 +00:00
hrs
640e18a8e1 - Fix a crash on a rpc entry when an IPv6 address is explicitly specified
in -a flag.

- Fix a bug that sockaddr_in was used where sockaddr_in6 should have
  been used.  This was not actually harmful because offsetof(struct
  sockaddr_in, sin_port) is equal to offsetof(struct sockaddr_in6,
  sin6_port).

MFC after:	1 day
2015-09-19 23:27:22 +00:00
delphij
50393939f1 'sin' is never used after assignment. Looking at the context, it seems
that it belongs the commented out section of code so make it part of that
section.

Reported by:	clang static analyzer
MFC after:	2 weeks
2015-09-19 20:12:53 +00:00
allanjude
006bc6579c Rename some functions and variables inside sesutil(8) to make gcc happy
Reported by:	bz
Approved by:	bapt (implicit)
Sponsored by:	ScaleEngine Inc.
2015-09-19 18:41:24 +00:00
bdrewery
dfc33083c5 Connect sesutil(1) and numactl(1) for META_MODE.
Sponsored by:	EMC / Isilon Storage Division
2015-09-19 17:47:36 +00:00
allanjude
be1e5390b1 Improve and expand sesutil(8)
- Return an error if no matching device is found when the locate command is run
- Enhance the locate command to be able to address drive bays with no disk, or where the SES controller has not made the mapping to the device name
- Added the fault command, similar to locate, but a different SES property. On some of my controllers locate blinks the activity light, others the fault light. The fault command keeps the fault light on constant.
- Improve the usage() output and use it everywhere
- Added the map command, displays all elements connected to each (or the specified) ses(4) controller
- Added the status command, returns the overall status of the ses(4) controller

Reviewed by:	wblock (man page, earlier version)
Approved by:	bapt (mentor)
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3580
2015-09-19 16:36:45 +00:00
bdrewery
070dfcc90f Replace afterinstall: hack from r54681 with 'make delete-old' functionality.
Sponsored by:	EMC / Isilon Storage Division
2015-09-19 03:51:19 +00:00
bdrewery
e27c20e7fb Remove redundant beforeinstall. 2015-09-18 23:34:47 +00:00
delphij
89dceb6a3f Eliminate unneeded copying of vdev data, goto, etc. and add a note
that checksum of vdev label should be checked (which is not done
currently).

No functional change.

While I'm there, raise WARNS to 2.

Reviewed by:	allanjude
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3508
2015-09-17 20:55:47 +00:00
delphij
45de056048 Use strlcpy() instead of strncpy() because subsequent mkstemps expects
the string be nul-terminated.

Reviewed by:	neel
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3685
2015-09-17 18:11:26 +00:00
bdrewery
bdebc05d94 Update META_MODE dependencies. 2015-09-17 05:06:34 +00:00
des
76309d54d2 If forwarders were specified on the command line, create an empty
resolvconf.conf so that resolvconf won't replace the manually configured
forwarders with dynamically configured ones the next time the lease is
renewed.
2015-09-16 23:09:31 +00:00
allanjude
a0b376093c Add a number of models to the bsdinstall GPT hack blacklist
PR:		194359
Approved by:	bapt (mentor)
MFC after:	2 weeks
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3525
2015-09-16 03:32:27 +00:00
mav
6e36742bfe Add ctl-lun config option for consistency in HA setups. 2015-09-15 13:37:48 +00:00
zbb
3eb40986b7 Perform I2C transmission in a single burst when mode is "none" or not set
Some more automated I2C controllers cannot explicitly create
START/STOP/etc. conditions on the bus.
Instead, the correct condition is set automatically according
to the pending transfer status.
This particular behavior can cause trouble if some I2C slave
requires sending address offset within the chip followed by
the actual data or command. In that case we cannot assume that
the driver will not STOP immediately after sending
offset.

To avoid that, do not split offset transfer from data transfer
for default transmission modes and do exactly that if requested
in command line (stop-start and repeated-start modes).
This more generic approach should cover special cases like
the one described.

Reviewed by:   imp
Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
2015-09-15 11:21:16 +00:00
dteske
ac9abcb30c Fix code typo (no functional change)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-14 21:26:48 +00:00
bapt
7322dfff51 Regression: fix usershow -7
Submitted by:	Dan McGregor (via IRC)
MFC after:	2 days
2015-09-14 19:23:00 +00:00
mav
7b4b3f9d39 Add negotiation of iSCSIProtocolLevel to 2 (RFC7144).
We may need to pass negotiated value to kernel level, but so far it is
not necessary, since it does not use any new features without request.
2015-09-13 20:58:22 +00:00
mav
7e1bc451f0 When updating port, apply only change of LUN map, not whole. 2015-09-13 15:08:06 +00:00
mav
ceb1e1488d CTL documentation update, mostly for HA. 2015-09-12 10:23:23 +00:00
bapt
951f381262 Regression: fix pw usermod -d
Mark the user has having been edited if -d option is passed to usermod and
so the request change of home directory actually happen

PR:		203052
Reported by:	lenzi.sergio@gmail.com
MFC after:	2 days
2015-09-12 08:24:25 +00:00
dteske
5e11e37006 Replace `return' outside of function with exit
MFC after:	3 days
X-MFC-to:	stable/10
Pointy hat to:	me
2015-09-11 21:18:21 +00:00
dteske
d84010cd10 Use a variable for readability
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:14:48 +00:00
dteske
336ab64092 Update copyright
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:13:34 +00:00
dteske
d06c7f4aee Better to reset trap and explicitly exit success
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:12:41 +00:00
dteske
cf27eb785e Remove trailing newline at EOF
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:09:39 +00:00
dteske
619846e1ef Produce meaningful exit code
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:08:46 +00:00
dteske
b7553a37e9 Explicitly exit with success
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:01:26 +00:00
dteske
41e091074a Explicitly exit with success
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:59:13 +00:00
dteske
4f2a0e318f Update copyrights
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:58:00 +00:00
dteske
5e54510dd0 Produce meaningful exit code
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:56:36 +00:00
dteske
5bd4f328a6 Remove use of return outside of function
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:45:41 +00:00
dteske
bc7a1b0134 Ignore error results from newaliases(1)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:39:41 +00:00
delphij
85e8cd9339 Use strlcpy() in favor of strncpy() as it's defined to have a nul character
at the end of string buffer, and the code context do expects this to behave
correctly (e.g. strchr).

Note that we do not believe there is real-world impact for gstat(8)'s usage
because the strings are length checked, and the on-stack buffer belongs to
main() and we can expect to have zeros in them.

MFC after:	2 weeks
2015-09-11 06:52:57 +00:00
mav
1d4ff31d06 Remove unused target and initiator IDs. 2015-09-10 10:46:21 +00:00
hrs
f39d1c8c53 - Remove #ifdef HAVE_POLL_H.
- Use nitems().

MFC after:	3 days
2015-09-10 06:40:28 +00:00
takawata
1f333be9cd fix compare argument for address type.
Submitted by: issei10193 (via Twitter)
2015-09-09 13:24:39 +00:00
jkim
f9bfc1cae4 Revert r287578. This patch requires more review.
Requested by:	adrian
2015-09-08 23:17:02 +00:00
allanjude
8779e55553 Add an additional check to service(8) -e incase rcvar is blank
Approved by:	bapt (mentor)
X-MFC-With:	287576
Differential Revision:	https://reviews.freebsd.org/D3604
2015-09-08 22:50:17 +00:00
bapt
390f3fc8ff Remove extra debug that crept in 2015-09-08 22:24:20 +00:00
bapt
57a6813e1e Implement pubkey support for the bootstrap
Note that to not interfer with finger print it expects a signature on pkg itself
which is named pkg.txz.pubkeysign

To genrate it:
echo -n "$(sha256 -q pkg.txz)" | openssl dgst -sha256 -sign /thekey \
    -binary -out ./pkg.txz.pubkeysig

Note the "echo -n" which prevent signing the '\n' one would get otherwise

PR:		202622
MFC after:	1 week
2015-09-08 21:25:36 +00:00
jkim
61177b5cd0 Enable 802.11n support.
PR:		164102
2015-09-08 21:04:33 +00:00
jkim
673603781f Sort and remove duplicate compiler flags.
MFC after:	3 days
2015-09-08 20:41:47 +00:00
allanjude
7f8c7d805b service(8) -e does not respect /etc/rc.conf.d/* entries
PR:		173454
Submitted by:	giantlock@gmail.com (original patch)
Approved by:	bapt (mentor)
MFC after:	1 week
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3600
2015-09-08 20:22:51 +00:00
bapt
7519c8e26a Fix indentation, no functional changes 2015-09-08 19:25:15 +00:00
mav
0bc1e39132 Add two new portal group options "tag" and "foreign".
They are going to be useful in clustered setups.
2015-09-07 13:43:05 +00:00
bapt
50ceb9f7c2 Prefer pciids database from ports if present
Given the pciids database on ports is updated more often than the one in base
prefer this version if present, otherwise read the one from base.

MFC after:	1 week
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D3391
2015-09-06 20:05:29 +00:00
ngie
b198bf28c2 Parallelize the usr.sbin/ntp subdirectory build
Articulate all needed dependencies for the subdirectories

MFC after: 1 week
2015-09-06 18:58:33 +00:00
mav
037d401b2c Allow LUN options modification via CTL_LUNREQ_MODIFY.
Not all changes take effect, but that is a different question.
2015-09-06 11:23:01 +00:00
bapt
1933476d25 Yet another fix for gcc 4.2 2015-09-05 22:33:40 +00:00
bapt
9dfaf9b47b Remove extra i++
Reported by:	allanjude@
2015-09-05 21:55:01 +00:00
bapt
791763d67e Fix build with gcc 4.2
Reported by:	kib
2015-09-05 16:59:30 +00:00
bapt
eaf711e5bd Add a new sesutil(8) utility
This is an utility for managing SCSI Enclosure Services (SES) device.

For now only one command is supported "locate" which will change the test of the
external LED associated to a given disk.

Usage if the following:
sesutil locate disk [on|off]

Disk can be a device name: "da12" or a special keyword: "all".

Reviewed by:	mav
MFC after:	1 month
Relnotes:	yes
Sponsored by:	gandi.net
Differential Revision:	https://reviews.freebsd.org/D3544
2015-09-05 00:06:01 +00:00
cy
06704b6128 Turn on RAWDCF by default.
Suggested by:	ian
Approved by:	roberto
MFC after:	1 week
2015-09-04 16:59:01 +00:00
mav
57f927630c Another addition to r287455. 2015-09-04 10:16:21 +00:00
mav
ab2fecaad6 Addition to r287455. 2015-09-04 10:14:58 +00:00
trasz
7a19b70f33 Use proper term in the ctld(8) and iscsid(8) man pages.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-03 11:43:56 +00:00
trasz
6534f807e4 Simplify the introductory example in ctl.conf(5) down to absolute
basics.  The more complicated cases - like how to use physical
ports - are explained later, in the "EXAMPLES" section.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-03 11:42:59 +00:00
araujo
c12d2cd4bc Rename YP to NIS in the manpages.
Approved by:		bapt (mentor)
Differential Revision:	D3555
2015-09-03 07:18:52 +00:00
araujo
e4a962650c Sync with the latest code from OpenBSD.
Approved by:		rodrigc (mentor)
Differential Revision:	D3550
2015-09-03 07:12:40 +00:00
dteske
13f4f3ba5b Fix mandoc(1) "WARNING: end of line whitespace"
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-03 03:58:59 +00:00
dteske
f2a4a0206d Remove non-functional examples.
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-03 03:29:44 +00:00
delphij
93aa277f11 Don't leak 'var'.
Reported by:	clang static analyzer
2015-09-03 01:15:23 +00:00
dteske
81fc8f528c Minor code cleanups (no functional changes).
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-02 21:53:48 +00:00
trasz
c05bbe4d23 It's 2015, and some people are still trying to use fdisk and then
go asking what debug flags to set for GEOM to make it work.  Advice
them to use gpart(8) instead.

Something similar should probably done with disklabel,
but I need to rewrite the disklabel examples first.

Reviewed by:	wblock@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3315
2015-09-02 14:08:43 +00:00
dteske
bc8e82466a Bump version for altered long-opts processing
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 22:39:09 +00:00
dteske
e5e9551177 Simplify long-option processing
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 22:37:33 +00:00
dteske
b13e78aa16 Bump version for prior fix (SVN r287381)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:52:56 +00:00
dteske
e4210d1e2c Style: Remove whitespace around brackets from function syntax options
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:50:55 +00:00
dteske
5acd37bdec Comment for escape() function.
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:48:22 +00:00
dteske
21e840d426 Comment
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:42:00 +00:00
dteske
4518a723b5 Properly escape arguments when moving into jail or chroot
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:40:04 +00:00
dteske
ce88023a5f Style: comments
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:20:43 +00:00
dteske
7038f658a3 Style consistency: add single space before each `;;' case entry
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:19:45 +00:00
dteske
c30ef0a161 Remove `SYSRC_' prefix from $SYSRC_VERBOSE (prefix unnecessary since
this is a non-inheritable attribute; was previously).

MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:18:33 +00:00
jhb
5fbb8e5fa1 Fix an off by one error in r283613: Like regular ffs(), CPU_FFS() returns
1 for CPU 0, etc. so the return value must be decremented to obtain the
first valid CPU ID.

Submitted by:	fabient
MFC after:	1 week
2015-09-01 17:52:43 +00:00
delphij
b440f05ba4 Check and fail if drop of privileges failed.
MFC after:	2 weeks
2015-09-01 06:32:02 +00:00
delphij
d87fa0603a die() would never return, mark it as so.
MFC after:	2 weeks
2015-08-27 18:11:00 +00:00
delphij
12b0d76c86 Plug a possible memory leak.
MFC after:	2 weeks
2015-08-27 06:28:42 +00:00
jkim
0481c185aa Merge ACPICA 20150818. 2015-08-26 17:13:47 +00:00
araujo
3ddee62f4a Sync ypwhich(1) code with the OpenBSD version that is more modern.
Update the BSD LICENSE and remove the 3rd clause.

Reviewed by:	rodrigc, kib, bapt
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	D3249
2015-08-25 15:27:32 +00:00
trasz
4b25d224c2 Some random tweaks to ctl.conf(5).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-08-24 09:33:12 +00:00
hrs
ad4e7c1533 Add static and remove unused variables. 2015-08-24 05:38:05 +00:00
hrs
b4423205ce Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support. 2015-08-24 05:28:23 +00:00
imp
b894886061 Make it clear that we're ignoring the return value fread(3). All
errors that might happen here will be reported a few lines down.

CID: 1295248
2015-08-24 00:34:09 +00:00
bapt
43164ff2ed Fix err pointer not initialized to NULL resulting
Reported by:	"O. Hartmann" <ohartman@zedat.fu-berlin.de>
2015-08-21 14:28:14 +00:00
imp
b4161cb415 Turn off gcc's uninitialized warnings for this code. They
can be fixed, but really do appear to be false alarms.
2015-08-21 14:15:54 +00:00
bapt
e991a153bd Fix typo in regression test 2015-08-21 11:25:42 +00:00
bapt
d36fba16cb Fix /home symlink creation
Add regression test about it
2015-08-21 09:28:20 +00:00
bapt
75130e0bf3 Fix useradd regression:
Readd the function to create the parents home directory if it does not exists.
if it is only a directory at the top level of the hierarchy symlink it into /usr
as it used to be done before.

Reported by:	kevlo, adrian
2015-08-21 07:09:53 +00:00
asomers
0d991011ea Add ATF functional tests for fstyp(8). No ZFS or GELI tests yet.
Reviewed by:	trasz, ngie
MFC after:	2 weeks
Sponsored by:	SpectraLogic
Differential Revision:	https://reviews.freebsd.org/D2801
2015-08-20 15:37:47 +00:00
ian
3cfb379fe2 Add a new exit-timeout option to watchdogd.
Watchdogd currently disables the watchdog when it exits, such as during
rc.shutdown processing.  That leaves the system vulnerable to getting hung
or deadlocked during the shutdown part of a reboot.  For embedded systems
it's especially important that the hardware watchdog always be active.  It
can also be useful for servers that are administered remotely.

The new -x <seconds> option tells watchdogd to program the watchdog with the
given timeout just before exiting.  The -x value can be longer or shorter
than the -t normal time value, to allow for various exceptional conditions
at shutdown such as allowing extra time for buffer flushing.

The exit value is also used internally in the "failsafe" handling (which
used to just disable the watchdog), on the theory that if you're using this
option, "safe" means having the watchdog always running, not disabled.

The default is still to disable the watchdog on exit if -x is not specified.

Differential Revision:	https://reviews.freebsd.org/D2556 (timed out)
2015-08-19 21:46:12 +00:00
delphij
671f0b94de Issue warning and refuse to proceed further if the configured
repository signature_type is unsupported by bootstrap pkg(7).

Previously, when signature_type specified an unsupported method,
the bootstrap pkg(7) would proceed like when signature_type is
"none".  MITM attackers may be able to use this vulnerability and
bypass validation and install their own versions of pkg(8).

At this time, only fingerprint and none are supported by the
bootstrap pkg(7).

FreeBSD's official pkg(8) repository uses the fingerprint method
and is therefore unaffected.

Errata candidate.

Discussed with:	bapt@
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
2015-08-19 18:24:39 +00:00
asomers
b1d32f9864 Serve /etc/eui64 via NIS.
The C library already knows how to lookup eui64 entries from NIS. For
example, fwcontrol(8) does it. But /var/yp/Makefile.dist doesn't build the
eui64 maps, and ypinit(8) doesn't push them to slaves. This change fixes
that.

Reviewed by:	brooks, wblock
MFC after:	2 weeks
Sponsored by:	SpectraLogic Corp
Differential Revision:	https://reviews.freebsd.org/D3404
2015-08-18 15:33:23 +00:00
glebius
156842dd3e Belatedly fix documentation on which interface to use as argument. 2015-08-17 09:18:54 +00:00
grehan
9d08caeba8 Add simple (no-op) emulations for the CHECK_POWER_MODE,
READ_VERIFY and READ_VERIFY_EXT commands.

Reviewed by:	mav
2015-08-17 05:59:36 +00:00
mav
c9d448ea79 Drop "internal" CTL frontend.
Its idea was to be a simple initiator and execute several commands from
kernel level, but FreeBSD never had consumer for that functionality,
while its implementation polluted many unrelated places..
2015-08-15 13:34:38 +00:00
bapt
d8c0f52c74 Regression: fix pw usermod -w xxx
Reported by:	gjb
2015-08-14 13:39:55 +00:00
bapt
3f66ce6962 Fix buildworld
Sponsored by:	gandi.net
2015-08-14 10:17:52 +00:00
brueffer
2dc82f9774 Fix a few mandoc warnings.
MFC after:	1 week
2015-08-12 10:34:05 +00:00
mav
a4e4af47b0 Another small typo.
MFC after:	3 days
2015-08-11 09:00:27 +00:00
mav
f292c98681 Fix minor typo.
MFC after:	3 days
2015-08-11 08:58:00 +00:00
araujo
d07c9e53e5 style(9) requires a space here. 2015-08-11 01:45:17 +00:00
araujo
69588e0782 Sync the code with OpenBSD.
Remove 3rd BSD clause.

Differential Revision:	D3289
Approved by:		bapt (mentor)
Obtained from:		OpenBSD
2015-08-11 01:33:36 +00:00
bz
8c2e5e5995 Rather than hardcoding a string and limiting the comparison to these
characters use the defined constant so that in case of change this
would not break.

Reviewed by:		allanjude
Differential Revision:	https://reviews.freebsd.org/D3340
MFC after:		2 weeks
2015-08-10 10:29:32 +00:00
ed
208fb6e96d Remove bad call to shutdown().
The socket created by rtsol/rtsold is not a connection-based socket,
meaning that we should not attempt to call shutdown() on it.

Reported by:	kan
2015-08-10 07:45:13 +00:00
mav
35adb2b287 Refactor early stages of security negotiation.
MFC after:	2 weeks
2015-08-08 19:04:37 +00:00
mav
2039dd9ad4 Remove some code duplication.
MFC after:	1 week
2015-08-08 16:39:28 +00:00
brueffer
94936bfa1d Manpage cleanup.
- new sentence -> new line
- fix manpage references
- fix macro usage
- fix a typo

MFC after:	1 week
2015-08-07 10:48:52 +00:00
bapt
f8f56ae6ef Add regression tests for a bug reported in stable/10
While pw(8) on head is not affected it is worth adding more regression tests
ensuring this bug will not happen unnoticed in the futur
2015-08-05 21:11:32 +00:00
ngie
15c1eedd90 Set f_file to -1/F_UNUSED when after closing when possible
This will help ensure we don't trash file descriptors that get used later on
in the daemon

Found via internal Coverity scan

MFC after: 2 weeks
Discussed with: cem, ed, markj
Differential Revision: https://reviews.freebsd.org/D3081
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2015-08-05 03:17:06 +00:00
svnmir
c5e8194f33 Ensure the local MANIFEST is always used when verifying remote
distribution sets.

MFC after:	immediately
Sponsored by:	The FreeBSD Foundation
2015-08-04 13:40:26 +00:00
ed
08ce46330f Avoid calling strlen() where we can use the strspn() return value. 2015-08-03 22:07:50 +00:00
dteske
ce892f6643 Clarify pw(8) manual w/respect to required arguments. Break long lines at
punctuation while here.

Differential Revision:	https://reviews.freebsd.org/D2700
Reviewed by:	wblock, bapt
MFC after:	3 days
X-MFC-to:	stable/10
2015-08-03 21:19:31 +00:00
bapt
eb6ff5c8b3 Fix bugs spotted by gcc
Reported by:	adrian
2015-08-03 06:06:56 +00:00
adrian
a01e37a027 Actually set quiet to something.
/usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next':
/usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect
2015-08-03 05:59:30 +00:00
bapt
9a7989cc8d Use intmax_t rather than long long 2015-08-02 19:49:24 +00:00
bapt
e969e86e40 Convert the year used for regression test fro 2043 to 2037
This makes the regression tests pass on systems where time_t is 32bits
2015-08-02 18:20:36 +00:00
bapt
069c5cd075 Fix build on 32bits 2015-08-02 13:50:11 +00:00
bapt
2c026ebb5c Split some extra long lines 2015-08-02 13:33:17 +00:00
bapt
2cfaa818a1 Split some extra long lines 2015-08-02 13:32:23 +00:00
bapt
4469579834 Cleanup a bit includes 2015-08-02 13:22:46 +00:00
bapt
8ca0483df0 Add regression tests about adding already existsing groups/users 2015-08-02 13:02:53 +00:00
bapt
4453f16adb Fix regression: report if a group already exists when creating it 2015-08-02 12:56:25 +00:00
bapt
521095bbe7 Fix regression: report again if a username already exists when creating it 2015-08-02 12:54:15 +00:00
bapt
1890bfce80 Remove dead code 2015-08-02 12:48:36 +00:00
bapt
4f6bdcfb5d Rewrite parsing subcommands arguments of pw(8)
Now each subcommands checks its arguments in a dedicated functions.

This helps improving input validation, code readability/maintainability
While here:
- Add a -y option to pw userdel/usermod so it can maintain NIS servers if
  nispasswd is not defined in pw.conf(5)
- Allow pw -r <rootdir> to remove directory with userdel -r
- Fix bug when renaming a user which was not renaming the user name it groups
  it is a member of.
- Only parse pw.conf(5) when needed.
2015-08-02 12:47:50 +00:00
scottl
97b5d9b50f Iniital hack of mpsutil 2015-08-02 03:52:51 +00:00
bapt
f78f701a2d Remove netbsd tests on pw(8)
First they are redundant with the tests we currently have on pw(8)
Second they to modify the host database instead of being self contained withing
the test directory
2015-08-02 00:33:34 +00:00
bapt
e83b0ae9f0 Remove things that crept in after badly checked revert 2015-08-01 12:20:55 +00:00
bapt
8fa8b523a2 Partial revert of r286152
More work needed on the cli validation
2015-08-01 12:18:48 +00:00
bapt
353f021396 Fix build 2015-08-01 11:52:48 +00:00
bapt
626fd041e6 Fix formatting of new code
Fix sorting or errstr
Remove useless initialisation or errstr

Reported by:	bde
2015-08-01 11:31:59 +00:00
bapt
dff11a9b7f Revert r286148 2015-08-01 10:40:17 +00:00
bapt
9a71628c9f Validate expiration days and password days from commmand line and pw.conf 2015-08-01 10:25:55 +00:00
bapt
10ba8e17a1 Validate the max_uid/max_gid boundaries and entry type in pw.conf 2015-08-01 10:10:13 +00:00
bapt
5acf1473e1 Cast uid/git to uintmax_t when using printf-like functions so the size of
uid/gid size remains a implementation detail
2015-08-01 09:55:47 +00:00
bapt
ae91558e00 Handle +:*:: the same way we handle +::: when checking group file
The first is what the documentation recommands for NIS client
2015-08-01 08:39:55 +00:00
bapt
32471dd33a Use strtoumax instead of strtoul 2015-08-01 08:35:20 +00:00
bapt
1567d1bb44 Improve strtounum
Fix many style bugs
Better variable naming
Use C99 'restrict' were apropriate
Fix potential errno race

Submitted by:	bde
2015-07-30 06:14:47 +00:00
bapt
d7ee5ad52d Cleanup includes 2015-07-29 23:26:18 +00:00
bapt
b34a90165d Actually set the proper license
Reported by:	trasz
2015-07-29 22:51:54 +00:00
bapt
dc24acf353 Actually add the new code 2015-07-29 06:23:06 +00:00
bapt
4eb9f59af4 Create a strtounum function using the same API as strtonum
This function returns uintmax_t
Use this function to convert to gid_t/uid_t
2015-07-29 06:22:41 +00:00
bapt
5d01982f6b Reject usermod and userdel if the user concerned is not on the user database
supposed to be manipulated

This prevent pw usermod creating a new local user when requesting to usermod on
a username is defined in LDAP.

This issue only happens when modifying the local user database (not inpacting
commands when -V or -R are used).

PR:		187653
Submitted by:	tmwalaszek@gmail.com
2015-07-28 21:49:38 +00:00
bdrewery
36fb21bb92 Fix rescue build after r284356 with STRIP= by using proper STRIPBIN per build(7).
This was causing the following error:

  rescue
  sh: rescue: not found
  *** [rescue] Error code 127

  make[1]: stopped in /usr/obj/usr/src/rescue/rescue

Sponsored by:	EMC / Isilon Storage Division
2015-07-28 21:39:58 +00:00
bapt
ae6e75a036 Check uid/gid used when creating a user/group are not larger than UID_MAX/GID_MAX
PR:		173977
Reported by:	nvass@gmx.com
2015-07-28 21:10:58 +00:00
bapt
39f3813b41 Fix wrong warning printed after changing or updating NIS users
PR:		37672
Submitted by:	chris+freebsd@chrullrich.de
2015-07-28 20:52:10 +00:00
bapt
6a2604d875 when -n is passed to any pw subcommand it is always expected to be considered as
a name so do not try to convert it to an id if it is a numeric value

PR:		31933
Reported by:	ted@impulse.net
Sponsored by:	gandi.net
2015-07-28 12:20:57 +00:00
araujo
fafebceb9b Staticfy and constify some variables and clean up the code a bit to make it
more readable. No functional change.

Differential Revision:	D3166
Reviewed by:		kib
Sponsored by:		gandi.net
2015-07-28 02:32:40 +00:00
dru
e4e49c92c2 Fix transposed words in man page.
PR: 201752
Reviewed by: bcr
MFC after: 3 days
Sponsored by: Essen FreeBSD Hackathon
2015-07-25 11:10:49 +00:00
jkim
4bfe3da642 Merge ACPICA 20150717. 2015-07-22 16:25:07 +00:00
allanjude
3caf9cf5e3 Add the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT active workaround
PR:		194359
Requested by:	sbruno, hiren
Approved by:	marcel
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3139
2015-07-21 00:33:15 +00:00
pfg
a38006731b snmp_hostres(3): Fix buffer overflow.
Actually just a typo. Detected by gcc + FORTIFY_SOURCE patches.

CID:		1007594
MFC after:	3 days
2015-07-20 16:08:01 +00:00
delphij
4aef5eea88 Use fixed date/time (the time choosen was the time the import was done on
-HEAD) in libntp so we can make reproducible build.

PR:		bin/201661
Reviewed by:	gjb, cy, roberto
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D3122
2015-07-19 19:23:38 +00:00
araujo
61ced0e48d Add support to the jail framework to be able to mount linsysfs(5) and
linprocfs(5).

Differential Revision:	D2846
Submitted by:		Nikolai Lifanov <lifanov@mail.lifanov.com>
Reviewed by:		jamie
2015-07-19 08:52:35 +00:00
allanjude
c4c1f5e8fd Add support for two workarounds for known issues booting GPT in legacy mode on some hardware
For Lenovo laptops with buggy bios (x220, t420, t520):
	Write the 0xee entry into the second slot in the pmbr instead of the first

For some Dell and HP models:
	The BIOS gives a warning message when booting in legacy mode from a GPT partitioned disk where the 0xee partition in the pmbr is not flagged active
	For models known to have this problem, mark the pmbr active during installation

Use smbios data to identify machines known to be affected by any of the above, and offer the user the option to apply the workaround

In bsdinstall's ufs auto mode (autopart partition wizard):
	Allow users to select which type of partition table to use
	Keep current defaults: MBR for BIOS, GPT for UEFI
	This allows users to choose GPT for legacy boot if they wish

PR:		184910
PR:		194359
Reviewed by:	Michael Dexter
Approved by:	marcel
MFC after:	3 days
X-MFC-With:	r285594
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3091
2015-07-18 18:49:44 +00:00
trasz
082b3e36e1 fstyp(8) ships with 10.2.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-07-18 12:03:51 +00:00
trasz
3495f68b07 uefisign(8) ships with 10.2.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-07-18 12:03:17 +00:00
bapt
b6b17c200a make ctdladm(8) return 0 is everything was ok.
retval is used to test the return of XML_Parse function which is ok if 1 is
returned and retval it directly returned to the main function and used as an
exit value.

if all the parsing part is done reset retval to 0 so that the command return 0
if everything ok

Differential Revision:	https://reviews.freebsd.org/D3102
Reviewed by:	trasz
MFC after:	3 days
Sponsored by:	gandi.net
2015-07-17 19:10:43 +00:00
jhibbits
03f3b4766f Fix formatting. 2015-07-16 05:14:20 +00:00
araujo
ed4d6dbea2 Fix a warning spotted by gcc4.9: dereferencing type-punned pointer will break
strict-aliasing rules.

Declare some variables as statics as well as some functions that are internal
helpers. Update the function broadcast_result() to a post-K&R definition.

Differential Revision:	D2690
Reviewed by:		rodrigc, dim
2015-07-16 02:34:22 +00:00
allanjude
ee363f6cc4 Make bsdinstall's zfsboot script align partitions to 4k/1m when the user requests it
PR:		195174
Reviewed by:	darius
Approved by:	brueffer
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3062
2015-07-14 19:57:10 +00:00
allanjude
ad871e1603 Set a mountpoint on the root of the pool so user-created datasets have a mountpoint to inherit
Reviewed by:	darius
Approved by:	brueffer
MFC after:	3 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3063
2015-07-14 19:42:40 +00:00
allanjude
bdfe139887 Have bsdinstall's zfsboot script make /var/audit its own dataset, so it is not part of the OS boot environment
PR:		199864
Submitted by:	Jason Unovitch
Approved by:	brueffer
MFC after:	3 days
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D2861
2015-07-14 19:38:26 +00:00
allanjude
4067f24f01 Fix a typo in bsdinstall
A variable was misspelled resulting in chmod executing on the installer instead of on the target chroot

PR:		191402
Submitted by:	Martin Simmons <martin@lispworks.com>
Approved by:	brueffer
MFC after:	3 days
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3061
2015-07-13 17:40:24 +00:00
bapt
ba90467d76 Really fix -o 2015-07-13 09:12:05 +00:00
bapt
3137e99447 Add regression tests to ensure we keep allowing creating users with uid0 2015-07-13 09:09:09 +00:00
bapt
bfc5fcd1dc Regression fix: allow to create users with uid0
Reported by:	Jan Mikkelsen <janm@transactionware.com>
2015-07-13 09:08:27 +00:00
bapt
7f2e5a63d2 Fix logic of check duplicates that has been inverted 2015-07-13 09:07:38 +00:00
delphij
05fed0489a Bump version after 4.2.8p3 import.
Note: currently 'mkver' script is using hardcoded knowledge and always
emits -a in the version string, a more through solution would be to generate
the script with something that we own.
2015-07-12 23:32:23 +00:00
bapt
e657e72f8d Ensure skeldir is abolute path (relatively to the rootdir) 2015-07-12 22:08:58 +00:00
bapt
16b27ac1cf pw -R <rootdir> userdel can now cleanup installation
Rewrite rm_r to use *at function, allowing to remove home directories along with
users. only crontabs and at(1) installation are not removed

Relnotes:	yes
2015-07-12 21:43:57 +00:00
bapt
8621997ee9 Rework the home directory creation and copy or the skel content to use *at
functions

This allows to simplify the code a bit for -R by not having to keep modifying
path and also prepare the code to improve support -R in userdel

While here, add regression tests for the functionality
2015-07-12 20:29:51 +00:00
allanjude
7d5369ba8e Remove excess copyright lines propogated by copy/paste
Approved by:	trasz
2015-07-12 19:16:19 +00:00
jamie
4c3443274d Run a shell in the jail when no command is specified.
Add a new flag, -l, for a clean environment, same as jail(8) exec.clean.
Change the GET_USER_INFO macro into a function.

PR:		201300
Submitted by:	Willem Jan Withagen
MFC after:	3 days
2015-07-12 17:03:50 +00:00
bapt
084e0d801a Add minimum regression tests for pw -R 2015-07-12 09:42:10 +00:00
bapt
f15eb75bd0 Make getarg return NULL if args is NULL 2015-07-12 00:02:43 +00:00
bapt
2f9218d542 Fix regression: ensure when try to create the group and the user with the same
id if possible and nothing in particular was specified
2015-07-11 23:56:55 +00:00
bapt
13da2b2c87 Remove now unused variable 2015-07-11 23:17:13 +00:00
bapt
be61586cab Replace custom string array with stringlist(3) 2015-07-11 23:07:17 +00:00
bapt
a2b16f4acb Rework groupmod modification:
Use gr_add(3) when possible to avoid code duplication.
Use a simpler logic to delete members of a group
2015-07-11 22:35:07 +00:00
bapt
e3326739a7 Remove unused argument from pm_passwd 2015-07-11 21:12:28 +00:00
bapt
394857c344 check the gecos format early: at the moment the -c option is parsed 2015-07-11 21:09:50 +00:00