1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-19 14:15:50 +02:00

[180270] do not allow clearing the credentials while acquiring them

This commit is contained in:
David Dykstal 2007-03-30 18:44:48 +00:00
parent 63a9d19cb6
commit fa9cfcc53c

View file

@ -125,6 +125,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
private String password = null; private String password = null;
private boolean savePassword = false; private boolean savePassword = false;
private boolean saveUserId = false; private boolean saveUserId = false;
private boolean acquiring = false;
/** /**
* Creates a standard credentials provider for a connector service. * Creates a standard credentials provider for a connector service.
@ -198,6 +199,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
boolean userIdNeeded = supportsUserId() && userId == null; boolean userIdNeeded = supportsUserId() && userId == null;
if (passwordNeeded || userIdNeeded || reacquire) { if (passwordNeeded || userIdNeeded || reacquire) {
promptForCredentials(); promptForCredentials();
acquiring = true;
if (savePassword) { if (savePassword) {
getConnectorService().savePassword(); getConnectorService().savePassword();
} else { } else {
@ -206,6 +208,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
if (saveUserId) { if (saveUserId) {
getConnectorService().saveUserId(); getConnectorService().saveUserId();
} }
acquiring = false;
} }
} }
} }
@ -214,15 +217,19 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
* @see org.eclipse.rse.core.subsystems.ICredentialsProvider#clearCredentials() * @see org.eclipse.rse.core.subsystems.ICredentialsProvider#clearCredentials()
*/ */
public final void clearCredentials() { public final void clearCredentials() {
password = null; if (!acquiring) {
userId = null; password = null;
userId = null;
}
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.ICredentialsProvider#clearPassword() * @see org.eclipse.rse.core.subsystems.ICredentialsProvider#clearPassword()
*/ */
final public void clearPassword() { final public void clearPassword() {
password = null; if (!acquiring) {
password = null;
}
} }
/* (non-Javadoc) /* (non-Javadoc)