The downloaded file results in 0600 permissions for me (on Ubuntu).

Make configuration:

libraries[jquery.cycle][download][type] = "get"
libraries[jquery.cycle][download][url] = "https://github.com/downloads/malsup/cycle/jquery.cycle.all.2.88.min.js"

; permissions problem happens whether or not the following line is used:
;libraries[jquery.cycle][download][filename] = "jquery.cycle.all.min.js"

Permissions:

....../libraries/jquery.cycle (master *+)$ ls -lh
-rw-------  1 ajd ajd  31K 2012-02-27 18:00 jquery.cycle.all.2.88.min.js

The permissions for the jquery.cycle *folder* (in libraries/) are OK.

The permissions for all the other libraries' contents (all from zip files) are as expected.

Comments

adamdicarlo’s picture

Version: » 5.x-1.0-rc3

Updating version -- this happens on 5.x-1.0-rc3 but I just realized on HEAD, single file download isn't working at all for me. See #1459624: Single file download with make is broken with directory exists errors.

moshe weitzman’s picture

Status: Active » Closed (works as designed)

drush is completely agnostic about perms. one option for you is to run commands as the user you want to own the new files. see http://randyfay.com/node/114

adamdicarlo’s picture

Hi @moshe,

Thanks for the link, but I'm not talking about which user owns the file.

I'm still suspicious of Drush given that

  • this behavior is different from pre-Drush 5 Drush Make,
  • `touch foobar` on my machine results in the perms -rw-r--r-- on 'foobar', while the single file downloaded via Drush 5 make gets the perms -r--------, and
  • my build script that runs drush make also copies some local files into profiles/libraries/[foobar] using rsync, and they also get the perms -rw-r--r-- edit: and yes, `cp`ing files on my system results in the same as using rsync.

Do you still think it isn't a drush bug? I might be missing something about how umask works... I'd love a pointer if so.

Is it possible PHP's umask doesn't default to the same as that of the user running drush? And single file downloads are copied/moved into place via PHP rather than via forking a shell to do it? That might explain this...

Either way, thanks for considering this new information.

adamdicarlo’s picture

Okay, after a cursory look at the code, it looks drush *is* forking a shell to run "mv %s %s" on single files (in make_file_download_unpack()).

Hmmmm... I must be missing something...

nedjo’s picture

Status: Closed (works as designed) » Active

I'm currently getting this issue in the Open Outreach dev release and can reproduce it locally using drush 5.1 and the following excerpt of the Open Outreach drupal-org.make file:

libraries[colorbox][directory_name] = "colorbox"
libraries[colorbox][download][type] = "get"
libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/zipball/v1.3.16"
libraries[jquery.cycle][download][type] = "get"
libraries[jquery.cycle][download][url] = "https://raw.github.com/malsup/cycle/master/jquery.cycle.all.js"
libraries[json2][download][type] = "get"
libraries[json2][download][url] = "https://github.com/douglascrockford/JSON-js/raw/master/json2.js"

The colorbox code comes in with correct permissions but both json2.js and jquery.cycle.all.js come in with 0600 permissions, as they do in the packaged Open Outreach dev release.

I looked through a large sample of D7 distros' drupal-org.make files and didn't find any instances of single-file library downloads. However, this commit on OpenChurch, which removed jquery.cycle from the .make file and instead added it directly to the install profile, looks to be a workaround to the same issue (reported in #1508276: Homepage Rotator doesn't work).

nedjo’s picture

Implemented a workaround, see #1566236-2: Views slideshow broken--packaged with incorrect file permissions, so the Open Outreach dev release won't show this issue any more, but the .make file in #5 still does.

jonhattan’s picture

Status: Active » Closed (cannot reproduce)

I've tested both makefiles in OP and #5 and I obtain 644 on files.

@adamdicarlo I can't find a single occurrence of "mv" in drush 5.x code. Perhaps you're using old drush_make

http://api.drush.org/api/drush/commands%21make%21make.download.inc/funct...

fluffy’s picture

For me this only happens when using --tar