owncloud / owncloud/core

Update to invalid app tarball fails with wrong error message

Open
#34,669 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

junior job p4-low Type:Bug
Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

Description

Steps
  1. Install an app, for example activity-2.4.1 from tarball: occ market:install -l activity-2.4.1.tar.gz
  2. Go to Github releases and download the wrong tarball, not the release one but the github sources: https://github.com/owncloud/activity/archive/v2.4.2.tar.gz
  3. occ market:upgrade -l activity-2.4.2.tar.gz <= the wrong tarball
Expected result

Upgrade fails with proper error message.

Actual result

Original app is deleted but the new app isn't there.
This basically deletes the app...

Version

stable10 / 10.1.0

Note: the "wrong" tarball doesn't have "activity" as root path but "activity-2.4.2".
We should extend the update code to verify that the tarball contains an "activity" folder just like the install process does.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the app update code exercised by occ market:upgrade -l activity-2.4.2.tar.gz, and compare its tarball handling with the install process used by occ market:install. Reproduce the upgrade using a tarball whose root folder is activity-2.4.2 rather than activity; done means the original app is preserved and the command reports a proper validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.