Bug report – incorrect privileges check
-
We’ve noticed a bug on Duplicator where Duplicator checks for the correct privileges.
Upon inspecting the code, we’ve noticed that it in essence does a SHOW GRANTS to see if specific privileges are applied or if somewhere ALL PRIVILEGES is to be found. However, in the use case of our customer, it gave a warning.
After doing more inspecting, we’ve noticed that the output of SHOW GRANTS was parsed incorrectly and an underscore in the database name should have been escaped.
We were able to fix this by applying this:
$dbName = addcslashes($dbName, '_%');We’ve applied this to classes/validation/class.validation.database.service.php
Before the change our testing delivered this result:
START TEST "Privileges: User Table Access" [CLASS: DUPX_Validation_test_db_user_perms] GRANTS LINE OF CURRENT DB NOT FOUND GRANTS LINE OF CURRENT DB NOT FOUND LOG-TIME[DELTA: 0.01468] MESSAGE:TEST "Privileges: User Table Access" RESULT: hard warningAfter the change our testing delivered this result:
START TEST "Privileges: User Table Access" [CLASS: DUPX_Validation_test_db_user_perms] LOG-TIME[DELTA: 0.01612] MESSAGE:TEST "Privileges: User Table Access" RESULT: passedI hope this helps.
The topic ‘Bug report – incorrect privileges check’ is closed to new replies.