return False;
}
+
+/**
+ * Mark the current password for a credentials struct as wrong. This will
+ * cause the password to be prompted again (if a callback is set).
+ *
+ * This will decremebt the number of times the password can be tried.
+ *
+ * @retval whether the credentials struct is finished
+ */
+BOOL cli_credentials_wrong_password(struct cli_credentials *cred)
+{
+ if (cred->password_obtained != CRED_CALLBACK_RESULT) {
+ return False;
+ }
+
+ cred->password_obtained = CRED_CALLBACK;
+
+ cred->tries--;
+
+ return (cred->tries > 0);
+}
Client credentials structure
- Copyright (C) Jelmer Vernooij 2004-2005
+ Copyright (C) Jelmer Vernooij 2004-2006
Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
This program is free software; you can redistribute it and/or modify
CRED_GUESS_ENV, /* Current value should be used, which was guessed */
CRED_CALLBACK, /* Callback should be used to obtain value */
CRED_GUESS_FILE, /* A guess from a file (or file pointed at in env variable) */
+ CRED_CALLBACK_RESULT, /* Value was obtained from a callback */
CRED_SPECIFIED /* Was explicitly specified on the command-line */
};
/* Should we be trying to use kerberos? */
enum credentials_use_kerberos use_kerberos;
+
+ /* Number of retries left before bailing out */
+ int tries;
};
#include "auth/credentials/credentials_proto.h"