mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Update rc.initdiskless, fix error handling of remount_optional
chkerr() ignores the exit code of a preceding mount command in case a file ```remount_optional``` exists. The check is performed and a subshell is launched to log the informational message and return. The return is executed in the context of the subshell, not the context of the chkerr() function, hence is a NOP. The remount_optional check is hence ineffective. Change the code to if/then/fi, so the return is evaluated in the context of the chkerr function, to make the check effective. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1497
This commit is contained in:
parent
d726bc2863
commit
3c61bbebc4
1 changed files with 4 additions and 1 deletions
|
|
@ -174,7 +174,10 @@ log() {
|
|||
chkerr() {
|
||||
lastitem () ( n=$(($# - 1)) ; shift $n ; echo $1 )
|
||||
mountpoint="$(lastitem $2)"
|
||||
[ -r $mountpoint/remount_optional ] && ( echo "$2 failed: ignoring due to remount_optional" ; return )
|
||||
if [ -r $mountpoint/remount_optional ]; then
|
||||
echo "$2 failed: ignoring due to remount_optional"
|
||||
return
|
||||
fi
|
||||
case $1 in
|
||||
0)
|
||||
;;
|
||||
|
|
|
|||
Loading…
Reference in a new issue