Bug 220768

Summary: rc.sysinit: Allow more than one attempt at non-LUKS passphrase
Product: [Fedora] Fedora Reporter: Mike Breen <bugzilla>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 11CC: cra, rvokal, triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-28 10:23:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch for /etc/rc.d/rc.sysinit
none
corrected /etc/rc.dc/rc.sysinit patch none

Description Mike Breen 2006-12-26 11:50:47 UTC
At boot-up, an incorrect passphrase may result in failing to
mount an encrypted filesystem; this leaves the user needing to
manually create the device and mount it (in the best case).

For encryption with LUKS, cryptsetup does allow several attempts
at the passphrase; with non-LUKS encryption, cryptsetup can't
tell whether the passphrase is correct and so may just create an
encrypted device which seems to contain random data.

Comment 1 Mike Breen 2006-12-26 11:50:47 UTC
Created attachment 144366 [details]
patch for /etc/rc.d/rc.sysinit

Comment 2 Mike Breen 2006-12-27 11:55:38 UTC
Created attachment 144395 [details]
corrected /etc/rc.dc/rc.sysinit patch

Apologies: the first patch was tested in a restricted way;
the "try again?" prompt should obviously be printed only 
where a passphrase was requested in the first place.

Comment 3 Charles R. Anderson 2007-06-05 23:17:28 UTC
This still exists in F7.  I suggest that the original bug submitter change the
version to "devel" so that this problem isn't lost as development continues.


Comment 4 Bug Zapper 2008-04-03 18:49:31 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 5 Mike Breen 2008-04-04 07:01:25 UTC
Still applies. My changes for F8 (note that I don't use a graphical boot and 
havven't tested it with rhgb option):

$ rcsdiff -u -r1.2 -r1.3 /etc/rc.d/rc.sysinit
===================================================================
RCS file: /etc/rc.d/RCS/rc.sysinit,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /etc/rc.d/rc.sysinit        2008/01/15 12:55:14     1.2
+++ /etc/rc.d/rc.sysinit        2008/01/21 16:01:44     1.3
@@ -236,10 +236,33 @@
                    "ignoring them"
            fi
            /sbin/cryptsetup ${key:+-d $key} luksOpen "$src" "$dst" <&1
+           rc=$?
        else
-           /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 
2>/dev/null
+           while ((1)); do
+               /sbin/cryptsetup $params ${key:+-d $key} create 
"$dst" "$src" <&1
+               rc=$?
+               if [ $rc -ne 0 ]; then
+                   break;
+               elif [ -n "$key" -a "x$key" != "xnone" ]; then
+                   break;
+               elif blkid "/dev/mapper/$dst" >/dev/null; then
+                   break;
+               fi
+               echo "/dev/mapper/$dst is not a recognized block device -" \
+                   "passphrase may be incorrect."
+               echo -n "Try again (y/[n])? "
+               read AGAIN <&1
+               case "$AGAIN" in
+                   Y|yes|Yes|YES)
+                       AGAIN=y
+                       ;;
+               esac
+               if [ "$AGAIN" != "y" ]; then
+                   break
+               fi
+               /sbin/cryptsetup remove "$dst"
+           done
        fi
-       rc=$?
        if [ $rc -ne 0 ]; then
            ret=1
            continue


Comment 6 Bug Zapper 2008-05-14 02:31:42 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2009-06-09 22:23:32 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Bug Zapper 2010-04-27 11:41:11 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2010-06-28 10:23:45 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.