diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2010-10-11 17:02:03 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@hemulen.(none)> | 2010-10-11 17:09:50 +0300 |
commit | 2de8570fb07bb6225213d406a7bb2adbddbe4d36 (patch) | |
tree | 9b481c59f9cd5412ddf7f75f0343f0bb5f8f8b6b /ucb/source | |
parent | 45b95fddcae6f39b05f339726e364196c4a591b3 (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.cxx | 14 |
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 121c69346f..ab998ac96e 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() ); |