Commit Graph

16043 Commits

Author SHA1 Message Date
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
Baptiste Daroussin
8daa3a67ff Move the quiet flag into the configuration structure 2015-07-11 17:01:08 +00:00
Baptiste Daroussin
f936ccb5f8 Separate usernext/groupnext from the main functions 2015-07-11 16:58:47 +00:00
Baptiste Daroussin
0fc58d1446 Do not try to set password on group if the group is added as a consequence of
of creating a user (regression from r285136)

Reported by:	Fabian Keil <fk@fabiankeil.de>
2015-07-09 14:14:44 +00:00
Hiroki Sato
64bb8a3881 Implement PF_IMMUTABLE flag and apply it to "name" and "jid" in
jail.conf parameters.  This flag disallows redefinition of the parameter.

"name" and/or "jid" are automatically defined in jail.conf by using
the jail names at the front of jail parameter definitions.  However,
one could override them by using a variable with the same name like
$name = "foo".  This confused the parser and could end up with SIGSEGV.

Note that this change also affects a case when all of parameters are
defined in the command line arguments, not in jail.conf.  Specifically,
"jail -c name=j1 name=j2" no longer works.  This should be harmless.

PR:		196574
Reviewed by:	jamie
Differential Revision:	https://reviews.freebsd.org/D3017
2015-07-08 16:37:48 +00:00
Patrick Kelsey
8bdc5a6251 MFV r285191: tcpdump 4.7.4.
Also, the changes made in r272451 and r272653 that were lost in the
merge of 4.6.2 (r276788) have been restored.

PR: 199568
Differential Revision: https://reviews.freebsd.org/D3007
Reviewed by: brooks, hiren
Approved by: jmallett (mentor)
MFC after: 1 month
2015-07-08 16:19:32 +00:00
Patrick Kelsey
fe3ff217dd Replace use of .Po Pc with the preferred .Pq for single line
enclosures in iovctl.conf(5), iovctl(8), pci(9), and
pci_iov_schema(9).

Differential Revision: https://reviews.freebsd.org/D3000
Reviewed by: wblock
Approved by: jmallett (mentor)
2015-07-08 16:16:44 +00:00
Hiroki Sato
882efc9ac2 Fix offset calculation in variable substitution
in jail.conf.  The following did not work correctly:

 A="A_${B}_C_${D}"
 B="BBBBB"
 D="DDDD_${E}_FFFFF"
 E="EEEEE"

PR:		189139
Reviewed by:	jamie
Differential Revision:	https://reviews.freebsd.org/D3018
2015-07-08 00:51:53 +00:00
Baptiste Daroussin
59856c7d26 pw: fail if an invalid entry is found while parsing master.passwd and group
PR:		198554
Reported by:	diaran <fbsd@centraltech.co.uk>
MFC after:	2 days
2015-07-07 21:05:20 +00:00
Gregory Neil Shapiro
ccbcdcd550 Temporarily disable WARNS while addressing a non-issue with the upstream code 2015-07-07 02:30:35 +00:00
Neel Natu
ccfe4c3f74 Always assert DCD and DSR in bhyve's uart emulation.
The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure

The initial terminal type passed to getty(8) is "3wire" which sets the
CLOCAL flag. However reset(1) clears this flag and any programs that try
to open the terminal will hang waiting for DCD to be asserted.

Fix this by always asserting DCD and DSR in the emulated uart.

The following discussion on virtualization@ has more details:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html

Reported by: jmg
Discussed with: grehan
2015-07-06 19:33:29 +00:00
Patrick Kelsey
2ccda62ff8 Fix range upper bound for uint32_t and uint64_t, and reformat range
description for uint8_t, uint16_t, uint32_t, and uint64_t.

Differential Revision: https://reviews.freebsd.org/D2988
Reviewed by: rstone, wblock
Approved by: jmallett (mentor)
Sponsored by: Norse Corp, Inc.
2015-07-06 01:48:23 +00:00
Cy Schubert
21e17e1fc8 Update ntp version number. (This is a manual update that was missed.) 2015-07-05 16:48:40 +00:00
Cy Schubert
276da39af9 MFV ntp-4.2.8p3 (r284990).
Approved by:	roberto, delphij
Security:	VuXML: 0d0f3050-1f69-11e5-9ba9-d050996490d0
Security:	http://bugs.ntp.org/show_bug.cgi?id=2853
Security:	https://www.kb.cert.org/vuls/id/668167
Security:	http://support.ntp.org/bin/view/Main/SecurityNotice#June_2015_NTP_Security_Vulnerabi
2015-07-05 15:42:16 +00:00
Baptiste Daroussin
391ad8ceb8 Remove dead code 2015-07-05 10:14:34 +00:00
Baptiste Daroussin
f6eae381a5 Also validate hours via strptime_l(3)
Simplify the code, by only using one parser, ensure the dates (hours and dates)
are valid
2015-07-05 10:11:35 +00:00
Baptiste Daroussin
330e423084 Validate expiration dates
Use strptime_l(3) to validate the dates provided in input
2015-07-05 09:48:03 +00:00
Marcelo Araujo
68c32d3559 Remove duplicate header string.h. 2015-07-04 18:36:02 +00:00
Baptiste Daroussin
1f8d909274 Fix validation of crypted password
Small cleanups
2015-07-04 15:56:59 +00:00
Baptiste Daroussin
9d028e08ce Also validate inputs of pw groupmod -h and groupmod -H 2015-07-04 15:54:11 +00:00
Baptiste Daroussin
11621f9650 Validate input of pw usermod -h and pwusermod -H
Push the code that set the password into a separate function to improve
readability

Add regression tests about pw usermod -h and pw usermod -H
2015-07-04 15:27:04 +00:00
Edward Tomasz Napierala
19c46d8cf7 Staticize some stuff in mountd(8); no functional changes.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-07-04 08:40:48 +00:00
Edward Tomasz Napierala
424a3f57a2 Remove OpenSSL dependency from iscsid(8) and ctld(8).
Differential Revision:	https://reviews.freebsd.org/D2866
Submitted by:	Tony Morlan <tony at scroner.com> (earlier version)
Reviewed by:	bapt@, delphij@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-07-03 10:08:10 +00:00
Edward Tomasz Napierala
23902fd260 User proper terminology - iSCSI sessions, not iSCSI connections.
Sponsored by:	The FreeBSD Foundation
2015-07-03 10:04:41 +00:00
Simon J. Gerraty
96a11afdff Updated depends 2015-07-03 06:11:54 +00:00
Ed Maste
e2a78b0008 mfiutil: increase buffer size to accommodate sprintf string
PR:		201289
MFC after:	1 week
2015-07-03 01:43:11 +00:00
Mariusz Zaborski
c36e54bb32 Let the nv.h and dnv.h includes be only in sys directory.
Change consumers to include those files from sys.
Add duplicated files to ObsoleteFiles.

Approved by:	pjd (mentor)
2015-07-02 21:58:10 +00:00
Renato Botelho
d32a66b2a2 When passwd or group information is changed (by pw, vipw, chpass, ...)
temporary file is created and then a rename() call move it to official file.
This operation didn't have any check to make sure data was written to disk
and if a power cycle happens system could end up with a 0 length passwd
or group database.

There is a pfSense bug with more infor about it:

https://redmine.pfsense.org/issues/4523

The following changes were made to protect passwd and group operations:

* lib/libutil/gr_util.c:
 - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file
 - After rename(), fsync() call on directory for faster result

* lib/libutil/pw_util.c
 - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file

* usr.sbin/pwd_mkdb/pwd_mkdb.c
 - Added O_SYNC flag on dbopen() calls
 - After rename(), fsync() call on directory for faster result

* lib/libutil/pw_util.3
 - pw_lock() returns a file descriptor to master password file on success

Differential Revision:	https://reviews.freebsd.org/D2978
Approved by:	bapt
Sponsored by:	Netgate
2015-07-02 17:30:59 +00:00
Pedro F. Giffuni
3237628999 dconschat(8): Use NULL instead of 0 for the last argument in execl(3)
Found while experimenting with the gcc sentinel attribute.

MFC after:	3 days
2015-06-28 20:32:03 +00:00
Neel Natu
f429b905b8 Fix issues detected by 'mandoc -Tlint bhyveload.8'
Pointed out by:		wblock
Differential Revision:	https://reviews.freebsd.org/D2762
2015-06-27 18:24:23 +00:00
Alexander Motin
0bb4b98984 Plug minor memory leak at r284765.
Reported by:	Coverity
CID:		1308401
MFC after:	3 days
2015-06-26 16:14:00 +00:00
Cy Schubert
b1cf398e01 Add support for additional architectures in ntp.
Differential Revision:	D2720
Reviewed by:	jmg, reoberto, andrew, ian, imp
2015-06-26 03:29:23 +00:00
Alexander Motin
d83595b2a8 Teach ctld about CTL's physical_port and virtual_port fields.
This allows ctld to work with isp(4) virtual ports, specifying them as
isp0/1, isp0/2, etc.  There are still problems on isp(4) layer with
disabling those ports after enabling, but hopefully they can be fixed.

MFC after:	3 days
Sponsored by:	iXsystems, Inc.
2015-06-24 15:13:27 +00:00
Allan Jude
69f172f27d Switch fstyp build to toggle ZFS support on WITHOUT_ZFS rather than WITHOUT_CDDL
PR:		200976
Approved by:	imp
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D2045
2015-06-23 16:34:43 +00:00
Allan Jude
e3ef9bb29e Fix the build for gcc by lowering the WARNS level
Approved by:	sbruno
X-MFC-With:	r284589
2015-06-20 15:03:02 +00:00
John-Mark Gurney
4afea7f994 add SO_REUSEADDR when starting debug port, lets you still bind when
a TIME_WAIT socket is still around...

Reviewed by:	grehan
Review:		https://reviews.freebsd.org/D2875
2015-06-20 07:49:08 +00:00
Devin Teske
e8e8c93935 Interim fix for "Login not found" error.
PR:		bin/196514
MFC after:	3 days
X-MFC-to:	stable/10
2015-06-19 21:32:20 +00:00
Allan Jude
398e498e49 Add the ability to detect ZFS and GELI encrypted file systems to fstyp(8)
Functionality is hidden behind the -u flag to avoid confusing automounters

PR:		200823
Reviewed by:	asomers, eadler, wblock (man page)
Approved by:	trasz
MFC after:	10 days
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D2045
2015-06-19 05:09:02 +00:00
Edward Tomasz Napierala
628b712826 Fix off-by-one error in fstyp(8) and geom_label(4) that made them use
a single space (" ") as a CD9660 label name when no label was present.
Similar problem was also present in msdosfs label recognition.

PR:		200828
Differential Revision:	https://reviews.freebsd.org/D2830
Reviewed by:	asomers@, emaste@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2015-06-18 21:55:55 +00:00
Edward Tomasz Napierala
a66d51f3bf Allow '@' in unquoted strings, such as with the "path" statement. Note
that one can use any character they like by using double quotes.

PR:		200895
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2015-06-18 10:17:47 +00:00
Neel Natu
9b1aa8d622 Restructure memory allocation in bhyve to support "devmem".
devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer
where doing a trap-and-emulate for every access is impractical. devmem is a
hybrid of system memory (sysmem) and emulated device models.

devmem is mapped in the guest address space via nested page tables similar
to sysmem. However the address range where devmem is mapped may be changed
by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is
usually mapped RO or RW as compared to RWX mappings for sysmem.

Each devmem segment is named (e.g. "bootrom") and this name is used to
create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom).
The device node supports mmap(2) and this decouples the host mapping of
devmem from its mapping in the guest address space (which can change).

Reviewed by:	tychon
Discussed with:	grehan
Differential Revision:	https://reviews.freebsd.org/D2762
MFC after:	4 weeks
2015-06-18 06:00:17 +00:00
Simon J. Gerraty
2ef6d5a7b9 new depends 2015-06-16 23:37:19 +00:00
Rui Paulo
baa557331e syslogd: re-read the timezone when receive a SIGHUP.
syslogd already re-reads the configuration file and the hostname when
receiving a SIGHUP, so it makes sense to reset the timezone.
Special care was taken to ensure we don't break installations running
with a custom TZ variable.

PR:		196905
Submitted by:	Kurt Lidl <lidl pix.net>
Sponsored by:	Pi-Coral, Inc.
2015-06-16 22:42:19 +00:00
Rui Paulo
e87161769c syslogd: don't leak finet0.
Submitted by:	Kurt Lidl <lidl pix.net>
Sponsored by:	Pi-Coral, Inc.
2015-06-16 22:31:38 +00:00
Rui Paulo
38076b4ba5 syslogd: support multiple -b options.
It's now possible to bind multiple sockets to different IP addresses.

PR:		159305
Submitted by:	Kurt Lidl <lidl pix.net>
Sponsored by:	Pi-Coral, Inc.
2015-06-16 22:26:22 +00:00
Xin LI
5a74378c7b Skip src component if /usr/src is empty.
Differential Revision:	https://reviews.freebsd.org/D2364
Submitted by:		kczekirda
Reviewed by:		cperciva, delphij, nwhitehorn, allanjude
MFC after:		2 weeks
2015-06-15 20:12:15 +00:00
Tijl Coosemans
19e58304b3 Change -Wl,-r back to -r so gcc doesn't pass --relax to the linker on some
architectures.

PR:		200881
2015-06-15 19:48:28 +00:00
Baptiste Daroussin
4369c82dc6 Change the documentation to reflect where the -V option should be used
Suggested by:	kientzle
2015-06-14 21:50:38 +00:00
Tijl Coosemans
7a51826c2a Tell the compiler that -dc and -r are linker flags.
Reviewed by:	adrian
2015-06-14 15:40:17 +00:00
Adrian Chadd
8d769a021c Fix typo - this upsets llvm/gcc-4.9, but not gcc-4.2 for some reason. 2015-06-14 00:31:22 +00:00
Adrian Chadd
c1e0b4d15b Fix up crunchgen binary generation to work with external cross-build
tools.

* Allow STRIP to be overridden by the environment
* Use CC to tie things together, not LD

Tested:

* i386, mips32

Submitted by:	kan
2015-06-13 22:01:21 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
122b6b61c7 Get rid of some more NO_OBJs
Differential Revision:       D2748
2015-06-12 14:30:27 +00:00
Simon J. Gerraty
5b381db8cc Remove NO_OBJ
For meta mode we will want objdirs.

Differential Revision:	D2748
Reviewed by:	brooks imp
2015-06-11 04:22:17 +00:00
Simon J. Gerraty
b589e6297b Remove extra blank lines 2015-06-10 14:08:36 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Baptiste Daroussin
3bfc59e83b backout remove of -q option for pw [user|group] next
While the return code is broken, some corner case usage depends on the
functionnality, so backout until we get better regression tests covering those
corner case usage.
2015-06-08 05:27:34 +00:00
Baptiste Daroussin
6328a4be57 Fix typo 2015-06-08 05:06:17 +00:00
Baptiste Daroussin
a57d4bf3a1 Fix mistakes than came along with r284139 2015-06-07 21:59:43 +00:00
Baptiste Daroussin
0958dffde2 Remove '-q' support for pw [user|group] next
the intent of -q in this command is to return as exit status the value of the
next group/user id, which does not make sense given exit status are limited to
values between 0 and 255.
2015-06-07 21:57:20 +00:00
Baptiste Daroussin
1718a38ffd Fix setting uid/gid min/max via pw 2015-06-07 20:59:59 +00:00
Baptiste Daroussin
a68fbadb63 Fix generating configuration file 2015-06-07 20:44:06 +00:00
Baptiste Daroussin
91860967e2 Fix duplicate checking 2015-06-07 19:59:01 +00:00
Baptiste Daroussin
c40bbdb4af Remove uneeded code (already done by pw_make_v7) 2015-06-07 19:39:06 +00:00
Baptiste Daroussin
bae068d22e In case of rename validate the length of the new name
Check early that the new name fits MAXLOGNAME and store it in pwconf
2015-06-07 19:33:25 +00:00
Baptiste Daroussin
a923718979 Refactor input validation
Mutualize code to validate inputs of both 'user' and 'group' command
Test that the input name fits into MAXLOGNAME
2015-06-07 19:03:41 +00:00
Baptiste Daroussin
3438d7decf Finish converting -7 to pwconf 2015-06-07 15:54:57 +00:00
Baptiste Daroussin
c86f7ad56d Handle -7 via gloval pwconf 2015-06-07 15:33:08 +00:00
Baptiste Daroussin
bbe09b2e19 Initialize conf using menset(3) 2015-06-07 15:29:58 +00:00
Baptiste Daroussin
2166b4d190 Handle pretty print (-P) via global pwconf 2015-06-07 15:27:17 +00:00
Baptiste Daroussin
363cefdbb1 Handle dryrun (-N) via global pwconf 2015-06-07 15:09:53 +00:00
Baptiste Daroussin
be7f5ba991 Sort headers 2015-06-07 14:57:16 +00:00
Baptiste Daroussin
82a3c75aa8 Handle -C and -Y locally and stop adding them to arglist 2015-06-07 14:54:07 +00:00
Baptiste Daroussin
2cc63cd136 Add a new global struct pwconf to store etcpath, rootdir and struct userconf
Do not add anymore -R and -V to arglist
Add an error message if both -V and -R are set in arguments
2015-06-07 14:34:38 +00:00
Baptiste Daroussin
fe084e12a5 Fix pw userdel -r not deleting homedir 2015-06-07 14:32:52 +00:00
Baptiste Daroussin
a68be5f7eb Test explicitly the result of strcmp to be consistent with the rest of the code 2015-06-07 11:38:26 +00:00
Baptiste Daroussin
fc606d2b2c Improve readability by reducing indentations levels 2015-06-07 11:35:34 +00:00
Baptiste Daroussin
75a030d4f8 Remove one level of indentation 2015-06-07 11:30:33 +00:00
Baptiste Daroussin
581a66ea58 Move user deletion code into a separate function to improve readability 2015-06-07 11:26:28 +00:00
Baptiste Daroussin
1238a919d2 Instead of always casting the pw_checkname input to u_char * and casting it back
to char *, change pw_checkname to directly take char * in input
2015-06-07 10:57:02 +00:00
Xin LI
ac57983523 Whitespace changes for r283981. No actual code changes. 2015-06-04 07:25:40 +00:00
Xin LI
3e08b16eca In r113596, version 4 of entries have been added but pwd_mkdb have
been generating both new (machine independent) and legacy version
entries (endianness sensitive).

The base system have been using the new format for quite some time,
so disable the generation by default.

An interim option, -l, have been added to re-enable old behavior.
The -l, -B and -L options are considered deprecated and will be
removed in FreeBSD 12.0 release.
2015-06-04 07:24:56 +00:00
Glen Barber
a5b912ff43 Document pw(8) '-R' option, added in r283961.
MFC after:	1 week
X-MFC-after:	r283961
Sponsored by:	The FreeBSD Foundation
2015-06-03 19:17:45 +00:00
Baptiste Daroussin
ac72be285f New pw -R rootdir option
This allows to set an alternate root directory in which the users/groups will be
manipulated

Requested by:	gjb, ian
Tested by:	gjb
2015-06-03 19:08:25 +00:00
Alexander Motin
f249b52d9a Fix bug in r278331: unlike some other options MaxRecvDataSegmentLength
is not negotiated as minimum, but only reported by sides to each other.

MFC after:	1 week
2015-06-02 01:47:12 +00:00
Baptiste Daroussin
6138e089bc Cast to gid_t for groups not uid_t 2015-05-31 22:12:31 +00:00
Baptiste Daroussin
68cea7d570 Remove useless cast in printf and printf-like functions:
use %u for uid_t and gid_t
2015-05-31 22:07:03 +00:00
Baptiste Daroussin
ee2582c212 Cast -1 to uid_t and bump WARNING level to 3 2015-05-31 21:44:09 +00:00
Craig Rodrigues
35ee6bbaef Fix some gcc compiler warnings.
Submitted by:   Sascha Wildner <swildner@dragonflybsd.org>
Obtained from:  DragonFlyBSD (commit 51798e10f3dd)
2015-05-31 20:45:35 +00:00