From fd6775283db831681f9a04b23bdb29d1e4f5f11e Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Tue, 7 May 2019 20:47:41 -0600 Subject: * Few improvements in the password management code. --- pith/imap.c | 11 ++++------- pith/pine.hlp | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'pith') diff --git a/pith/imap.c b/pith/imap.c index f9e5162f..42513123 100644 --- a/pith/imap.c +++ b/pith/imap.c @@ -4,7 +4,7 @@ static char rcsid[] = "$Id: imap.c 1142 2008-08-13 17:22:21Z hubert@u.washington /* * ======================================================================== - * Copyright 2013-2018 Eduardo Chappa + * Copyright 2013-2019 Eduardo Chappa * Copyright 2006-2008 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1007,10 +1007,8 @@ imap_get_passwd_auth(MMLOGIN_S *m_list, char **passwd, char *user, STRLIST_S *ho && l->user[len] == PWDAUTHSEP)) && !strcmp(user, l->user + len + offset) && l->altflag == altflag){ - if(passwd){ - fs_resize((void **) passwd, strlen(l->passwd + len + offset) + 1); - strcpy(*passwd, l->passwd + len + offset); - } + if(passwd) + *passwd = cpystr(l->passwd + len + offset); dprint((9, "imap_get_passwd: match\n")); dprint((10, "imap_get_passwd: trying passwd=\"%s\"\n", passwd && *passwd ? *passwd : "?")); @@ -1062,8 +1060,7 @@ imap_set_passwd_auth(MMLOGIN_S **l, char *passwd, char *user, STRLIST_S *hostlis } len = strlen(passwd); - if(!(*l)->passwd || strlen((*l)->passwd) < len + authlen + offset) - (*l)->passwd = ps_get(len + authlen + offset + 1); + (*l)->passwd = ps_get(len + authlen + offset + 1); if(authtype) sprintf((*l)->passwd, "%s%c%s", authtype, PWDAUTHSEP, passwd); diff --git a/pith/pine.hlp b/pith/pine.hlp index a9699582..4cf8c611 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 337 2019-05-05 11:58:07 +Alpine Commit 338 2019-05-07 20:47:22 ============= h_news ================= -- cgit v1.2.3-54-g00ecf