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

--updateversion saves updates to incorrect location #499

Closed
Steve8291 opened this issue May 6, 2020 · 2 comments
Closed

--updateversion saves updates to incorrect location #499

Steve8291 opened this issue May 6, 2020 · 2 comments

Comments

@Steve8291
Copy link
Contributor

When the option --updateversion is passed to mysqltuner.pl all of the updated file versions are downloaded into the present working directory. For instance, if I am in /tmp and run the command /usr/local/mysqltuner/mysqltuner.pl --updateversion --cvefile /usr/local/mysqltuner/vulnerabilities.csv all of the updates are downloaded via curl or wget to /tmp Since I run mysqltuner.pl with a cron script these files are not getting updated. I have no idea where they (mysqltuner.pl vulnerabilities.csv basic_passwords.txt) are saving to.
The pertinent lines in mysqltuner.pl are 585-586

            $update =
              `$httpcli --connect-timeout 3 '$url$script' 2>$devnull > $script`;

Would there be a way to use the variables that are already set like $basic_password_files and $opt{cvefile} etc. to adjust the save path for $script to the location where the user actually has mysqltuner.pl installed?
The other option I was thinking of was to change the code on line 586 to something along the lines of:

`$httpcli --connect-timeout 3 '$url$script' 2>$devnull > dirname(__FILE__)"/$script"`;

I don't know much perl so I can't be of much help here.

@jmrenouard
Copy link
Collaborator

Hi,

I fix it :)

@jmrenouard
Copy link
Collaborator

Thanks @Steve8291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants