Skip to content

sshd/auth.sh always returns error-values, because of bad jq args #17

@kikoshiro

Description

@kikoshiro

Hello,

did sshd/auth.sh ever work? Whatever i try, it only produces error-values.
I could track the Problem back to those lines:

jq -r -c -e --arg u "${1}" '.users?.[]? | select(.username? == $u)' "${AUTH_CONFIG_PATH}" 2>/dev/null

user_keys=$(echo "${1}" | jq -r -c .keys?.[]?)

i could fix it by replacing these lines where JQ is failing:
L42:

  jq -r -c -e --arg u "${1}" '.users[] | select(.username == $u)' "${AUTH_CONFIG_PATH}" 2>/dev/null

L61:

  user_keys=$(echo "${1}" | jq -r -c '.keys[]')

I didnt not check "dump_keys_github" so far, actually i commentet this out in my testing.

Cheers

Kiko

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions