Commit Graph

15718 Commits

Author SHA1 Message Date
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
Craig Rodrigues
4a2ec8401f yppoll(8): Comment out -h option.
The implementation of it is missing (see e.g. NetBSD or OpenBSD). Until
someone works on it, comment out the existing code to silence a warning
about 'hostname' being set but unused.

Found-by: gcc47

Submitted by:	Sascha Wildner <swildner@dragonflybsd.org>
Obtained from:	DragonFlyBSD (commit e455855db)
2015-05-31 20:20:24 +00:00
Baptiste Daroussin
7fc593dd82 Move cleanup functions to the right place 2015-05-31 12:04:06 +00:00
Baptiste Daroussin
2e6d97a407 Remove useless test before free() 2015-05-31 11:56:59 +00:00
Baptiste Daroussin
c69b42d00b Return early in case we cannot read the configuration file
This drops one level of indentation
2015-05-31 11:55:28 +00:00
Baptiste Daroussin
5710dc534c Make pw_user()/pw_group() more consitent about errors
Some of errors were returned to the main function, some others caused a direct
exit via err(3).

The main function is only interested in EXIT_SUCCESS, so in all other cases
replace warn(3) + return err by err(3)
2015-05-31 11:23:19 +00:00
Baptiste Daroussin
850f836ad8 Remove uneeded intermediate variable 2015-05-31 10:18:10 +00:00
Baptiste Daroussin
e55af20b47 Remove uneeded intermediate variable 2015-05-31 10:14:13 +00:00
Baptiste Daroussin
197419154e Use asprintf instead of malloc + snprintf and test the memory allocation 2015-05-31 10:02:01 +00:00
Baptiste Daroussin
6b6b47d0e3 Remove dead declaration
PR:		195928
MFC after:	2 days
2015-05-29 10:07:20 +00:00
Neel Natu
248e6799e9 Fix non-deterministic delays when accessing a vcpu that was in "running" or
"sleeping" state. This is done by forcing the vcpu to transition to "idle"
by returning to userspace with an exit code of VM_EXITCODE_REQIDLE.

MFC after:      2 weeks
2015-05-28 17:37:01 +00:00
John Baldwin
ef16b9abd4 Use the cpuset API more consistently:
- Fetch the root set from cpuset_getaffinity() instead of assuming all CPUs
  from 0 to hw.ncpu are the root set.
- Use CPU_SETSIZE and CPU_FFS.
- The original notion of halted CPUs the manpage and code refers to is gone.
  Use the term "available" instead.

Differential Revision:	https://reviews.freebsd.org/D2491
Reviewed by:	emaste
MFC after:	1 week
2015-05-27 13:54:37 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
ef0cb5db0a Fix overlinking again after recent ntp updates
Fix building WITHOUT_OPENSSL
2015-05-25 20:27:46 +00:00
Allan Jude
dce663816a Fix a syntax error in bsdinstall/zfsboot
Differential Revision:	https://reviews.freebsd.org/D2571
Submitted by:	Michael Dexter
Approved by:	dteske
MFC after:	1 week
X-MFC-With:	r283023, r282443
Sponsored by:	ScaleEngine Inc.
2015-05-22 15:57:42 +00:00
Edward Tomasz Napierala
b853c718a9 Advertise ctlstat(8) a little better.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2015-05-22 11:59:37 +00:00
Tycho Nightingale
a0df62cd97 The 'hostbridge' device exists to allow guests to infer msi/msix
capablity by advertising pcie capability.

Since the 'hostbridge' device isn't a true pci-to-pci bridge, and
doesn't actaully use the bridge configuration space layout, change
the header-type from type 1 to type 0 to avoid confusion.

Reviewed by:	neel
2015-05-21 20:11:52 +00:00
Neel Natu
4b083d80bf Add an option "--get-vmcs-exit-inst-length" to display the instruction length
of the instruction that caused the VM-exit.

MFC after:	1 week
2015-05-21 18:29:11 +00:00
Warner Losh
4d57a59a83 Remove stray DEBUG_FLAGS=-g that snuck in with r137868 2015-05-21 14:36:15 +00:00
Peter Grehan
fd19881492 Temporarily revert r282922 which bumped the max descriptors.
While there is no issued with the number of descriptors in
a virtio indirect descriptor, it's a guest's choice as to
whether indirect descriptors are used. For the case where
they aren't, the virtio block ring size is still 64 which
is less than the now reported max_segs of 67. This results
in an assertion in recent Linux guests even though it was
benign since they were using indirect descs.

The intertwined relationship between virtio ring size,
max seg size and blockif queue size will be addressed
in an upcoming commit, at which point the max descriptors
will again be bumped up to 67.
2015-05-21 04:19:22 +00:00
Edward Tomasz Napierala
8dca98d787 Remove the warning about invalid PE checksum; apparently nothing
cares about those checksums anyway.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-05-20 09:40:34 +00:00
Jung-uk Kim
a371a5fd85 Merge ACPICA 20150515. 2015-05-18 23:46:11 +00:00
Allan Jude
0db293c171 Fix off-by-one in array index bounds check
bhyveload would allow you to create 33 entries on an array that only has 32 slots

Differential Revision:	https://reviews.freebsd.org/D2569
Reviewed by:	araujo
Approved by:	neel
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.
2015-05-18 19:45:46 +00:00
Allan Jude
caa3817d4f bsdinstall/zfsboot: Skip adding swap lines to /etc/fstab if swap is 0 sized
Differential Revision:	https://reviews.freebsd.org/D2571
Reviewed by:	dim
Approved by:	eadler (mentor)
Sponsored by:	ScaleEngine Inc.
2015-05-17 00:55:44 +00:00
Rick Macklem
9896584a4b Add a warning message to mountd for exported file
systems that are automounted, since that configuration
isn't supported. This still allows the export, since
two emails I received felt that this should not be
disabled. It sends the message to syslog(LOG_ERR..), so that
it goes to the same places as the other messages related
to /etc/exports problems, even though it is a warning and not an error.

Reviewed by:	trasz
MFC after:	2 weeks
2015-05-16 12:05:26 +00:00
Xin LI
e8a94f7104 path.h is not needed here. 2015-05-16 08:12:00 +00:00