Skip to content

whoknows -l breaks when multiple users are returned for 1 e-mail #1020

@cattapan

Description

@cattapan

What are the steps to reproduce this issue?

  1. git-secret tell oneuser@myorg.org
  2. git-secret tell user@myorg.org
  3. git-secret whoknows -l

What happens?

oneuser@myorg.org (expires: 2024-08-22)
user@myorg.orgusage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
[-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
[[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
(expires: )

What were you expecting to happen?

oneuser@myorg.org (expires: 2024-08-22)
user@myorg.org (expires: 2023-12-20)

Any logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?

This line

line=$($SECRETS_GPG_COMMAND --homedir "$secrets_dir_keys" --no-permission-warning --list-public-keys --with-colon --fixed-list-mode "$username" | grep ^pub: 3>&-)
returns multiple results for "user@myorg.org".

Maybe a possible workaround is function _extract_emails_from_gpg_output to return the username with <>, to make sure a complete match happens?

What versions of software are you using?

Operating system: (uname -a) … Darwin Kernel Version 22.5.0

git-secret path: (which git-secret) … installed by homebrew

git-secret version: (git secret --version) … 0.5.0

git version: (git --version) … not related to git, but gpg

Shell type and version: ($SHELL --version) …zsh 5.9

gpg version: (gpg --version) …
gpg (GnuPG) 2.4.3
libgcrypt 1.10.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions