1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

fsadm: avoid hidden --yes

When 'fsadm' was running without terminal (i.e. pipe), it's been
automatically working like in '--yes'.

Detect terminal and only accept empty "" input in this mode.
This commit is contained in:
Zdenek Kabelac 2017-05-23 13:58:12 +02:00
parent 57492a6094
commit 1fe4f80e45
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.172 -
===============================
Stop using '--yes' mode when fsadm runs without terminal.
Extend validation of filesystems resized by fsadm.
Enhance lvconvert automatic settings of possible (raid) LV types.
Allow lvchange to change properties on a thin pool data sub LV.

View File

@ -401,10 +401,15 @@ yes_no() {
while read -r -s -n 1 ANS ; do
case "$ANS" in
"y" | "Y" | "") echo y ; return 0 ;;
"n" | "N") echo n ; return 1 ;;
"y" | "Y" ) echo y ; return 0 ;;
"" ) if [ -t 1 ] ; then
echo y ; return 0
fi ;;
esac
done
echo n
return 1
}
try_umount() {