Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apk] package file format error #805

Open
2 tasks done
cnt0 opened this issue Mar 26, 2024 · 0 comments
Open
2 tasks done

[apk] package file format error #805

cnt0 opened this issue Mar 26, 2024 · 0 comments
Assignees
Labels
bug Something isn't working good-first-issue
Milestone

Comments

@cnt0
Copy link
Contributor

cnt0 commented Mar 26, 2024

What happened?

OK, I build the apk package with the following config

# ...
contents:
- src: ./install
  dst: /usr
  type: tree

apk:
  signature:
    key_file: xxxx.rsa
    key_name: xxxx.rsa.pub

uploaded to local repository and trying to install it. I'm getting the following error:

$ doas apk add my_package
ERROR: my_package: package file format error

I managed to investigate this problem on the apk side and found that it complains about the missing mode data in the archive. So it can be worked around by modifying the nfpm.yaml like this:

# ...
contents:
- src: ./install
  dst: /usr
  type: tree
  file_info:
    mode: 0755
# ...

However, this file_info attribute is actually very dangerous with such config, cause it can overwrite your /usr/bin, /usr/lib, etc permissions with some incorrect value, resulting in unusable system. So I'd rather fix the appropriate parts of nfpm code.

How can we reproduce this?

prepare the apk package with config described above, add to the repository and try installing it with apk add command

nfpm version

the one from https://github.com/goreleaser/nfpm/pull/804 (so git main, essentially)

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@cnt0 cnt0 added the bug Something isn't working label Mar 26, 2024
@caarlos0 caarlos0 added this to the 2.38.0 milestone May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue
Projects
None yet
Development

No branches or pull requests

2 participants