Bug 1182955
| Summary: | The prompt for removal of LV accepts more characters than the stated y/n | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Nenad Peric <nperic> |
| Component: | lvm2 | Assignee: | Zdenek Kabelac <zkabelac> |
| lvm2 sub component: | Default / Unclassified | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, prockai, rbednar, zkabelac |
| Version: | 7.1 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.175-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 15:16:02 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Nenad Peric
2015-01-16 10:13:28 UTC
Prompts are not read by 'words', just single letters from 'stdin' (so i.e. script could push in letters') So the stdin stream is not split into words and IMHO it may possibly cause some other regressions if some users are pushing letters into lvm2's stdin input and they would be split by some control characters into some sections ? For now first appearance of letter 'y' or 'n' wins. (In reply to Zdenek Kabelac from comment #2) Still, if we ask for a one letter confirmation, we should stay by those rules and accept y or n, alternatively Y or N. > For now first appearance of letter 'y' or 'n' wins. That is not completely true. If you provide a sentence with both 'y' and 'n' none wins, and the prompt is repeated. For example: Do you really want to remove active logical volume <volname>? [y/n]: maybe, I don't know it will just repeat the prompt, so the first 'y' did not really win in this case (it matched an 'n' in "don't know" as well). The current proposal is to tidy this up as follows: 1) We will accept '^[ ^t]*([Yy]([Ee]([Ss]|)|)|[Nn]([Oo]|))[ ^t]*$' - optional whitespace before and after - y / ye / yes - n / no - case-independent 2) We will confirm the selection made e.g. by printing [y] [n] or [?] on stderr Already upstream with commit 35612bd27c203774948c84005c9fb9237746c34a (lvm2 2.02.156) Marking verified with latest rpms. Prompt now only accepts options specified in Comment 5. Do you really want to remove active logical volume vg/lv? [y/n]: maybe WARNING: Invalid input 'maybe'. Do you really want to remove active logical volume vg/lv? [y/n]: yesno WARNING: Invalid input 'yesno'. Do you really want to remove active logical volume vg/lv? [y/n]: no Logical volume vg/lv not removed. [root@virt-371 yum.repos.d]# lvremove vg/lv Do you really want to remove active logical volume vg/lv? [y/n]: ye Logical volume "lv" successfully removed 3.10.0-727.el7.x86_64 lvm2-2.02.175-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 lvm2-libs-2.02.175-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 lvm2-cluster-2.02.175-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 device-mapper-1.02.144-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 device-mapper-libs-1.02.144-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 device-mapper-event-1.02.144-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 device-mapper-event-libs-1.02.144-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 device-mapper-persistent-data-0.7.3-2.el7 BUILT: Tue Oct 10 11:00:07 CEST 2017 cmirror-2.02.175-2.el7 BUILT: Fri Oct 13 13:31:22 CEST 2017 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0853 |