Bug 124675 - FTP KIO slave often forgets password
Summary: FTP KIO slave often forgets password
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: ftp (show other bugs)
Version: unspecified
Platform: OpenBSD Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 268629 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-31 23:23 UTC by Martin Pärtel
Modified: 2011-04-28 15:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.7
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Pärtel 2006-03-31 23:23:44 UTC
Version:           unknown (using KDE 3.5.2, Debian Package 4:3.5.2-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.16

The FTP KIO slave tends to ask for a password repeatedly over long sessions. Also, entering a remote directory and going back to the root level with the up button usually triggers an authentication dialog. The "Keep password" checkbox seems to have little or no effect. I do _not_ have kwallet enabled btw.
Comment 1 Martin Pärtel 2006-04-03 15:05:30 UTC
Discovered a "workaround": log in to an FTP site, enter a directory and immediately go up one directory, re-enter the password (without checking Keep password). After this, the password does not seem to "time out".
Comment 2 Thiago Macieira 2006-04-04 02:19:04 UTC
Keep password = store it in KWallet.
Since you are not using KWallet, the password is lost in oblivion.
Comment 3 Alex Kern 2007-03-20 14:45:19 UTC
Let me describe my problem, that can confirm this bug.
I setup a ftp server with proper user login name and empty password.
If I contact it from client via konqueror (all KDE versions from SuSE 9.2 up to
SuSE 10.2), login name is specified in addres, it will ask me for password even I check "remember password ...".
Comment 4 Alex Kern 2007-03-20 18:00:41 UTC
Additional info:
since empty password can be still valid, check extra

in kdelibs/kioslave/ftp/ftp.cc

bool Ftp::ftpLogin()
...
  bool missing_password = false;
  AuthInfo info;
  info.url.setProtocol( "ftp" );
  info.url.setHost( m_host );
  info.url.setPort( m_port );

  // Try anonymous login if both username/password
  // information is blank.
  if (user.isEmpty() && pass.isEmpty())
  {
    user = FTP_LOGIN;
    pass = FTP_PASSWD;
  }
  else if (!user.isEmpty() && pass.isEmpty())
  {
    info.verifyPath = true;
    info.username = user;
    missing_password = !checkCachedAuthentication( info ) ) 
    info.username = "";
  }

  info.url.setUser( user );

  QByteArray tempbuf;
  int failedAuth = 0;

  do
  {
    // Check the cache and/or prompt user for password if 1st
    // login attempt failed OR the user supplied a login name,
    // but no password.
    if ( failedAuth > 0 || missing_password )
    {
      QString errorMsg;
      kDebug(7102) << "Prompting user for login info..." << endl;

      // Ask user if we should retry after when login fails!
      if( failedAuth > 0 )
      {
        errorMsg = i18n("Message sent:\nLogin using username=%1 and "
                        "password=[hidden]\n\nServer replied:\n%2\n\n"
                        , user, ftpResponse(0));
      }

      if ( user != FTP_LOGIN )
        info.username = user;

      info.prompt = i18n("You need to supply a username and a password "
                          "to access this site.");
      info.commentLabel = i18n( "Site:" );
      info.comment = i18n("<b>%1</b>",  m_host );
      info.keepPassword = true; // Prompt the user for persistence as well.
      info.readOnly = (!m_user.isEmpty() && m_user != FTP_LOGIN);

      bool disablePassDlg = config()->readEntry( "DisablePassDlg", false );
      if ( disablePassDlg || !openPasswordDialog( info, errorMsg ) )
      {
        error( ERR_USER_CANCELED, m_host );
        return false;
      }
      else
      {
        user = info.username;
        pass = info.password;
      }
    }

    tempbuf = "user ";

Comment 5 Matthias Fuchs 2011-03-17 16:54:36 UTC
*** Bug 268629 has been marked as a duplicate of this bug. ***
Comment 6 Dawit Alemayehu 2011-04-28 15:48:51 UTC
Git commit 3ab6c7f05f113353435e10b6d6fd0fdbbd495855 by Dawit Alemayehu.
Committed on 22/04/2011 at 03:40.
Pushed by adawit into branch 'master'.

Fixed most of the issue related to login.

BUG: 258888
BUG: 99686
BUG: 143488
BUG: 124675

FIXED-IN: 4.7
REVIEW: 101173

M  +83   -33   kioslave/ftp/ftp.cpp     
M  +3    -1    kioslave/ftp/ftp.h     

http://commits.kde.org/kdelibs/3ab6c7f05f113353435e10b6d6fd0fdbbd495855