Fix typo.

Submitted by:	feld@
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c5a7ee096891dcbde23a8f4200233a467870a044)
Fix typos.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e3b2accfd9b121a0ba0ddff89daf3ff5d9690f15)
Grammar fix.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6149217d805edb23d34c07d73a2e64763d37b788)
Fix handling for empty auth-groups.  Without it, ctld child process
would either exit on assertion, or, if assertions are not enabled,
fail to authenticate the target.

MFC after:	2 days
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9e76667e13878eb4ec51fdf820a831b0f7b9a6a0)
Refactor.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 942aab7c51325d88004aa825b2c9d8e315099a49)
Improve check for duplicated paths.  It shows the warning twice for
every path (once for each duplicate found), but it should do for now.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f0306f793fa079fb2ba6a25d3df5ddc0a0d7524c)
The log_whatever() routines don't accept NULL for format strings,
so mark them as __printflike instead of__printf0like.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1d16ec7ceeb9b54c249c5ff3cb5472da7f3d9b45)
Empty data segment during Login Phase is rather unlikely, but it's
not, by itself, a protocol error.  This fixes interoperability with
OpenBSD initiator.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e4b6e911a2dcde72418067d8c09105f8f8d1382f)
Daemonize after applying configuration, not before, so that
any problems - including "daemon already running" - are visible
on the terminal and not just in logs.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b84432b20cfa69f9c2d4d1bbe92ddf04e101e92d)
Implement initiator-name and initiator-portal restrictions.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fec3636fbdc2e427a2cc2fa123981ec14a638897)
Make function ordering slightly more logical; no functional changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 760495fbd7c1f574a762688313e2c5b116b7c79f)
Yacc cleanup; no functional changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5f228e3b08b9de96f7592b6872658901ca4b5b31)
Rename a variable, no functional changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e8652707f05061e2c2607331bed4ef700b30f854)
Add auth-type.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f5f5c39110a536f3d9315ab46a04cd29e7389d94)
Make it possible to redefine portal-group "default".

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7dbe2512bb7776cd8b34e8d463730fd4d154c84e)
Add a new auth-group "default", defaulting to deny, and make it possible
to redefine it.  From now on, assigning auth-group to a target is no longer
mandatory.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e4d29471045c41e161f8f445979aff75df3684ec)
Update manual page to match recent auth-group "default" changes.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 87a841d29adb494353457f21fbb7306271ec9d47)
Use "default" as default discovery-auth-group, instead of "no-access".
It doesn't change visible behaviour, as previously auth-group "default"
wasn't redefinable, so by default access was always denied.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7f7fd0dbc0e0dff0202586fa4aa864c47f28bfd2)
Use new auth-type "deny" instead of using "chap" with no chap entries;
it's cleaner this way, and gives better feedback to the user.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d2233667737fd4f8c08b7bd91b42dd5394f0f3c7)
So, it turns out SIGCHLD is discarded by default, so we have to set up
a dummy handler to make it interrupt an ioctl(2) or select(2).

This makes those short-lived ctld(8) zombies disappear.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 35478760f6be5dff356268a4a3a6060bcbadb1a8)