Commit Graph

7317 Commits

Author SHA1 Message Date
Jim Harris
181c4ec270 Do not throw an error if the user requests to activate the image from
an empty firmware slot, as long as the user has specified a firmware
image to download into the empty firmware slot.

Sponsored by:	Intel
Reported by:	Joe Golio <joseph.golio@emc.com>
MFC after:	3 days
2013-07-16 15:45:37 +00:00
Robert Millan
fc98db27df Add -n flag for compatibility with Linux version of mount(8).
Reviewed by: freebsd-fs, eadler, mckusick, jh, wblock
2013-07-15 21:57:21 +00:00
Jim Harris
008ac71e0a %d should be used for printing int32_t instead of %zd.
clang does not complain about this - only gcc.

MFC after:	3 days
2013-07-12 18:13:41 +00:00
Oleg Bulyzhin
a34becb373 Fix 'SEE ALSO' list. 2013-07-12 09:20:55 +00:00
Jaakko Heinonen
36ad3f479c Clarify how "hide" and "unhide" commands work on directories. 2013-07-12 06:03:25 +00:00
Jim Harris
08c29873bf Ensure controller or namespace node name is specified before trying to
access it.

While here, also fix the identify usage message to show the -v and -x
parameters.

Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:33:12 +00:00
Jim Harris
9c0871b260 Condense the output for displaying LBA formats.
Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:31:58 +00:00
Jim Harris
2528d6a326 Send per-namespace logpage commands to the controller devnode, so they
are processed as admin commands, not I/O commands.

As part of this change, pull out the code for parsing a namespace node
string into a separate function, since it is used for both identify and
logpage commands.

Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:31:21 +00:00
Jim Harris
fdfa4d2d35 Try to read firmware image before prompting the user to confirm
firmware download.  This correctly prints an error and exits for
an incorrect firmware image name before prompting the user to
confirm the download.

Sponsored by:	Intel
MFC after:	3 days
2013-07-09 21:20:08 +00:00
Jim Harris
821ef73ca6 Incorporate feedback from bde@ based on r252672 changes:
* Use 0/1 instead of sysexits.  Man pages are confusing on this topic,
  but 0/1 is sufficient for nvmecontrol.
* Use err function family where possible instead of fprintf/exit.
* Fix some typing errors.
* Clean up some error message inconsistencies.

Sponsored by:	Intel
Submitted by:	bde (parts of firmware.c changes)
MFC after:	3 days
2013-07-09 21:14:15 +00:00
Rick Macklem
b54de2127e Document the "gssname" and "allgssname" mount options added by the
host-based initiator credential patches.
This is a content change.
2013-07-09 01:31:36 +00:00
Alan Somers
3449b15aa2 Correct the printf format specifier for total_events.
Add __printflike argument checking for devdlog().

Reported by: pjd
Approved by: gibbs (co-mentor)
2013-07-08 21:10:30 +00:00
Pawel Jakub Dawidek
374a8a322b Fix dhclient for interfaces that are down. The discover_interfaces() function
that looks for interface skips interfaces that are not UP. We need to call
dhclient-script PREINIT before we call discover_interfaces(), so the script has
a chance to bring the interface UP.

Reported by:	alfred
2013-07-04 12:27:10 +00:00
Jim Harris
960116ec24 Fix printf argument mismatch reported by gcc on i386.
Reported by: kargl
2013-07-04 00:26:24 +00:00
Pawel Jakub Dawidek
8da93e6861 MFp4 @229488:
Sandbox unprivileged process using capability mode.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:23:25 +00:00
Pawel Jakub Dawidek
a6f38228d4 MFp4 @229487:
Revoke all capability rights from STDIN and allow only for write to STDOUT and
STDERR. All those descriptors are redirected to /dev/null.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:22:29 +00:00
Pawel Jakub Dawidek
4c7a48b7a9 MFp4 @229486:
Once PID is written to the pidfile, revoke all capability rights.
We just want to keep the pidfile open.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:21:11 +00:00
Pawel Jakub Dawidek
fe5c716394 MFp4 @229485:
Only allow to overwrite lease file.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:19:43 +00:00
Pawel Jakub Dawidek
f73ac8b9de MFp4 @229484:
Limit routing socket so only poll(2) and read(2) are allowed (CAP_POLL_EVENT
and CAP_READ). This prevents unprivileged process from adding, removing or
modifying system routes.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:18:40 +00:00
Pawel Jakub Dawidek
de2c882f5c MFp4 @229483:
Limit communication pipe with privileged process to CAP_READ and CAP_WRITE.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:17:29 +00:00
Pawel Jakub Dawidek
3b2ed0659c MFp4 @229482:
- Limit bpf descriptor in unprivileged process to CAP_POLL_EVENT, CAP_READ and
  allow for SIOCGIFFLAGS, SIOCGIFMEDIA ioctls.
- While here limit bpf descriptor in privileged process to only CAP_WRITE.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:16:02 +00:00
Pawel Jakub Dawidek
235eb53002 MFp4 @229481:
Currently it was allowed to send any UDP packets from unprivileged process and
possibly any packets because /dev/bpf was open for writing.

Move sending packets to privileged process. Unprivileged process has no longer
access to not connected UDP socket and has only access to /dev/bpf in read-only
mode.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:12:54 +00:00
Pawel Jakub Dawidek
e374cef518 MFp4 @229480:
Shutdown write direction of the routing socket. We only need to read from it.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:09:02 +00:00
Pawel Jakub Dawidek
7fdc27bc51 MFp4 @229479:
- Add new request (IMSG_SEND_PACKET) that will be handled by privileged process.
- Add $FreeBSD$.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:07:55 +00:00
Pawel Jakub Dawidek
0bbe83068e MFp4 @229477:
The gethostname(3) function won't work in capability mode, because reading
kern.hostname sysctl is not permitted there.  Cache hostname early and use
cached value later.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:05:36 +00:00
Pawel Jakub Dawidek
c786bc9089 Remove redundant white-spaces. 2013-07-03 22:03:19 +00:00
Pawel Jakub Dawidek
b0f1b32afb MFp4 @229476,229478:
Make use of two fields: rfdesc and wfdesc to keep bpf descriptor open for
reading only in rfdesc and bpf descriptor open for writing only in wfdesc.
In the end they will be used by two different processes.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 22:01:52 +00:00
Pawel Jakub Dawidek
3a0fc7d8a9 MFp4 @229474:
iov_base field is 'void *' in FreeBSD, no need to cast.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 21:58:26 +00:00
Pawel Jakub Dawidek
e8da500388 MFp4 @229473:
No caller checks send_packet() return value, so make it void.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 21:57:24 +00:00
Pawel Jakub Dawidek
ba019ae51f MFp4 @229472:
Use the same type for 'from' and 'to' argument in send_packet().

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 21:53:54 +00:00
Pawel Jakub Dawidek
d1f4d85494 MFp4 @229471:
Remove unused argument from assemble_hw_header().

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 21:49:10 +00:00
Pawel Jakub Dawidek
592291c1e7 MFp4 @229470:
Remove unused argument from send_packet().

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 21:45:29 +00:00
Pawel Jakub Dawidek
181ab08d9e MFp4: @229469:
Garbage-collect dead prototypes.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
2013-07-03 21:41:35 +00:00
Hiroki Sato
4099f7e640 Fix a typo (s/error/errno/). 2013-07-03 09:50:59 +00:00
Xin LI
fa3483e67c When listing with -f, skip all memory disks that are not vnode-backed.
Noticed by:	kevlo
MFC after:	3 days
2013-07-02 19:42:47 +00:00
Xin LI
1bf9e66cbc Plug a memory leak. 2013-07-02 17:34:34 +00:00
Alan Somers
967ecf4aed Explicitly include <cstdarg> to fix compilation with libc++. It is implicitly
included by libstdc++.

Reported By: Oliver Hartmann
Approved by: gibbs (co-mentor, implicit)
2013-07-02 14:48:39 +00:00
Bruce M Simpson
d32438c3f1 When acquiring a lease, record the value of the BOOTP siaddr field
contained in the DHCP offer, and write it out to the lease file
as an unquoted value of the "next-server" keyword. The value is ignored
when the lease is read back by dhclient, however other applications
are free to parse it.

The intent behind this change is to allow easier interoperability
with automated installation systems e.g. Cobbler, Foreman, Razor;
FreeBSD installation kernels can automatically probe the network
to discover deployment servers.  There are no plans to MFC this
change unless a backport is specifically requested.

The syntax of the "next-server <ip>" lease keyword is intended to be
identical to that used by the ISC DHCPD server in its configuration files.
The required defines are already present in dhclient but were unused before
this change. (Note: This is NOT the same as Option 66, tftp-server-name).

It has been exercised in a university protocol testbed environment, with
Cobbler and an mfsBSD image containing pc-sysinstall (driven by Cobbler
Cheetah templates). The SYSLINUX memdisk driver is used to boot mfsBSD.
Currently this approach requires that a dedicated system profile has
been created for the node where FreeBSD is to be deployed. If this
is not present, the pc-sysinstall wrapper will be unable to obtain
a node configuration. There is code in progress to allow mfsBSD images
to obtain the required hints from the memdisk environment by parsing
the MBFT ACPI chunk.  This is non-standard as it is not linked into
the platform's ACPI RSDT.

Reviewed by:	des
2013-07-02 13:24:37 +00:00
Warren Block
42c916d7ee Add a new gptboot(8) man page. Factor out the redundant information
in gpart(8) and boot(8), adding references to gptboot(8) in both.

Reviewed by:	jhb, ae, pjd, Paul Schenkeveld <bsdcan@psconsult.nl>, david_a_bright@dell.com (portions), gjb
MFC after:	1 week
2013-07-01 22:38:36 +00:00
Alan Somers
0285e9b1cf style(9) fixes, including the removal of page break characters. No functional
changes.

Approved by:	gibbs (co-mentor)
2013-07-01 21:49:17 +00:00
Alan Somers
be685e0128 Add a SIGINFO handler to devd. It will send useful statistics to syslog or
stderr as appropriate.  Currently, the only statistic printed is the number of
events received.

Reviewed by:	eadler
Approved by:	gibbs (co-mentor)
2013-07-01 21:33:05 +00:00
Alan Somers
6d1014a32b Add syslog(3) support to devd(8).
sbin/devd/devd.cc
        All output will now go to syslog(3) if devd is daemonized, or stderr
        if it's running in the foreground.

sbin/devd/devd.8
        Remove the "-D" flag.  Filtering messages by priority now
	happens in the usual syslog way.  For performance reasons, a few
	extra-verbose debugging statements are now conditional on the "-d" (do
	not daemonize) flag.

etc/syslog.conf
etc/newsyslog.conf
        Direct messages from devd(8) to /var/log/devd.log, but leave it
        disabled by default

Reviewed by:	eadler
Approved by:	gibbs (co-mentor)
MFC after:	never (removed a command-line option from devd)
2013-07-01 21:20:17 +00:00
Xin LI
0d8a14f9b1 Correct a typo in comment. 2013-07-01 21:18:39 +00:00
Mikolaj Golub
14f200d97e Make hastctl(1) ('list' command) output a worker pid.
Reviewed by:	pjd
MFC after:	3 days
2013-07-01 18:41:07 +00:00
Jens Schweikhardt
1862d13b8a Correct some grammar. 2013-06-30 17:59:40 +00:00
Hiroki Sato
33cfdcc3ba Do not display a warning message in a jail without AF_INET6 support.
MFC after:	3 days
2013-06-30 07:37:31 +00:00
Xin LI
8f8de1e127 - Modify swapon(8) so that it uses most of geli(8) defaults for swap,
which is presently: AES-XTS, no authentication.  Create provider
   with pagesize as sectorsize by default.
 - Rewrite parsing code for geli(8)-backed swap options, now options
   are required to be exact match, and unrecognized options will trigger
   a warning.
 - Don't initialize GELI device if it's already initialized.  This
   restores previous behavior.
 - Don't duplicate file descriptor when working with geli(8) and
   gbde(8) as there is no need to communicate with the utility other
   than exit status.
 - When calling swap_on_off_* routines, which_prog can only be SWAP_ON
   or SWAP_OFF.  Eliminate unneeded case branches by replacing switch
   with if's.
 - Plug a few memory leaks.

Reviewed by:	hrs (but bugs are mine)
MFC after:	1 week
X-MFC-with:	r252310, r252332, r252345
2013-06-29 22:04:04 +00:00
Ed Schouten
f758648022 Don't let hastd use C11 atomics.
Due to possible concerns about the stability of C11 atomics, use our
existing atomics API instead.

Requested by:	pjd
2013-06-29 20:13:39 +00:00
Joel Dahl
a9ca77e055 mdoc: remove EOL whitespace. 2013-06-29 16:05:44 +00:00
Davide Italiano
237abf0c56 - Trim an unused and bogus Makefile for mount_smbfs.
- Reconnect with some minor modifications, in particular now selsocket()
internals are adapted to use sbintime units after recent'ish calloutng
switch.
2013-06-28 21:00:08 +00:00