Make short uuid specification for allow-discards work
1) strstr " $discarduuids " did not remove the optional 'luks-' prefix from the argument as the documentation says. 2) The lookup seems backwards. $luksdev ($luks in the other code copy) is the full uuid and thus one should check whether the user-supplied argument (short form) is contained therein, not the other way around. Before this commit, the only way to trigger allow-discards was to specify the full uuid without the 'luks-' prefix.master
parent
64d144aece
commit
065fc56ab2
|
@ -14,7 +14,7 @@ fi
|
|||
# parse for allow-discards
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
if strstr " $discarduuids " " ${luks##luks-}"; then
|
||||
if strstr " ${luksdev##luks-} " " ${discarduuids##luks-}"; then
|
||||
allowdiscards="allow-discards"
|
||||
fi
|
||||
elif getargbool rd.luks.allow-discards; then
|
||||
|
|
|
@ -97,7 +97,7 @@ done
|
|||
# parse for allow-discards
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
if strstr " $discarduuids " " ${luksdev##luks-}"; then
|
||||
if strstr " ${luksdev##luks-} " " ${discarduuids##luks-}"; then
|
||||
allowdiscards="--allow-discards"
|
||||
fi
|
||||
elif getargbool rd.luks.allow-discards; then
|
||||
|
|
Loading…
Reference in New Issue