From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: M Hickford via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>,
Cheetham <mjcheetham@outlook.com>,
Dennington <lessleydennington@gmail.com>,
M Hickford <mirth.hickford@gmail.com>
Subject: Re: [PATCH v2] credential: new attribute password_expiry_utc
Date: Wed, 1 Feb 2023 19:12:23 -0500 [thread overview]
Message-ID: <Y9r/59pKKF07pBo4@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq8rhh2tum.fsf@gitster.g>
On Wed, Feb 01, 2023 at 09:12:01AM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> >> diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
> >> index f3c89831d4a..338058be7f9 100644
> >> --- a/builtin/credential-cache--daemon.c
> >> +++ b/builtin/credential-cache--daemon.c
> >> @@ -127,6 +127,9 @@ static void serve_one_client(FILE *in, FILE *out)
> >> if (e) {
> >> fprintf(out, "username=%s\n", e->item.username);
> >> fprintf(out, "password=%s\n", e->item.password);
> >> + if (e->item.password_expiry_utc != TIME_MAX)
> >> + fprintf(out, "password_expiry_utc=%"PRItime"\n",
> >> + e->item.password_expiry_utc);
> >> }
> >
> > Is there a particular reason to use TIME_MAX as the sentinel value here,
> > and not just "0"? It's not that big a deal either way, but it's more
> > usual in our code base to use "0" if there's no reason not to (and it
> > seems like nothing should be expiring in 1970 these days).
>
> This is my fault ;-). Here, there is no difference between 0 and
> TIME_MAX, but elsewhere the code needed
>
> if (expiry != 0 && expiry < time(NULL))
>
> to see if the entry has expired. If the sentinel for an entry that
> will never expire were TIME_MAX, you do not need the first half of
> the expression.
>
> I am OK either way.
Ah. That at least is a compelling reason to use TIME_MAX. I'm OK with
it.
-Peff
next prev parent reply other threads:[~2023-02-02 0:12 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9r/59pKKF07pBo4@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=lessleydennington@gmail.com \
--cc=mirth.hickford@gmail.com \
--cc=mjcheetham@outlook.com \
--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.
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 NNTP newsgroup(s).