Skip to content

Fix fastzip to support artifacts for nonroot users

Arran Walker requested to merge ajwalker/upgrade-fastzip-v0.1.5 into master

What does this MR do?

Upgrades fastzip.

Why was this MR needed?

  • Fixes case where created directories do not respect umask setting: #27398 (comment 478324727)
  • Fixes regression with zip filenames being internally stored with Windows path-separators when created on Windows

What's the best way to test this MR?

  • Testing the file slash regression is tested as part of fastzip already and from the modifications here, you can see the correct use of ToSlash(). But if we want to to perform an additional manual test, an artifact on Windows can be created and inspecting the zip will show that the file separators are incorrect (they should always be forward slashes).

  • Testing whether the umask setting is respected can be done manually with this .gitlab-ci.yml. It fails if FF_USE_FASTZIP is enabled and passes if FF_USE_FASTZIP disabled.

image: busybox:latest
variables:
  FF_USE_FASTZIP: 1

stages:
  - A
  - B

job a:
  stage: A
  script:
    - adduser --disabled-password --gecos '' newuser
    - su newuser -c 'mkdir artifacts'
    - su newuser -c 'echo "Hello World A" > artifacts/important_a.log'
    - ls -lah artifacts
  artifacts:
    paths:
      - artifacts/*

job b:
  stage: B
  needs:
    - job a
  script:
    - adduser --disabled-password --gecos '' newuser
    - ls -lah
    - ls -lah artifacts
    - su newuser -c 'echo "Hello World" > artifacts/no_permissions.log'
    - ls -lah artifacts

closes #27398 (closed)

Edited by Steve Xuereb

Merge request reports