Commit Graph

16131 Commits

Author SHA1 Message Date
Enji Cooper
6cf8c0fe51 Revert r289694
I committed some other undesirable local changes by accident
2015-10-21 13:15:04 +00:00
Enji Cooper
b4c3ec123e Add some rudimentary [smoke] testcases for makefs
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-10-21 13:13:38 +00:00
Enji Cooper
42afd55d1e Unbreak makefs -t cd9660 after r289687
buffer_head needs to be freed -- not buffer

Detected by jemalloc, i.e. running makefs failed the arena assert
because my copy of malloc on CURRENT is compiled with the default
!MALLOC_PRODUCTION asserts on

Pointyhat to: ngie
PR: 203647
X-MFC with: r289687
Sponsored by: EMC / Isilon Storage Division
2015-10-21 12:54:15 +00:00
Enji Cooper
b73321f086 Free buffer before returning from cd9660_write_path_table to avoid
leaking it after returning from the function

MFC after: 1 week
PR: 203647
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 978431
Sponsored by: EMC / Isilon Storage Division
2015-10-21 11:38:48 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Maksim Yevmenkin
f32d9c4bd3 check boundaries while parsing SDP responses
Reported by:	hps
Reviewed by:	hps
MFC after:	1 week
2015-10-20 18:01:08 +00:00
Enji Cooper
d2a489eb1a Don't check if val is NULL before calling free; free(3) already
handles this

MFC after: 1 week
PR: 203649
Submitted by: Thomas Schmitt <scdbackup@gmx.net>
Coverity CID: 1305659
Sponsored by: EMC / Isilon Storage Division
2015-10-19 18:45:14 +00:00
Enji Cooper
0fbf8c6085 Initialize quiet to false so pw groupnext again prints out the next gid
by default

Reported by: Florian Degner <f.degner@gmx.de>
MFC after: 1 week
PR: 203876
Sponsored by: EMC / Isilon Storage Division
2015-10-19 18:29:32 +00:00
Rui Paulo
325151a32e Update hostapd/wpa_supplicant to version 2.5.
Tested by several people on current@/wireless@.

Relnotes:	yes
2015-10-18 21:38:25 +00:00
Baptiste Daroussin
c05f3be9a5 Remove the now not needed diff used to switch the tool from mps to mpr
Sponsored by:	Gandi.net
2015-10-16 09:37:15 +00:00
Baptiste Daroussin
9b51f8578a Fix some alignement in the output
Sponsored by:	Gandi.net
2015-10-15 17:16:17 +00:00
Baptiste Daroussin
5a92b27175 Add generic storage structure for both mpr and mps to simplify code
Use correct ioctl on mpr
Prevent duplication in headers between mps_ioctl.h and mpr_ioctl.h

Sponsored by:	Gandi.net
2015-10-15 15:51:40 +00:00
Baptiste Daroussin
3f4fe35d6c Correctly print the device name of the adapter
Sponsored by:	Gandi.net
2015-10-15 15:24:13 +00:00
Baptiste Daroussin
48f31f4fef Make mpsutil open the mpr devices when named mprutil
Make mprutil a hardlink to mpsutil

Sponsored by:	Gandi.net
2015-10-15 15:19:38 +00:00
Ed Maste
7e1ed2c72c Add debug file extension to freebsd-update(8) after r288176
Reviewed by:	delphij
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3784
2015-10-15 01:48:52 +00:00
Xin LI
a2668e8128 Use chroot(2) instead of using prefixes for files.
Previously, the code prefixes the chroot path to actual file paths to
simulate the effect.  This, however, will not work for tzset(3) which
expects the current system have a working set of timezone data files,
and that is not always the case.

This changeset simplifies the handling of paths and use an actual
chroot(2) call to implement the effect.

PR:		bin/197313
MFC after:	2 weeks
2015-10-13 22:55:17 +00:00
Rui Paulo
8ed645520e Fix two memory leaks in config(8).
PR:		202145
Submitted by:	Kurt Lidl <lidl pix.net>
2015-10-13 20:25:03 +00:00
Sean Bruno
24484ca4bf makefs(8) leaves sblock.fs_providersize uninitialized (zero) that can be easily
checked with dumpfs(8). This may lead to other problems, f.e. geom_label kernel
module sanity checks do not like zero fs_old_size value and skips such UFS1
file system while tasting (fs_old_size derives from sblock.fs_providersize).

PR:	203704
Submitted by:	eugen@grosbein.net
Reviewed by:	marcel
2015-10-13 17:00:14 +00:00
Adrian Chadd
a08b904c5e makefs: introduce a new option to specify what to round the resulting
image up to.

From ticket:

While trying to run FreeBSD/mips on some device having very small flash media,
one is forced to compress file system with mkulzma(8) utility. It is desirable
to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8)
and big compression block size like 65535 bytes to mkulzma at the same time.
Then one obtains very good comression ratios (like 75% and more) but faces
the following problem.

geom_uncompress kernel module reports GEOM provider size rounded up to its
compression block size. Generally, this changes original media size and now
it fails to match the size of embedded UFS file system that leads to other
problems, f.e. geom_label kernel module does not like this and skips the
file system while tasting the GEOM and looking for UFS label.

This makes it impossible to refer to the file system using known UFS label
instead of something like /dev/map/rootfs.uncompress.

The following patch introduces new command line option "-r roundup" for makefs
that makes it round up the image to specified block size. Hence, geom_uncompress
does not change GEOM media size for images rounded that way and geom_label
accepts such GEOMs just fine.

With the patch applied, one can use following commands:

$ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs
$ mkulzma -s 65536 -o fs.img.ulzma fs.img

PR:		bin/203707
Submitted by:	<eugen@grosbein.net>
2015-10-13 02:32:15 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Baptiste Daroussin
f98f68bd50 Use existing CONFDIR instead of adding a new CONFIGDIR
Reported by:	jbeich
2015-10-11 19:25:39 +00:00
Baptiste Daroussin
2c9976e37e Install bsd.confs.mk
Rename ETCDIR into CONFIGDIR to avoid conflicts with the ports tree
2015-10-10 10:48:09 +00:00
Baptiste Daroussin
23c7816115 Move ppp.conf into the ppp sources 2015-10-09 23:57:07 +00:00
Warren Block
6a3133efbb Fix a repeated typo: rootir -> rootdir.
Approved by:	bapt
MFC after:	1 week
2015-10-09 14:55:55 +00:00
Colin Percival
b39ce43e4c Add --currently-running <release> option to freebsd-update.
This option tells freebsd-update to act as if it is running a specific
release instead of querying the kernel.  In particular, this can be
useful when upgrading jails.

Requested by:	EuroBSDCon devsummit jails session
Tested by:	allanjude
MFC after:	1 week
2015-10-09 12:34:33 +00:00
Fabien Thomas
66ca84a7ba Fix for r288176 changes related to debug symbols move.
Reviewed by: emaste
Sponsored by:	Stormshield
2015-10-08 09:46:35 +00:00
Marcel Moolenaar
8c96dcc166 Add option -l for specifying which OS loader to dlopen(3). By default
this is /boot/userboot.so. This option allows for the development and
use of other OS loaders.
2015-10-08 02:28:22 +00:00
Xin LI
56160b2e67 Now that we own the code, use arc4random(3) unconditionally
and remove the corresponding HAVE_ARC4RANDOM conditions.

MFC after:	2 weeks
2015-10-06 23:42:58 +00:00
Xin LI
ec15b81be1 Use strlcpy() when the string is expected to be nul-terminated.
MFC after:	2 weeks
2015-10-06 22:49:25 +00:00
Xin LI
61fa58e525 Remove a few unused headers.
MFC after:	2 weeks
2015-10-06 22:45:23 +00:00
Hiroki Sato
c1d0909a53 Reallocate a maxlen-long buffer only when the current maxlen is
shorter than the required length.  Note that it rarely happens
because maxlen is almost always 128 which covers struct sockaddr_storage.
2015-10-06 08:43:48 +00:00
Peter Grehan
45b3ff5f61 Clean up some harmless unimplemented-command warning messages.
- Don't advertize trusted-computing capability in the Identify page.
  This prevents Windows from issuing a TRUSTED_RECEIVE_DMA command.
- Windows will send down SMART and SECURITY_FREEZE_LOCK
   even though smart and security capabilities were not advertized.
   Send back a silent abort.

Reviewed by:	mav
2015-10-05 14:57:45 +00:00
Peter Grehan
056e398239 Fix post-test typo that snuck in. 2015-10-02 22:05:51 +00:00
Peter Grehan
88ac695858 Simple sysctl-like firmware query interface. Similar in operation
to the qemu one, and uses the same i/o ports but with different
messaging. Requires the 'bootrom' option to be enabled.

This is used by UEFI (and potentially other BIOSs/firmware) to
request information from bhyve. Currently, only the number of
vCPUs is made available, with more to follow.

A very large thankyou to Ben Perrault who helped out testing
an earlier version of this, and bhyve/Windows in general.

Reviewed by:	tychon
Discussed with:	neel
Sponsored by:	Nahanni Systems
2015-10-02 21:09:49 +00:00
Xin LI
0ed633d0f8 Fix a regression with SA-15:24 patch that prevented NIS from
working.
2015-10-02 16:35:41 +00:00
Ed Maste
113a1a2139 Add debug file extension to kldxref(8) after r288176
After r288176 kernel debug files have the extension .debug.  They also
moved to /usr/lib/debug/boot/kernel by default so in the normal case
kldxref does not encounter them.  A src.conf(5) setting may be used to
continue installing them in /boot/kernel though, so have kldxref skip
.debug files in addition to .symbols files.

Reported by:	fabient
Sponsored by:	The FreeBSD Foundation
2015-10-02 13:16:06 +00:00
Alexander Motin
cf8f2fa24b Document CD block size of 2048. 2015-10-02 11:27:34 +00:00
Alexander Motin
6f2f92a5bf Set default block size for CD to expected 2048 bytes. 2015-10-02 11:16:46 +00:00
Marcelo Araujo
0bc8063012 The rpc.yppasswdd has an option to not allow shell changes (-s), but is
always passed a shell by the remote yppasswd. If an NIS client overrides the
shell provided by the ypserv, then yppasswd (pam_unix, actually, afaict)
will pass this new shell to the yppasswdd. If this shell has been set on the
client to a shell which is invalid on the server, a user will never be able
to change their password on the client.

PR:		67142
Submitted by:	russell@rucus.ru.ac.za
Approved by:	bapt (mentor)
Sponsored by:	EuroBSDCon Sweden.
2015-10-02 08:58:50 +00:00
Peter Grehan
1e306308ce - Increase the max number of indirect descriptors to match
the largest that the Windows virtio driver can send down

- Always advertize indirect descriptors. The Illumos virtio
  driver won't attach unless this capability is seen.

Reviewed by:	neel
2015-10-02 02:09:50 +00:00
Andrew Turner
fda91247c3 Also build ofwdump on arm64.
Obtained from:	EuroBSDCon Devsummit
Sponsored by:	ABT Systems Ltd
2015-10-01 09:40:33 +00:00
Xin LI
066c492a77 The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address.  The
structure is expected to be opaque to consumers.  In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security:	FreeBSD-SA-15:24.rpcbind
Security:	CVE-2015-7236
2015-09-29 18:05:54 +00:00
Bryan Drewery
e0efd9ee69 All supported releases have the -m support from r186678, so remove
the mention of it and reword this a bit to remove 'you'.

MFC after:	3 days
2015-09-29 17:54:01 +00:00
Bryan Drewery
749146414d Document the post-merge actions of calling tzsetup(8) and services_mkdb(8)
added in r259134.

MFC after:	3 days
2015-09-29 17:49:59 +00:00
Alexander Motin
91be33dc78 Add to CTL initial support for CDROMs and removable devices.
Relnotes:	yes
2015-09-27 13:47:28 +00:00
Alexander V. Chernikov
4a336ef40c 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
Josh Paetzel
5eff3ec6e0 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
Bryan Drewery
5a1af1a0ac Revert r288268. Wrong change committed. 2015-09-26 14:27:21 +00:00
Bryan Drewery
3c9e00f39e 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
Bryan Drewery
595fe15108 Add more SUBDIR_PARALLEL.
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-26 14:13:51 +00:00
Alexander Motin
9c887a4f86 Remove some duplicate, legacy, dead and questionable code. 2015-09-26 11:28:45 +00:00
Ed Maste
ccd23b44ea 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
Bryan Drewery
ec766071e3 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
Bryan Drewery
cfad5e931a META_MODE: Checkin a proper Makefile.depend.
Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:33:38 +00:00
Bryan Drewery
54c7d75a06 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
Josh Paetzel
d7b87b89b7 Fix typo.
Sponsored by:	iXsystems
2015-09-25 03:46:06 +00:00
Bryan Drewery
660d1f65bb Add missing CLEANFILES.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-09-24 23:15:24 +00:00
Dmitry Marakasov
a40531fcf8 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
Jung-uk Kim
2ac9ef2836 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
Conrad Meyer
2889bad81c 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
Alexander Motin
e543b3a83f Make cltd ignore HA ports. 2015-09-21 10:27:30 +00:00
Hiroki Sato
fb0e28f0e1 - 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
Hiroki Sato
157d2c3355 - 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
Xin LI
99e4638821 '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
Allan Jude
6af5d161e7 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
Bryan Drewery
6fcd667fd6 Connect sesutil(1) and numactl(1) for META_MODE.
Sponsored by:	EMC / Isilon Storage Division
2015-09-19 17:47:36 +00:00
Allan Jude
8729f5ec0e 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
Bryan Drewery
b6ad36706d Replace afterinstall: hack from r54681 with 'make delete-old' functionality.
Sponsored by:	EMC / Isilon Storage Division
2015-09-19 03:51:19 +00:00
Bryan Drewery
76e11fbdfc Remove redundant beforeinstall. 2015-09-18 23:34:47 +00:00
Xin LI
4b43341dea 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
Xin LI
4bdf90c43c 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
Bryan Drewery
42c4cf86d4 Update META_MODE dependencies. 2015-09-17 05:06:34 +00:00
Dag-Erling Smørgrav
ae96779933 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
Allan Jude
4c95e76ac4 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
Alexander Motin
3933f7b112 Add ctl-lun config option for consistency in HA setups. 2015-09-15 13:37:48 +00:00
Zbigniew Bodek
58172d8cc0 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
Devin Teske
dc68c8b311 Fix code typo (no functional change)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-14 21:26:48 +00:00
Baptiste Daroussin
3d85e406bb Regression: fix usershow -7
Submitted by:	Dan McGregor (via IRC)
MFC after:	2 days
2015-09-14 19:23:00 +00:00
Alexander Motin
860d3db9ce 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
Alexander Motin
828524c137 When updating port, apply only change of LUN map, not whole. 2015-09-13 15:08:06 +00:00
Alexander Motin
d36c617616 CTL documentation update, mostly for HA. 2015-09-12 10:23:23 +00:00
Baptiste Daroussin
ec4f7bd978 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
Devin Teske
65f3614085 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
Devin Teske
0a8354938c Use a variable for readability
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:14:48 +00:00
Devin Teske
e5a24129fa Update copyright
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:13:34 +00:00
Devin Teske
96eeaba5b1 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
Devin Teske
521414ebc7 Remove trailing newline at EOF
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:09:39 +00:00
Devin Teske
5e1ed71e4f Produce meaningful exit code
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:08:46 +00:00
Devin Teske
1a8cf17d01 Explicitly exit with success
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 21:01:26 +00:00
Devin Teske
0705286bfb Explicitly exit with success
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:59:13 +00:00
Devin Teske
fef95330a8 Update copyrights
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:58:00 +00:00
Devin Teske
cc478f6fd3 Produce meaningful exit code
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:56:36 +00:00
Devin Teske
527a9f3a85 Remove use of return outside of function
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:45:41 +00:00
Devin Teske
ff7b134cfa Ignore error results from newaliases(1)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-11 20:39:41 +00:00
Xin LI
2d0fc14c63 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
Alexander Motin
fb606ebabc Remove unused target and initiator IDs. 2015-09-10 10:46:21 +00:00
Hiroki Sato
f74237f5b6 - Remove #ifdef HAVE_POLL_H.
- Use nitems().

MFC after:	3 days
2015-09-10 06:40:28 +00:00
Takanori Watanabe
05e526fb5a fix compare argument for address type.
Submitted by: issei10193 (via Twitter)
2015-09-09 13:24:39 +00:00
Jung-uk Kim
1db13cd689 Revert r287578. This patch requires more review.
Requested by:	adrian
2015-09-08 23:17:02 +00:00
Allan Jude
1289db4899 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
Baptiste Daroussin
4c79e0d6c1 Remove extra debug that crept in 2015-09-08 22:24:20 +00:00
Baptiste Daroussin
61acb4582f 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
Jung-uk Kim
6c2f0c65c8 Enable 802.11n support.
PR:		164102
2015-09-08 21:04:33 +00:00
Jung-uk Kim
c3eac7e2b4 Sort and remove duplicate compiler flags.
MFC after:	3 days
2015-09-08 20:41:47 +00:00
Allan Jude
32047ac5fb 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
Baptiste Daroussin
b50756c759 Fix indentation, no functional changes 2015-09-08 19:25:15 +00:00
Alexander Motin
db7bf2baae 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
Baptiste Daroussin
1ed2002089 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
Enji Cooper
949b0d9970 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
Alexander Motin
a3977bea20 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
Baptiste Daroussin
1bc54324e9 Yet another fix for gcc 4.2 2015-09-05 22:33:40 +00:00
Baptiste Daroussin
cb291e8aa1 Remove extra i++
Reported by:	allanjude@
2015-09-05 21:55:01 +00:00
Baptiste Daroussin
4569e7cfe2 Fix build with gcc 4.2
Reported by:	kib
2015-09-05 16:59:30 +00:00
Baptiste Daroussin
cddcb2599f 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 Schubert
9bf168600c Turn on RAWDCF by default.
Suggested by:	ian
Approved by:	roberto
MFC after:	1 week
2015-09-04 16:59:01 +00:00
Alexander Motin
c01a5fa910 Another addition to r287455. 2015-09-04 10:16:21 +00:00
Alexander Motin
3b6077ae3d Addition to r287455. 2015-09-04 10:14:58 +00:00
Edward Tomasz Napierala
23bd2dd4a4 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
Edward Tomasz Napierala
10b5297f57 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
Marcelo Araujo
aa44f2ed5e Rename YP to NIS in the manpages.
Approved by:		bapt (mentor)
Differential Revision:	D3555
2015-09-03 07:18:52 +00:00
Marcelo Araujo
d84e564f14 Sync with the latest code from OpenBSD.
Approved by:		rodrigc (mentor)
Differential Revision:	D3550
2015-09-03 07:12:40 +00:00
Devin Teske
8fdb5185b9 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
Devin Teske
3ed46372b5 Remove non-functional examples.
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-03 03:29:44 +00:00
Xin LI
65b4f27054 Don't leak 'var'.
Reported by:	clang static analyzer
2015-09-03 01:15:23 +00:00
Devin Teske
61016a614e Minor code cleanups (no functional changes).
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-02 21:53:48 +00:00
Edward Tomasz Napierala
b8c19fd719 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
Devin Teske
9c10871d75 Bump version for altered long-opts processing
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 22:39:09 +00:00
Devin Teske
b98a26bf43 Simplify long-option processing
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 22:37:33 +00:00
Devin Teske
45d4c036ec Bump version for prior fix (SVN r287381)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:52:56 +00:00
Devin Teske
c65dfe1402 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
Devin Teske
7abb307c50 Comment for escape() function.
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:48:22 +00:00
Devin Teske
09f28e1bf1 Comment
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:42:00 +00:00
Devin Teske
e84a7d105d 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
Devin Teske
c1acb66e01 Style: comments
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-01 21:20:43 +00:00
Devin Teske
3d31973643 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
Devin Teske
c8c3b0c498 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
John Baldwin
7816cb4a0b 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
Xin LI
6fcf3575e2 Check and fail if drop of privileges failed.
MFC after:	2 weeks
2015-09-01 06:32:02 +00:00
Xin LI
e54569ecca die() would never return, mark it as so.
MFC after:	2 weeks
2015-08-27 18:11:00 +00:00
Xin LI
f595a30ba0 Plug a possible memory leak.
MFC after:	2 weeks
2015-08-27 06:28:42 +00:00
Jung-uk Kim
70e6ab8f6b Merge ACPICA 20150818. 2015-08-26 17:13:47 +00:00
Marcelo Araujo
58458d066f 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
Edward Tomasz Napierala
d321965424 Some random tweaks to ctl.conf(5).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-08-24 09:33:12 +00:00
Hiroki Sato
f2203c2740 Add static and remove unused variables. 2015-08-24 05:38:05 +00:00
Hiroki Sato
f34065a7fd Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support. 2015-08-24 05:28:23 +00:00
Warner Losh
b14fc856d7 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
Baptiste Daroussin
bb1816daa4 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
Warner Losh
f1868b4309 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
Baptiste Daroussin
80b3ba7a8d Fix typo in regression test 2015-08-21 11:25:42 +00:00
Baptiste Daroussin
729d9b2caa Fix /home symlink creation
Add regression test about it
2015-08-21 09:28:20 +00:00
Baptiste Daroussin
95c64defd7 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
Alan Somers
d60f0f1c49 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 Lepore
7b4a83b1d0 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
Xin LI
48f9270689 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
Alan Somers
fac7bc2365 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
Gleb Smirnoff
5041118435 Belatedly fix documentation on which interface to use as argument. 2015-08-17 09:18:54 +00:00
Peter Grehan
7a40703db9 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
Alexander Motin
2f444d157b 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
Baptiste Daroussin
5770ce6f1d Regression: fix pw usermod -w xxx
Reported by:	gjb
2015-08-14 13:39:55 +00:00
Baptiste Daroussin
125c7a1e56 Fix buildworld
Sponsored by:	gandi.net
2015-08-14 10:17:52 +00:00
Christian Brueffer
99d43aee11 Fix a few mandoc warnings.
MFC after:	1 week
2015-08-12 10:34:05 +00:00
Alexander Motin
a7ab146375 Another small typo.
MFC after:	3 days
2015-08-11 09:00:27 +00:00
Alexander Motin
97e14c64da Fix minor typo.
MFC after:	3 days
2015-08-11 08:58:00 +00:00
Marcelo Araujo
006bf8a619 style(9) requires a space here. 2015-08-11 01:45:17 +00:00
Marcelo Araujo
e5763f0069 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
Bjoern A. Zeeb
f2dedc73e0 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 Schouten
a1b862daec 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
Alexander Motin
d7f5186022 Refactor early stages of security negotiation.
MFC after:	2 weeks
2015-08-08 19:04:37 +00:00
Alexander Motin
4462a6049d Remove some code duplication.
MFC after:	1 week
2015-08-08 16:39:28 +00:00
Christian Brueffer
84fe889c63 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
Baptiste Daroussin
f5a15df7d8 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
Enji Cooper
c1987c2852 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
Glen Barber
1da17fb7be 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 Schouten
fc6ab77011 Avoid calling strlen() where we can use the strspn() return value. 2015-08-03 22:07:50 +00:00
Devin Teske
1e4d5cf1d6 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
Baptiste Daroussin
5e52b667a7 Fix bugs spotted by gcc
Reported by:	adrian
2015-08-03 06:06:56 +00:00
Adrian Chadd
bbec1b5a7b 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
Baptiste Daroussin
5cc12db1c7 Use intmax_t rather than long long 2015-08-02 19:49:24 +00:00
Baptiste Daroussin
9e24273cca 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
Baptiste Daroussin
fc5079452d Fix build on 32bits 2015-08-02 13:50:11 +00:00
Baptiste Daroussin
8159e0373f Split some extra long lines 2015-08-02 13:33:17 +00:00
Baptiste Daroussin
9261982d92 Split some extra long lines 2015-08-02 13:32:23 +00:00
Baptiste Daroussin
bcbdb01e56 Cleanup a bit includes 2015-08-02 13:22:46 +00:00
Baptiste Daroussin
b8a5086ef0 Add regression tests about adding already existsing groups/users 2015-08-02 13:02:53 +00:00
Baptiste Daroussin
f4124312a1 Fix regression: report if a group already exists when creating it 2015-08-02 12:56:25 +00:00
Baptiste Daroussin
a64b90fbaa Fix regression: report again if a username already exists when creating it 2015-08-02 12:54:15 +00:00
Baptiste Daroussin
db533440b7 Remove dead code 2015-08-02 12:48:36 +00:00
Baptiste Daroussin
d2d022b9fd 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
Scott Long
29b76e539f Iniital hack of mpsutil 2015-08-02 03:52:51 +00:00
Baptiste Daroussin
0996b15464 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
Baptiste Daroussin
458fdd97ab Remove things that crept in after badly checked revert 2015-08-01 12:20:55 +00:00
Baptiste Daroussin
7493058fb6 Partial revert of r286152
More work needed on the cli validation
2015-08-01 12:18:48 +00:00
Baptiste Daroussin
7391bf5ada Fix build 2015-08-01 11:52:48 +00:00
Baptiste Daroussin
510113b84d 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
Baptiste Daroussin
f2164ae0fa Revert r286148 2015-08-01 10:40:17 +00:00
Baptiste Daroussin
80d9f89289 Validate expiration days and password days from commmand line and pw.conf 2015-08-01 10:25:55 +00:00
Baptiste Daroussin
e5e7ef48eb Validate the max_uid/max_gid boundaries and entry type in pw.conf 2015-08-01 10:10:13 +00:00
Baptiste Daroussin
50698e6718 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
Baptiste Daroussin
f4e060d0f7 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
Baptiste Daroussin
e622418c5b Use strtoumax instead of strtoul 2015-08-01 08:35:20 +00:00
Baptiste Daroussin
a86e343db6 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
Baptiste Daroussin
796ba6fcc2 Cleanup includes 2015-07-29 23:26:14 +00:00
Baptiste Daroussin
c308ef6fd2 Actually set the proper license
Reported by:	trasz
2015-07-29 22:51:54 +00:00
Baptiste Daroussin
22665b2563 Actually add the new code 2015-07-29 06:23:06 +00:00
Baptiste Daroussin
8411215a80 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
Baptiste Daroussin
bbdee3ebde 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
Bryan Drewery
b99a71b1da 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
Baptiste Daroussin
90a4edb584 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
Baptiste Daroussin
81e2ba845c 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
Baptiste Daroussin
87bf5e9212 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
Marcelo Araujo
033af09de1 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 Lavigne
7ec72d484f 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
Jung-uk Kim
fe0f0bbb19 Merge ACPICA 20150717. 2015-07-22 16:25:07 +00:00
Allan Jude
a7d5d8d9d0 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
Pedro F. Giffuni
d37cb73c79 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
Xin LI
788aa07e34 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
Marcelo Araujo
f19e47d691 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
Allan Jude
7059fa6ff8 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
Edward Tomasz Napierala
f36b09c457 fstyp(8) ships with 10.2.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-07-18 12:03:51 +00:00
Edward Tomasz Napierala
d79b323ba9 uefisign(8) ships with 10.2.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-07-18 12:03:17 +00:00
Baptiste Daroussin
dac542123b 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
Justin Hibbits
8947c2986d Fix formatting. 2015-07-16 05:14:20 +00:00
Marcelo Araujo
e5523594ed 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
Allan Jude
69e4b249f8 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
Allan Jude
7e3ebc5b0a 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
Allan Jude
1bc080435c 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
Allan Jude
4ffa3da5f8 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
Baptiste Daroussin
a70fbf7ef5 Really fix -o 2015-07-13 09:12:05 +00:00
Baptiste Daroussin
aa509e5e81 Add regression tests to ensure we keep allowing creating users with uid0 2015-07-13 09:09:09 +00:00
Baptiste Daroussin
d7747c3c6f Regression fix: allow to create users with uid0
Reported by:	Jan Mikkelsen <janm@transactionware.com>
2015-07-13 09:08:27 +00:00
Baptiste Daroussin
a46045bbfa Fix logic of check duplicates that has been inverted 2015-07-13 09:07:38 +00:00
Xin LI
8c377b430c 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
Baptiste Daroussin
28b2f1294f Ensure skeldir is abolute path (relatively to the rootdir) 2015-07-12 22:08:58 +00:00
Baptiste Daroussin
ee8c5d1451 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
Baptiste Daroussin
65730d9349 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
Allan Jude
f56cc610dc Remove excess copyright lines propogated by copy/paste
Approved by:	trasz
2015-07-12 19:16:19 +00:00
Jamie Gritton
3bbdb8a755 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
Baptiste Daroussin
67eea76de0 Add minimum regression tests for pw -R 2015-07-12 09:42:10 +00:00
Baptiste Daroussin
8a2ace2a78 Make getarg return NULL if args is NULL 2015-07-12 00:02:43 +00:00
Baptiste Daroussin
52f92d8c1d 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
Baptiste Daroussin
9c56d9c5e4 Remove now unused variable 2015-07-11 23:17:13 +00:00
Baptiste Daroussin
10e6a51cf3 Replace custom string array with stringlist(3) 2015-07-11 23:07:17 +00:00
Baptiste Daroussin
5ebd525aab 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
Baptiste Daroussin
8970fe5251 Remove unused argument from pm_passwd 2015-07-11 21:12:28 +00:00
Baptiste Daroussin
49c195e61e check the gecos format early: at the moment the -c option is parsed 2015-07-11 21:09:50 +00:00
Baptiste Daroussin
81e683d636 Remove useless use of goto 2015-07-11 20:18:34 +00:00
Baptiste Daroussin
04c25b678f Isolate pw lock/unlock into a separate function 2015-07-11 20:10:12 +00:00
Baptiste Daroussin
9dd1a593d2 homedir can only be populate during useradd 2015-07-11 19:14:09 +00:00
Baptiste Daroussin
d14c48479c Make a separate groupdel/userdel from the main function 2015-07-11 19:07:47 +00:00
Baptiste Daroussin
ae73dd9f37 Make separate functions to show users and groups 2015-07-11 18:09:27 +00:00