Closed (fixed)
Project:
Drush
Version:
8.x-6.x-dev
Component:
Make
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jun 2013 at 13:42 UTC
Updated:
22 Jul 2013 at 10:31 UTC
When running drush make --prepare-install ..., the command correctly creates the files directory (chmod 0777) and settings.php (chmod 0666).
However, after the build is complete, it is moved from /tmp to the 'live' directory by make_move_build(). That function eventually calls drush_copy_dir(), which in turn calls _drush_recursive_copy(), which contains the following code:
// Preserve execute permission.
if (!is_link($src) && !drush_is_windows()) {
// Get execute bits of $src.
$execperms = fileperms($src) & 0111;
// Apply execute permissions if any.
if ($execperms > 0) {
$perms = fileperms($dest) | $execperms;
chmod($dest, $perms);
}
}
So basically drush make --prepare-install ... sets writable flags on 'files' and 'settings.php', only to have the chmod undone by _drush_recursive_copy later on. :)
Comments
Comment #1
jonhattanThis code is ok. Indeed it does what it says: preserve execution bits after a copy operation. See #1168812: Respect filesystem permissions for reference. Comments #6,#17, #22 and on.
--prepare-install should change permissions on final destination.
Comment #2
jonhattanFixed in 65144bd and backported to Drush 5.
Comment #3
kristiaanvandeneyndeThanks!
Shouldn't the last two lines be deleted here then?
Otherwise you chmod the pertaining items three times (+w, -w, +w).
Comment #4
jonhattanNo, its fine as it is. We need to fully build in tmp. It is needed by --tar option, and also for tests. To adding a conditional for this two lines doesn't worth it IMO.
Comment #5
kristiaanvandeneyndeAll right, good fix then :)