[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: PATCH: Fix most of the login issues with the FTP
From:       "Dawit Alemayehu" <adawit () kde ! org>
Date:       2011-04-28 2:51:46
Message-ID: 20110428025146.6704.13768 () vidsolbach ! de
[Download RAW message or body]

> On April 27, 2011, 11:42 p.m., David Faure wrote:
> > kioslave/ftp/ftp.cpp, line 367
> > <http://git.reviewboard.kde.org/r/101173/diff/4/?file=15510#file15510line367>
> > 
> > Sorry, I still have a question.
> > 
> > After a username change, setHost is going to be called, right? So it will disconnect \
> > kio_ftp from the host? 
> > In that case, what's the point in doing the redirection code in this method - I thought the \
> > point was to do it after connected(), but that can't be it. So it still seems to me that \
> > the redirection code could be done inside of ftpLogin, which would simplify the code quite \
> > a lot (no bool *, in particular). 
> > But I guess I'm missing something; maybe setHost isn't called, after a redirection, so the \
> > app simply reuses the already-connected slave? In that case I don't see a better solution, \
> > indeed. 

#1. After the user name changed redirection, setHost will be called. But why do you think \
kio_ftp will be disconnected from the server ? If that is because of the closeConnection() call \
in setHost, then rest assured that it will not be called. Why ? Because "m_user" has already \
been updated to the new username and since nothing else will change, the if statement in \
setHost will never be true.

#2. We want the redirection to be the same as any other redirection. The only difference being \
we only want to update the client with the new user name. As per response in #1, the ioslave \
already has updated its local copy of the user name (m_user) ; so eveything else is exactly the \
same as the other redirection.

If you attempt to move the redirection to ftpLogin, you have to throw away your successful \
connection to the server, because you have to return false, i.e. not logged in to \
ftpOpenConnection.


- Dawit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101173/#review2935
-----------------------------------------------------------


On April 27, 2011, 9:27 p.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101173/
> -----------------------------------------------------------
> 
> (Updated April 27, 2011, 9:27 p.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Summary
> -------
> 
> The attached patch addresses most of the FTP login related problems and is a replacement for \
> the previous review request https://git.reviewboard.kde.org/r/100873/. Here are all the \
> changes in this patch: 
> - Show the "Remember password" checkbox even after the failure of the first login attempt. \
>                 [Bug:258888]
> - Always check for cached password before trying to login anonymously unless the \
> "TryAnonymousLoginFirst" flag was set in kio_ftprc. [Bug: 99686, 143488, 124675]
> - Avoid sending the "anonymous" username so it will not be used in the key used to store the \
>                 password in kwallet.
> - When a url contains a username, but the user chooses to login with a different username in \
> the password dialog,  then use redirection to update the client of the change.
> - Store password information in persistent storage if and only if the user checked the \
> "Remember password" checkbox. 
> 
> This addresses bugs 99686, 124675, 143488, and 258888.
> http://bugs.kde.org/show_bug.cgi?id=99686
> http://bugs.kde.org/show_bug.cgi?id=124675
> http://bugs.kde.org/show_bug.cgi?id=143488
> http://bugs.kde.org/show_bug.cgi?id=258888
> 
> 
> Diffs
> -----
> 
> kioslave/ftp/ftp.h 4ccdd4c 
> kioslave/ftp/ftp.cpp f7db42b 
> 
> Diff: http://git.reviewboard.kde.org/r/101173/diff
> 
> 
> Testing
> -------
> 
> - Attempt to login with incorrect username and validate the "Remember password" is actually \
>                 shown again.
> - Corrected the username information from the password dialog to ensure the client is updated \
>                 properly about the password change.
> - Clicked on the "Remember password" to store password in persistent storage and retry \
> logging into the same server at a later point. 
> 
> Thanks,
> 
> Dawit
> 
> 


[Attachment #3 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/101173/">http://git.reviewboard.kde.org/r/101173/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On April 27th, 2011, 11:42 p.m., <b>David Faure</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; \
padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/101173/diff/4/?file=15510#file15510line367" \
style="color: black; font-weight: bold; text-decoration: underline;">kioslave/ftp/ftp.cpp</a>  \
<span style="font-weight: normal;">

     (Diff revision 4)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
Ftp::ftpOpenConnection (LoginMode loginMode)</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">366</font></th>  <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; \
line-height: 140%; margin: 0; ">  <span class="n">connected</span><span \
class="p">();</span></pre></td>  <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; \
border-right: 1px solid #C0C0C0;" align="right"><font size="2">367</font></th>  <td \
bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  \
<span class="n">connected</span><span class="p">();</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; \
white-space: -o-pre-wrap; word-wrap: break-word;">Sorry, I still have a question.

After a username change, setHost is going to be called, right? So it will disconnect kio_ftp \
from the host?

In that case, what&#39;s the point in doing the redirection code in this method - I thought the \
point was to do it after connected(), but that can&#39;t be it. So it still seems to me that \
the redirection code could be done inside of ftpLogin, which would simplify the code quite a \
lot (no bool *, in particular).

But I guess I&#39;m missing something; maybe setHost isn&#39;t called, after a redirection, so \
the app simply reuses the already-connected slave? In that case I don&#39;t see a better \
solution, indeed. </pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">#1. After the user name changed \
redirection, setHost will be called. But why do you think kio_ftp will be disconnected from the \
server ? If that is because of the closeConnection() call in setHost, then rest assured that it \
will not be called. Why ? Because &quot;m_user&quot; has already been updated to the new \
username and since nothing else will change, the if statement in setHost will never be true.

#2. We want the redirection to be the same as any other redirection. The only difference being \
we only want to update the client with the new user name. As per response in #1, the ioslave \
already has updated its local copy of the user name (m_user) ; so eveything else is exactly the \
same as the other redirection.

If you attempt to move the redirection to ftpLogin, you have to throw away your successful \
connection to the server, because you have to return false, i.e. not logged in to \
ftpOpenConnection.</pre> <br />




<p>- Dawit</p>


<br />
<p>On April 27th, 2011, 9:27 p.m., Dawit Alemayehu wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black solid;">  <tr>
  <td>

<div>Review request for kdelibs and David Faure.</div>
<div>By Dawit Alemayehu.</div>


<p style="color: grey;"><i>Updated April 27, 2011, 9:27 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid \
#b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The attached patch \
addresses most of the FTP login related problems and is a replacement for the previous review \
request https://git.reviewboard.kde.org/r/100873/. Here are all the changes in this patch:

- Show the &quot;Remember password&quot; checkbox even after the failure of the first login \
                attempt. [Bug:258888]
- Always check for cached password before trying to login anonymously unless the \
&quot;TryAnonymousLoginFirst&quot;  flag was set in kio_ftprc. [Bug: 99686, 143488, 124675]
- Avoid sending the &quot;anonymous&quot; username so it will not be used in the key used to \
                store the password in kwallet.
- When a url contains a username, but the user chooses to login with a different username in \
the password dialog,   then use redirection to update the client of the change.
- Store password information in persistent storage if and only if the user checked the \
&quot;Remember password&quot; checkbox. </pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid \
#b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">- Attempt to login \
                with incorrect username and validate the &quot;Remember password&quot; is \
                actually shown again.
- Corrected the username information from the password dialog to ensure the client is updated \
                properly about the password change.
- Clicked on the &quot;Remember password&quot; to store password in persistent storage and \
retry logging into the same server at a later point. </pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=99686">99686</a>, 

 <a href="http://bugs.kde.org/show_bug.cgi?id=124675">124675</a>, 

 <a href="http://bugs.kde.org/show_bug.cgi?id=143488">143488</a>, 

 <a href="http://bugs.kde.org/show_bug.cgi?id=258888">258888</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kioslave/ftp/ftp.h <span style="color: grey">(4ccdd4c)</span></li>

 <li>kioslave/ftp/ftp.cpp <span style="color: grey">(f7db42b)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/101173/diff/" style="margin-left: 3em;">View \
Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic