public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Aaron Plattner <aplattner@nvidia.com>
Cc: <git@vger.kernel.org>,  Rahul Rameshbabu <rrameshbabu@nvidia.com>
Subject: Re: [PATCH] credential: clear expired c->credential in addition to c->password
Date: Tue, 04 Jun 2024 11:24:15 -0700	[thread overview]
Message-ID: <xmqqed9cva5s.fsf@gitster.g> (raw)
In-Reply-To: <20240604180224.1484537-1-aplattner@nvidia.com> (Aaron Plattner's message of "Tue, 4 Jun 2024 11:02:20 -0700")

Aaron Plattner <aplattner@nvidia.com> writes:

> When a struct credential expires, credential_fill() clears c->password
> so that clients don't try to use it later. However, a struct cred that
> uses an alternate authtype won't have a password, but might have a
> credential stored in c->credential. Clear that too.

Hmph, piling another thing on top of these selected "discard/reset"
we already have should make us rethink a few things.

 - Is this the only place we discard/reset/clear?

 - Isn't there already a helper function that was DESIGNED to do
   this for us?

 - Are all these places we discard/reset/clear using that helper
   function?

For example, when we rejecting credential, shouldn't we be clearing
the same members of the structure as we notice that the auth material
is stale and has expired?

There is credential_clear() and credential_clear_secrets().  Would
one of these want to be reused in this (and also reject) context?

  reply	other threads:[~2024-06-04 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 18:02 [PATCH] credential: clear expired c->credential in addition to c->password Aaron Plattner
2024-06-04 18:24 ` Junio C Hamano [this message]
2024-06-04 18:51   ` Aaron Plattner

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=xmqqed9cva5s.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=aplattner@nvidia.com \
    --cc=git@vger.kernel.org \
    --cc=rrameshbabu@nvidia.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