diff options
| author | Igor Soarez <igor@soarez.org> | 2026-11-20 10:57:22 +0000 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-11-20 10:57:22 +0000 |
| commit | c159f7526224d6dca42a456162e1b116083751df (patch) | |
| tree | 8cb493da70ac5aacf15c66f1191128b8cea98d7c | |
| parent | 8440c6816f833e9848bbfd976902af46f49d6ff3 (diff) | |
szecret list: --json under gawk with the old store shown; a file name szecret would refuse is skipped, with a warningHEADmaster
| -rwxr-xr-x | secrets/list.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/secrets/list.sh b/secrets/list.sh index 9037071..3f5f56a 100755 --- a/secrets/list.sh +++ b/secrets/list.sh @@ -121,6 +121,12 @@ add_bucket() { for f in "${d}"/*.age; do [[ -e "${f}" ]] || continue n="$(basename "${f}" .age)" + # awk takes the names as one space-separated assignment: a name put + # would refuse (spaces, backslashes, newlines) is named here instead. + if [[ ! "${n}" =~ ${re_secret} ]]; then + >&2 printf 'szecret list: skipped a file whose name szecret would refuse, in %s: %q\n' "${label}" "${n}" + continue + fi names="${names} ${n}" if [[ -r "${f}" && -f "${f}" ]]; then files+=("${f}") @@ -233,6 +239,7 @@ function finish(b, i, k, n, a, l, plus, minus, s) { l = LABEL[b] if (OLD[b]) { READABLE[b] = old_readable + NR_[b] = 0 } else { n = split(TO_LINE[b], a, " ") NTO[b] = 0 |
