<div dir="ltr">I created a merge request with the fixed code here: <a href="https://gitorious.org/xen-tools/xen-tools/merge_requests/7">https://gitorious.org/xen-tools/xen-tools/merge_requests/7</a></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/10/21 Joan <span dir="ltr"><<a href="mailto:aseques@gmail.com" target="_blank">aseques@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>The code in commit -> <a href="https://gitorious.org/xen-tools/xen-tools/commit/f1c7c6e11c878a250db32428949f25ef48fc56b3" target="_blank">https://gitorious.org/xen-tools/xen-tools/commit/f1c7c6e11c878a250db32428949f25ef48fc56b3</a> 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: </div>
<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="arial, helvetica, sans-serif"> my $tryagain = 1;<br>
</font><font face="arial, helvetica, sans-serif"> my $term = Term::ReadLine->new('Password change failed');<br></font><font face="arial, helvetica, sans-serif"> while ($tryagain) {<br></font><font face="arial, helvetica, sans-serif"> my $rc = system("chroot $MOUNT_POINT /usr/bin/passwd");<br>
</font><font face="arial, helvetica, sans-serif"> if ($rc >> 8) {<br></font><font face="arial, helvetica, sans-serif"> $tryagain = $term->ask_yn(<br></font><font face="arial, helvetica, sans-serif"> prompt => 'Do you want to try to change the password again??',<br>
</font><font face="arial, helvetica, sans-serif"> default => 'y',<br></font><font face="arial, helvetica, sans-serif"> );<br></font><font face="arial, helvetica, sans-serif"> } else {<br>
</font><font face="arial, helvetica, sans-serif"> $tryagain=0;<br></font><font face="arial, helvetica, sans-serif"> }<br></font><font face="arial, helvetica, sans-serif"> }</font></blockquote>
</div><div><br></div><div><br></div>The code is here: <a href="https://gitorious.org/xen-tools/xen-tools/source/0e8178ab0fe0557fb53c62e02f00e972335396e2:bin/xen-create-image#L3940" target="_blank">https://gitorious.org/xen-tools/xen-tools/source/0e8178ab0fe0557fb53c62e02f00e972335396e2:bin/xen-create-image#L3940</a></div>
</blockquote></div><br></div>