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

installing mysql_router may break authorized user check #46

Open
jdanilson opened this issue Aug 11, 2020 · 0 comments
Open

installing mysql_router may break authorized user check #46

jdanilson opened this issue Aug 11, 2020 · 0 comments

Comments

@jdanilson
Copy link

MySQL 8.x distros includes the optional mysql router in the rpm list. If it is installed, a new user, mysql_router is created.

If the authorized user for bgbackup is mysql then this logic in the check_user_validation function may fail because it may find more than one /etc/passwd entry matching but not the one that's exactly "mysql"

The code in question is:
-permitted_user_id=$(grep ^$permitted_user /etc/passwd | /usr/bin/cut -d':' -f3)

My solution would be to match on the user plus the following colon thusly:
+permitted_user_id=$(grep ^${permitted_user}: /etc/passwd | /usr/bin/cut -d':' -f3)

I don't know how to use github to make this code change. Hopefully this is useful.

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

No branches or pull requests

1 participant