Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zk_conn.go: Ignore trailing newline in topo_zk_auth_file #6029

Closed
gedgar opened this issue Apr 8, 2020 · 0 comments · Fixed by #6030
Closed

zk_conn.go: Ignore trailing newline in topo_zk_auth_file #6029

gedgar opened this issue Apr 8, 2020 · 0 comments · Fixed by #6030

Comments

@gedgar
Copy link
Contributor

gedgar commented Apr 8, 2020

Feature Description

PR #4733 added support for Vitess client authentication with Zookeeper via digest username/password.

If you create your topo_zk_auth_file using an editor, it will include a trailing newline which, when sent with the digest to zk, breaks things:

$ diff zk_bad.auth zk_good.auth
1c1
< digest:user:password
---
> digest:user:password
\ No newline at end of file
$ zk -topo_zk_auth_file=zk_bad.auth -server 127.0.0.1:2181 ls /vitess
W0407 17:23:37.798482   19530 zkcmd.go:320] ls: cannot access /vitess: zk: not authenticated

It'd be nice if we changed the code to chomp the input from the file to prevent this from happening.

aquarapid added a commit to planetscale/vitess that referenced this issue Apr 8, 2020
…h_file

Potential breaking change if your passwords have trailing newlines.

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
sougou added a commit that referenced this issue Apr 9, 2020
Implement #6029 by chomping trailing newlines in -topo_zk_auth_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant