Sync D7's copy of Archive_Tar with new 1.5.0 release

Created on 16 March 2024, 10 months ago
Updated 18 June 2024, 6 months ago

Problem/Motivation

PEAR's Archive_Tar just made a new 1.5.0 release.

D7 has a copy of this code in the system module.

We should update D7's copy with the changes; there's nothing too significant but the full minor release bump was because of a change in behaviour around file permissions which is probably worth a CR.

Steps to reproduce

Compare D7's modules/system/system.tar.inc with the new Archive_Tar release.

Proposed resolution

Sync / merge upstream changes.

Remaining tasks

As above.

User interface changes

n/a

API changes

See comment above re. file permissions change - this was the upstream PR:

https://github.com/pear/Archive_Tar/pull/46

Data model changes

n/a

Release notes snippet

tbc

πŸ“Œ Task
Status

Fixed

Version

7.0 ⚰️

Component
SystemΒ  β†’

Last updated 10 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mcdruid
  • last update 10 months ago
    2,179 pass
  • Status changed to Needs review 10 months ago
  • πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί
  • Status changed to RTBC 9 months ago
  • πŸ‡ΈπŸ‡°Slovakia poker10

    Thanks for working on this!

    Seems like the Archive_Tar class is used for example when using the Update manager to install a new module via UI (or update a module). See the update_manager_install_form() or update_manager_archive_extract() function.

    I was able to trigger the Archive_Tar::_dirCheck() when installing the module via UI (using tar.gz archive). It seems like this function is currently setting the 777 permissions in the temporary directory, where the archive is extracted for the first time. Then the Updater::install() or Updater::update() function is copying the directory from temporary filesystem to the correct destination and permissions are corrected to 755 (at least during my limited testing).

    Are we aware of any (other) usage in D7 core where the 777 permissions are kept (so that we can explain that in the CR)? Contrib modules can also use this core library differently (extracting code somewhere else), so I agree that we need the CR to describe this behavioral change.

    Otherwise the changes looks good to me.

  • πŸ‡ΈπŸ‡°Slovakia poker10

    I have drafted a simple CR here: https://www.drupal.org/node/3451526 β†’ (feel free to update if needed).

    Otherwise I think this is ready. Adding a tag.

  • πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί

    I'm not aware of anywhere else that core might be affected by this, no.

    We have some quasi-unit tests (which couldn't be actual unit tests as they involve using e.g. the temp directory which means Drupal has to be somewhat bootstrapped IIRC) in SystemArchiverTest (added in #3102159: Add tests for Archive_Tar β†’ ) if we wanted to add anything specific around this change.

    I don't think we specifically need to in this case as we're just mirroring the upstream change, and existing tests cover core's actual usage - I think that's e.g. \UpdateTestUploadCase::testUploadModule which I only found after I'd added the unit(ish) tests mentioned above.

  • πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί

    Oh, and draft CR looks good, thanks.

    • poker10 β†’ committed e755b13e on 7.x
      Issue #3429165 by mcdruid: Sync D7's copy of Archive_Tar with new 1.5.0...
  • Status changed to Fixed 7 months ago
  • πŸ‡ΈπŸ‡°Slovakia poker10

    Thanks! Committed and pushed this.

  • πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024