From: Calvin Wan <calvinwan@google.com>
To: M Hickford via GitGitGadget <gitgitgadget@gmail.com>
Cc: Calvin Wan <calvinwan@google.com>,
git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
Jeff King <peff@peff.net>, Cheetham <mjcheetham@outlook.com>,
Dennington <lessleydennington@gmail.com>,
M Hickford <mirth.hickford@gmail.com>
Subject: Re: [PATCH v3] credential: new attribute password_expiry_utc
Date: Thu, 16 Feb 2023 19:16:43 +0000 [thread overview]
Message-ID: <20230216191644.315615-1-calvinwan@google.com> (raw)
In-Reply-To: <pull.1443.v3.git.git.1675545372271.gitgitgadget@gmail.com>
> static int run_credential_helper(struct credential *c,
> @@ -342,6 +352,10 @@ void credential_fill(struct credential *c)
>
> for (i = 0; i < c->helpers.nr; i++) {
> credential_do(c, c->helpers.items[i].string, "get");
> + if (c->password_expiry_utc < time(NULL)) {
> + FREE_AND_NULL(c->password);
> + c->password_expiry_utc = TIME_MAX;
> + }
> if (c->username && c->password)
> return;
> if (c->quit)
I see you null out c->password in the expiry if block so that the
following c->password check in the following if statement fails.
While I think it's neat little trick, I wonder if others on list
think it's better to be more explicit with how the logic should
work (eg. adding the c->passowrd_expiry_utc check as an inner
block inside of the c->username && c->password block).
next prev parent reply other threads:[~2023-02-16 19:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-28 14:04 [PATCH] credential: new attribute password_expiry_utc M Hickford via GitGitGadget
2023-01-29 20:17 ` Junio C Hamano
2023-02-01 8:29 ` M Hickford
2023-02-01 18:50 ` Junio C Hamano
2023-01-30 0:59 ` Eric Sunshine
2023-02-05 6:49 ` M Hickford
2023-02-01 9:39 ` [PATCH v2] " M Hickford via GitGitGadget
2023-02-01 12:10 ` Jeff King
2023-02-01 17:12 ` Junio C Hamano
2023-02-02 0:12 ` Jeff King
2023-02-01 20:02 ` Matthew John Cheetham
2023-02-02 0:23 ` Jeff King
2023-02-05 6:45 ` M Hickford
2023-02-06 18:59 ` Matthew John Cheetham
2023-02-05 6:34 ` M Hickford
2023-02-04 21:16 ` [PATCH v3] " M Hickford via GitGitGadget
2023-02-14 1:59 ` Junio C Hamano
2023-02-14 22:36 ` M Hickford
2023-02-17 21:44 ` Lessley Dennington
2023-02-17 21:59 ` Junio C Hamano
2023-02-18 8:00 ` M Hickford
2023-02-14 8:03 ` Martin Ågren
2023-02-16 19:16 ` Calvin Wan [this message]
2023-02-18 8:00 ` M Hickford
2023-02-18 6:32 ` [PATCH v4] " M Hickford via GitGitGadget
2023-02-22 19:22 ` Calvin Wan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230216191644.315615-1-calvinwan@google.com \
--to=calvinwan@google.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=lessleydennington@gmail.com \
--cc=mirth.hickford@gmail.com \
--cc=mjcheetham@outlook.com \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).