remove debug printf.

2004-01-14  Not Zed  <NotZed@Ximian.com>

        * providers/local/camel-local-folder.c (local_getv): remove debug
        printf.

        ** See bug #52835.

        * camel-smime-context.c (sm_get_passwd): removed debugging.  If we
        get called multiple times in a row, then forget the old password
        and re-prompt - it was a bad password.  Zero out password memory
        too.

svn path=/trunk/; revision=24208
This commit is contained in:
Not Zed
2004-01-14 02:54:50 +00:00
committed by Michael Zucci
parent 06c8e307cc
commit aedeb2fd79
3 changed files with 23 additions and 4 deletions

View File

@ -1,3 +1,15 @@
2004-01-14 Not Zed <NotZed@Ximian.com>
* providers/local/camel-local-folder.c (local_getv): remove debug
printf.
** See bug #52835.
* camel-smime-context.c (sm_get_passwd): removed debugging. If we
get called multiple times in a row, then forget the old password
and re-prompt - it was a bad password. Zero out password memory
too.
2004-01-13 Rodrigo Moya <rodrigo@ximian.com>
* providers/groupwise/camel-groupwise-provider.c: missing renaming.

View File

@ -65,6 +65,7 @@ struct _CamelSMIMEContextPrivate {
char *encrypt_key;
camel_smime_sign_t sign_mode;
int password_tries;
unsigned int send_encrypt_key_prefs:1;
};
@ -92,16 +93,23 @@ sm_get_passwd(PK11SlotInfo *info, PRBool retry, void *arg)
char *prompt;
CamelException *ex;
printf("get passwd called '%s'\n", PK11_GetTokenName(info));
ex = camel_exception_new();
/* we got a password, but its asking again, the password we had was wrong */
if (context->priv->password_tries > 0) {
camel_session_forget_password(((CamelCipherContext *)context)->session, NULL, PK11_GetTokenName(info), NULL);
context->priv->password_tries = 0;
}
prompt = g_strdup_printf(_("Enter security pass-phrase for `%s'"), PK11_GetTokenName(info));
pass = camel_session_get_password(((CamelCipherContext *)context)->session, prompt, FALSE, TRUE, NULL, PK11_GetTokenName(info), ex);
camel_exception_free(ex);
g_free(prompt);
if (pass) {
nsspass = PORT_Strdup(pass);
memset(pass, 0, strlen(pass));
g_free(pass);
context->priv->password_tries++;
}
return nsspass;
@ -1036,6 +1044,7 @@ camel_smime_context_init(CamelSMIMEContext *context)
context->priv = g_malloc0(sizeof(*context->priv));
context->priv->certdb = CERT_GetDefaultCertDB();
context->priv->sign_mode = CAMEL_SMIME_SIGN_CLEARSIGN;
context->priv->password_tries = 0;
}
static void

View File

@ -408,8 +408,6 @@ local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
break; }
case CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY:
printf("getv:'%s' flags %08x\n", ((CamelFolder *)object)->full_name, ((CamelLocalFolder *)object)->flags);
/* FIXME: remove this from sotre flags */
*arg->ca_int = (((CamelLocalFolder *)folder)->flags & CAMEL_STORE_FOLDER_BODY_INDEX) != 0;
break;