Closed (outdated)
Project:
Backup and Migrate
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 May 2012 at 13:22 UTC
Updated:
17 Nov 2017 at 17:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
glynnr commentedConfirmed and thank you.
I appreciate this is an old report on an old code base, but I unfortunately have had to work on it recently and am not is position to upgrade at the moment. In case anyone else finds themselves in this position, here are my findings :
This was breaking image_browser, which calls image_fetch from the image module to stream the actual file. This function invokes hook_file_download via module_invoke_all, which collects all the headers for this image.
The bug reported above was causing the _backup_migrate_path_is_in_save_dir function to erroneously return TRUE and therefore causing execution to fall through into the access checks, instead of skipping to the end. As a result, backup_migrate_file_download was returning -1, which gets merged in to the headers array.
As the return from hook_file_download is an array, execution passes through the conditional (if ($headers == -1)) and sets the headers. Trying to set a header of -1 causes the server to return an error 500
In addition, the result of the _backup_migrate_path_is_in_save_dir check, which is a boolean value, was being assigned to the $path variable, thus invalidating call to _backup_migrate_file_info($path)
So to fix : Implement the above suggestion, and remove the assignment
Comment #2
webservant316 commentedyes - still agreed. I am still patching the backup_migrate modules personally until this bug is fixed.
Comment #3
ghede commentedI also had this issue with webfm, and changing the code fixed it. Researching this I noticed that this issue is flagged as happening in version 6x-2.6. I'm using the older 6x-1.3. I did a search for the code in version 6x-2.6 and 7x-2.4 and it did not show up - maybe I missed something or the version setting for this issue is incorrect?
Anyway, thanks for the help.
Jim
Comment #4
webservant316 commentedhmmm yes my fault. I just realized that I noted the wrong version. Now properly set.
Comment #4.0
webservant316 commentedlink back to webfm
Comment #5
caktux commentedThis problem makes every request to a private file fail with a 403. It might be an old version but this should be committed and deserves a release.
Comment #6
couturier commentedDrupal 6 and Backup and Migrate 6 are no longer supported.
Comment #7
couturier commented