summaryrefslogtreecommitdiff
path: root/ucb/source
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2010-10-11 17:02:03 +0300
committerTor Lillqvist <tml@hemulen.(none)>2010-10-11 17:09:50 +0300
commit8a13bd6eaff89f2719e0e230f4fc7c8fb446572f (patch)
tree5cb411d085f1c12c43f9cbc553e70f53e95eaa25 /ucb/source
parent6d83697bdc51c9a00a4fe97ddf6c681f7af9d0b7 (diff)
Set username/domain/password to use only if provided by user
The semantics of ucbhelper::InteractionSupplyAuthentication changed at some point, so the getUserName(), getRealm() and getPassword() methods now return non-empty strings only if the user actually changed them. Check the return values for being non-empty before using them for gnome-vfs authentication. From gnome-vfs-authentication.diff, fixes bnc#465102.
Diffstat (limited to 'ucb/source')
-rw-r--r--ucb/source/ucp/gvfs/gvfs_content.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx
index 3b1d726f9304..483d2a49beb0 100644
--- a/ucb/source/ucp/gvfs/gvfs_content.cxx
+++ b/ucb/source/ucp/gvfs/gvfs_content.cxx
@@ -1645,9 +1645,17 @@ extern "C" {
ucbhelper::InteractionSupplyAuthentication > & xSupp
= xRequest->getAuthenticationSupplier();
- aUserName = xSupp->getUserName();
- aDomain = xSupp->getRealm();
- aPassword = xSupp->getPassword();
+ ::rtl::OUString aNewDomain, aNewUserName, aNewPassword;
+
+ aNewUserName = xSupp->getUserName();
+ if ( aNewUserName.getLength() )
+ aUserName = aNewUserName;
+ aNewDomain = xSupp->getRealm();
+ if ( aNewDomain.getLength() )
+ aDomain = aNewDomain;
+ aNewPassword = xSupp->getPassword();
+ if ( aNewPassword.getLength() )
+ aPassword = aNewPassword;
{
osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );