Commit Graph

708 Commits

Author SHA1 Message Date
kre 31fcb5661e Stop using the obsolete test(1) -o operator, use sh || instead.
Prefer sh ! over test's ! (though that one is not completely obsolete).
2023-12-25 08:38:32 +00:00
kre b151f12f8e Do away with the obsolete text(1) -a operator, use sh && instead.
Prefer sh ! operator over test's ! (less question what it means).
A few minor formatting changes.
2023-12-25 08:37:08 +00:00
kre 78a2289357 Clean up obsolete test(1) usage - use sh's || instead of test's obsolete -o,
and sh's && instead of test's obsolete -a.

Minor formatting cleanups, including removing unneeded \ line continuations.

The somewhat bizarre way that named_migrate() was made to work in a
subshell (which of itself is fine, and looks needed) has been made more
rational.  Because of that, the need to use local vars is no longer there,
(subshells can't affect the parent) and "local" in that func could be deleted
(but hasn't been).
2023-12-25 08:35:07 +00:00
kre 50379ee0d8 Clean up obsolere test(1) -a option/operator - use sh && instead.
Take the opportunity to do a little sh formatting cleanups, the \
line continuation can ususually be avoided by placing sh operators at
the appropriate places.

Note the [ x"$var" = x"$other" ] usage no longer needs the 'x',
avoiding that kind of nonsense is partly why test was much more
precisely specified, and a lot of the unnecessary stuff made obsolete.
Those however I did not remove (they're harmless).
2023-12-25 08:29:05 +00:00
kre 7ebc15ba84 Clean up obsolete test(1) usage, use sh && rather than test's old -a
(and while here prefer sh's ! operator over test's - it simplifies
things for test).
2023-12-25 08:24:58 +00:00
kre 80f0b9f9ed Clean up obsolete test(1) usage - don't use -o, use sh || instead.
This one was particularly bad:

	if [ -z ${dev} -o ${junk} ]; then

was supposed to be validating an entry read from a config file,
dev should be not empty, and junk should be empty (ie: correct
number of fields present).   If that test succeeds, the line is
bad, and we error out.

But if dev was empty, and junk was also empty, that turned into

	if [ -z -o ]; then

which tests if "-o" is the empty string, which it isn't, so instead
of succeeding, and considering the entry invalid (no dev specified)
the code would just carry on as if all was good.

Because of this, a bunch of quoting fixes were also made (there might
perhaps be more needed).
2023-12-25 08:23:35 +00:00
kre 0367de1d4a Don't use obsolete test(1) -a option/operator - use sh && instead. 2023-12-25 07:49:22 +00:00
kre 7a4bb62b07 Whitespace: 8 spaces -> tab 2023-12-25 07:46:12 +00:00
kre 4fa06fab58 No longer use obsolete test(1) -a option/operator, use sh && instead.
While here a couple of minor formatting improvements - in general it
is always a good idea to surround sh operator chars (like '>' '(' ...)
with white space, to guard against thet possibility that some other (or
later enhanced) sh might have additional operators which happen to be
the character string used.

I don't understand while the final part of the condition for not doing
anything needs to run in a subshell, but that can stay for now.
2023-12-25 07:43:03 +00:00
kre 7d757c9675 No longer use obsolete test "-a" option - use sh && instead. 2023-12-25 07:39:59 +00:00
abs 011f078b4d Add support to npf_rules to rc.conf
- Allows overriding default from /etc/npf.conf
- Indicate rules file used in output
- Drop check for file presence in script - rely on npf exiting with error
2023-10-05 08:19:27 +00:00
gutteridge b23f276898 resize_root: quote $rootdev consistently in resize_ffs(8) calls 2023-10-04 00:04:42 +00:00
riastradh bb38adb487 /etc/rc.d/cerctl_init: New script for certctl rehash in live images.
This is very limited -- it does not supplant postinstall to rehash
certificates on upgrade; it only runs certctl rehash if
/etc/openssl/certs is an empty directory, as you get in live images
not created with sysinst.

We could also have a more general-purpose way to run postinstall(8)
on first boot of an image, but that has a lot more moving parts to
think about, so let's start with this limited-scope low-risk
approach.

PR install/57629

XXX pullup-10
2023-09-27 00:24:12 +00:00
mlelstv e6c0de6292 Don't specify a volume alias if none is given instead of using a default
name. Otherwise iscsictl fails for using non-unique names if more than
one volume is used.
2023-07-22 10:31:35 +00:00
kim 00ac86982a Remove backwards compat. 2023-07-22 08:51:28 +00:00
kim fe60335256 Add some backwards compat. Adjust grammar. 2023-06-10 04:02:39 +00:00
riastradh 64ad67ce6d /etc/rc.d/sshd: Use default curve for ECDSA keygen, not NIST P-521.
The default is NIST P-256, which:

(a) has plenty of cryptanalytic security,
(b) performs better on essentially all platforms (smaller enough that
    even the advantage of the Mersenne prime structure of P-521 can't
    compete), and
(c) likely gets more scrutiny on implementations than P-521 since it's
    more widespread.
2023-06-05 11:59:12 +00:00
riastradh dba4ddf6b7 /etc/rc.d/sshd: Stop generating DSA host keys by default.
If you want them you can generate them yourself, but in this day and
age (Monday and 2023, specifically) there's no reason to be using DSA
except for compatibility with ancient legacy software.
2023-06-05 11:51:19 +00:00
riastradh 7e9d04fc5d /etc/rc.d/sshd: New check cmd and reload precmd.
- check cmd: run `sshd -t' to check sshd_config file

- reload precmd: run check cmd before reloading so we don't nuke sshd
  if there's an error in the sshd_config file

(It is still possible to effectively nuke sshd by changing the
configuration tosomething that won't work on your network, but at
least we avoid making sshd just exit on reload when you make a typo
in a config option.)

XXX pullup-9
XXX pullup-10
2023-05-26 10:44:59 +00:00
mlelstv 469d9aaeac Handle missing auth file.
Skip empty lines.
2023-02-18 07:51:52 +00:00
martin faf47f20b7 If /etc/iscsi/volumes does not exist, explicitly exit with 0 status 2023-02-06 11:53:03 +00:00
mlelstv b526349c2e Add start script to attach iscsi volumes at boot.
The default is to execute the script (iscsid_volumes=YES), so if you have
any volumes defined, you should also start iscsid (iscsid=YES) to avoid
error messages.
2023-02-03 13:53:40 +00:00
kre bd7c53a85d Make this better ... Allow config file for raidN to be found
in /etc/conf/raid/raidN (as well as in /etc/raidN.conf) (less
clutter in /etc).

Allow config files to exist for raids that are autoconfigured (just
skip anything autoconfigured) - this allows a (simplistic) recovery
mechanism if autoconf fails, and makes it simpler to enable/disable
autoconf at will, while keeping the raid working.

While here, add sh quoting where it is needed, and remove it from
where it is pointless.
2022-07-21 07:49:36 +00:00
nia b7957d1677 build system: Revert all the recent additions of MK[...] knobs that
allow conditionally disabling the building of certain user space
programs in the 'base' set.

There is not enough consensus that this is the right way and a few
people had strong objections, see source-changes-d@.
2022-06-06 10:56:27 +00:00
nia 8469593b52 mk: Add a MKPPP flag to exclude pppd(8) and related utilities from
the build
2022-05-29 08:09:59 +00:00
nia f2e2da3feb mk: Add MKNTP, MKTCPDUMP knobs. 2022-05-28 11:17:35 +00:00
nia 6678627ac7 mk: Rename the MKMBONE option to MKMROUTING for greater accuracy and
to match the related kernel config option.
2022-05-25 21:25:46 +00:00
nia 30fbdc74a3 mk: Allow building base without the MBONE applications by setting
MKMBONE=no in mk.conf
2022-05-25 10:18:28 +00:00
martin 901c0b91c9 PR 56835: fix sshd startup script to only whine about bogus keys it
created if it actualy did create keys (one should thing that a
function called sshd_keygen() only is called to create keys, but
the "precmd" magic makes it run every time sshd is started or stopped).

Patch from Tom Lane, with modifications suggested by kre and a minor
additional cosemtic change.
2022-05-15 11:47:42 +00:00
brad 84213c7105 Like /etc/rc.d/network, add the ability to put a '!' character as the
first character in /etc/gpio.conf and have the rest evaluated in a
shell.  It is useful to be able to do actions after setting up gpio
pins or attaching gpioiic(4).
2022-04-30 13:48:09 +00:00
andvar f84252b461 fix various typos in comments and log messages. 2022-04-16 18:15:20 +00:00
gutteridge 08a9f63190 LOGIN: fix typo in description 2022-03-02 01:55:18 +00:00
alnsn 0e59248afa Enable critical_filesystems_zfs. 2022-02-20 14:42:07 +00:00
sborrill 956275fd6a Revert previous. Explicitly load the value of npf or pf 2021-11-30 11:00:29 +00:00
sborrill bf76deaf12 Load rc configuration based on rcvar, not name, so that correct settings
in /etc/rc.conf.d are loaded.

Usually this does not matter as rcvar and name are set to the same value.
For pf_boot and npf_boot, rcvar is set to pf and npf respectively.

Prior to the change, if:
rc.conf contains nfp=YES
rc.conf.d/npf does not exist

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=YES

If:
rc.conf contains npf=NO (or is not set)
rc.conf.d/npf contains npf=YES

Then:
/etc/rc.d/npf_boot rcvar
outputs:
# npf_boot
$npf=NO

This means that in the latter case, at boot time the npfctl start command
is never run and the firewall is not operational.
2021-11-26 13:11:36 +00:00
sborrill 1438126a18 Use rcvar=$name syntax consistently in rc.d scripts which makes it easier to
search for rc.d scripts where rcvar differs from name. No functional change.
2021-11-26 12:51:24 +00:00
martin 39237b4ead If key generation happens with not enough entropy in the system, add
a warning to motd pointing at entropy(7) and give instructions how to
re-generate the (weak) keys after fixing up entropy.

Add a "keyregen" command, which forces regeneration of all host keys
to simplify the replacement of weak keys.
2021-09-26 10:53:20 +00:00
andvar c69f42d323 fix mainly same typos as in my previous commit but outside sys/dev/dm. 2021-08-21 23:00:30 +00:00
mlelstv c413ec6508 Reverse devpubd dependeny to avoid dangling reference to zfs which is
an optional part of the build.
2021-08-03 05:15:20 +00:00
mlelstv ad07108f16 Run devpubd before volume managers and pseudo disks. 2021-07-31 14:47:04 +00:00
mlelstv b259e1d9fc run sysctl early enough. 2021-06-13 10:14:40 +00:00
christos d80018d9b8 handle copying of plugins to the chroot 2021-03-31 04:57:25 +00:00
sborrill 4f6c3ffcd1 Need to explicitly load value of zfs variable as zfs=YES may be set in
/etc/rc.conf.d/zfs, not /etc/rc.conf.
2021-03-09 12:42:46 +00:00
christos b60051daa5 require NETWORKING otherwise amd can come up before the network is up and
it needs to be able to do DNS.
2021-03-01 23:02:30 +00:00
hannken 0c0601776b Enable "/etc/zfs/exports" from "zfs share" in rc.d/mountd and rc.d/mountall. 2021-02-16 10:02:42 +00:00
martin b2434f4d17 llvmlockdir -> lvmlockdir 2021-01-26 15:08:02 +00:00
martin 9869002d85 Rename etc/rc.d/llvmlockdir to lvmlockdir - it has nothing to do with LLVM,
the name probably was a freudian slip of my fingers when I split that
fragment out of another rc.d script.
2021-01-26 13:31:19 +00:00
riastradh cba96d16f7 Various entropy integration improvements.
- New /etc/security check for entropy in daily security report.

- New /etc/rc.d/entropy script runs (after random_seed and rndctl) to
  check for entropy at boot -- in rc.conf, you can:

  . set `entropy=check' to halt multiuser boot and enter single-user
    mode if not enough entropy

  . set `entropy=wait' to make multiuser boot wait until enough entropy

  Default is to always boot without waiting -- and rely on other
  channels like security report to alert the operator if there's a
  problem.

- New man page entropy(7) discussing the higher-level concepts and
  system integration with cross-references.

- New paragraph in afterboot(8) about entropy citing entropy(7) for
  more details.

This change addresses many of the issues discussed in security/55659.
This is a first draft; happy to take improvements to the man pages and
scripted messages to improve clarity.

I considered changing motd to include an entropy warning with a
reference to the entropy(7) man page, but it's a little trickier:
- Not sure it's appropriate for all users to see at login rather than
  users who have power to affect the entropy estimate (maybe it is,
  just haven't decided).
- We only have a mechanism for changing once at boot; the message would
  remain until next boot even if an operator adds enough entropy.
- The mechanism isn't really conducive to making a message appear
  conditionally from boot to boot.
2021-01-10 23:24:25 +00:00
martin 5dd83105b3 Adjust to "pool" usage in our standard ntp.conf, pointed out
by Connor McLaughlan.
2020-12-25 13:42:02 +00:00
kim 063923df4b network: Update rtsol options
- Use "-6" instead of "--noipv4" as it seems more appropriate based on
  the dhcpcd(8) manual page.
- Remove "-f /dev/null" as it seems unnecessary with "-6".
- Remove "--persistent" as it is in the default /etc/dhcpcd.conf,
  and this way the user can change it, if they would like to (either
  through dhcpcd_flags or by editing /etc/dhcpcd.conf).

The "-b" (or "--background") option is needed to avoid a timeout error
message (and a delay in booting), so it is still left in place.
2020-10-16 15:31:04 +00:00