bgbackup
bgbackup copied to clipboard
installing mysql_router may break authorized user check
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.