Bug #13096353 62712: RPM-BASED INSTALL OF THE TEST SUITE IS USELESS FOR NON-ROOT USERS

Simplified fix avoiding changes to mysys:
  Use the MY_HOLD_ORIGINAL_MODES flag when calling my_copy(),
    this also stops it from attempting to chown() the file.
  Yes this behavior is a bit confusing....
  The only case this might change the behavior is if the destination file
    exists, but since we also use MY_DONT_OVERWRITE_FILE, it would fail
    in those cases anyway.
This commit is contained in:
Bjorn Munch 2011-11-03 15:57:18 +01:00
parent 4f2bbf781b
commit 40f42cac72

View file

@ -3344,8 +3344,9 @@ void do_copy_file(struct st_command *command)
' ');
DBUG_PRINT("info", ("Copy %s to %s", ds_from_file.str, ds_to_file.str));
/* MY_HOLD_ORIGINAL_MODES prevents attempts to chown the file */
error= (my_copy(ds_from_file.str, ds_to_file.str,
MYF(MY_DONT_OVERWRITE_FILE)) != 0);
MYF(MY_DONT_OVERWRITE_FILE | MY_HOLD_ORIGINAL_MODES)) != 0);
handle_command_error(command, error);
dynstr_free(&ds_from_file);
dynstr_free(&ds_to_file);