bsdinstall: Fix issues parsing rc.conf.services on revisit
There are a few issues here, some of which are hiding others. The first is that we don't use double quotes around the command substitution so every word in the conf file is treated as a separate argument to eval, resulting in spaces being used in place of newlines and thus comments in the file commenting out the rest of the file, not just to the end of their line. In particular, we insert one comment just before the dumpdev entry (the final one in the file) and so we never see dumpdev as set, and thus set a default value of on for the menu. The second issue is that, for dumpdev, it takes a value of AUTO not YES when set, but we don't replace this with on when eval'ing, so then end up giving AUTO to bsddialog which is interpreted the same as off (which seems to match GPL dialog). Thus handle AUTO like YES otherwise it will always appear as unchecked on revisit. The final issue is that our case-insensitive YES/NO (and now AUTO) replacements have no word boundaries around them so match the middle of words too. As it happens this doesn't matter in practice at the moment, but it could in future; currently the only effect is that it rewrites moused_nondefault_enable to moused_offndefault_enable, but since this variable is never read, only written based on moused(_enable) this is harmless, but we should fix it in case a service comes along in future that does get affected by it.
This commit is contained in:
parent
1843da3edb
commit
91985bc5ad
@ -32,8 +32,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
|
||||
: ${BSDDIALOG_OK=0}
|
||||
|
||||
if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then
|
||||
eval $( sed -e s/YES/on/i -e s/NO/off/i \
|
||||
$BSDINSTALL_TMPETC/rc.conf.services )
|
||||
eval "$( sed -E -e 's/\<(YES|AUTO)\>/on/i' -e 's/\<NO\>/off/i' \
|
||||
$BSDINSTALL_TMPETC/rc.conf.services )"
|
||||
else
|
||||
# Default service states. Everything is off if not enabled.
|
||||
sshd_enable="on"
|
||||
|
Loading…
Reference in New Issue
Block a user