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

List:       kde-commits
Subject:    kdebase/kioslave/smb
From:       Stephan Kulow <coolo () kde ! org>
Date:       2004-01-06 12:58:57
Message-ID: 20040106125857.AD1B793A7 () office ! kde ! org
[Download RAW message or body]

CVS commit by coolo: 

patch by Martin Koller <m.koller@surfeu.at>
to make use of the user/password set in kcontrol


  M +17 -9     kio_smb_auth.cpp   1.24


--- kdebase/kioslave/smb/kio_smb_auth.cpp  #1.23:1.24
@@ -87,14 +87,22 @@ void SMBSlave::auth_smbc_get_data(const 
     if ( !checkCachedAuthentication( info ) )
     {
+        if ( m_default_user.isEmpty() )
+        {
         // ok, we do not know the password. Let's try anonymous before we try for real
         info.username = "anonymous";
         info.password = QString::null;
-        strncpy(username, info.username.utf8(),unmaxlen - 1);
-        strncpy(password, info.password.utf8(),pwmaxlen - 1);
-    } else {
-        strncpy(username, info.username.utf8(),unmaxlen - 1);
-        strncpy(password, info.password.utf8(),pwmaxlen - 1);
-        kdDebug(KIO_SMB) << "got password through cache" << endl;
     }
+        else
+        {
+            // user defined a default username/password in kcontrol; try this
+            info.username = m_default_user;
+            info.password = m_default_password;
+        }
+
+    } else
+        kdDebug(KIO_SMB) << "got password through cache" << endl;
+
+    strncpy(username, info.username.utf8(), unmaxlen - 1);
+    strncpy(password, info.password.utf8(), pwmaxlen - 1);
 }
 


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

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