[xen-tools-dev] Bug in the password promt in master
Joan
aseques at gmail.com
Fri Oct 25 11:03:51 CEST 2013
I created a merge request with the fixed code here:
https://gitorious.org/xen-tools/xen-tools/merge_requests/7
2013/10/21 Joan <aseques at gmail.com>
> The code in commit ->
> https://gitorious.org/xen-tools/xen-tools/commit/f1c7c6e11c878a250db32428949f25ef48fc56b3 has
> an error, the variable $tryagain is never set to 0, so the code enters into
> an infinte loop, the fix is quite easy, just setting the variable to 0 in
> case the password was properly changed:
>
> my $tryagain = 1;
>> my $term = Term::ReadLine->new('Password change failed');
>> while ($tryagain) {
>> my $rc = system("chroot $MOUNT_POINT /usr/bin/passwd");
>> if ($rc >> 8) {
>> $tryagain = $term->ask_yn(
>> prompt => 'Do you want to try to change the
>> password again??',
>> default => 'y',
>> );
>> } else {
>> $tryagain=0;
>> }
>> }
>
>
>
> The code is here:
> https://gitorious.org/xen-tools/xen-tools/source/0e8178ab0fe0557fb53c62e02f00e972335396e2:bin/xen-create-image#L3940
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://xen-tools.org/pipermail/xen-tools-dev/attachments/20131025/a69a947d/attachment.html>
More information about the xen-tools-dev
mailing list