ares-package: make every directory 0777, like ares-cli does - #16
Merged
Conversation
mariotaku
force-pushed
the
fix/package-dir-mode
branch
from
August 23, 2026 14:03
6193d66 to
0ff5a11
Compare
Directory entries were hardcoded to 0775. ares-cli emits 0777 for every directory, so match it. It forces its umask to 0 (lib/package.js, setUmask.bind(this, 0)) and stages the tree with mkdirp's 0777, so the source tree's own modes never reach the ipk. Verified against @webos-tools/cli 3.2.5: a directory that is 0700 in the source tree comes out 0777. The masking in its fixupDirs - "readable directories have execute permission", plus a service-directory case that would take 0755 to 0777 - is dead code. The staging dirs are already 0777 by the time the tar filter runs, so neither branch changes a bit. Also fixes the type bit, which said S_IFREG for a directory entry. Harmless, since libopkg masks & 0o7777, but wrong. uid/gid are left alone. ares-cli writes whoever ran the build instead, but the install discards both, so there is nothing to match here. Output now matches ares-cli on every member except packageinfo.json, where it emits 0666 and this emits 0644 - fs.writeFile's default 0666 falling through the forced umask, rather than a decision. File modes are untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gde2tcn5SbUHKhesuTNB7a
mariotaku
force-pushed
the
fix/package-dir-mode
branch
from
August 23, 2026 14:05
0ff5a11 to
80bd445
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Directory entries were hardcoded to
0775.ares-cliemits0777for every directory, so match it.What ares-cli actually does
It forces its umask to
0(lib/package.js,setUmask.bind(this, 0), applied at all three packaging entry points) and stages the tree withmkdirp's0777, so the source tree's own modes never reach the ipk.Verified end-to-end against
@webos-tools/cli3.2.5 on the same source tree — notelocked/, which is0700on disk:The masking in its
fixupDirs— "Make sure readable directories have execute permission", plus a service-directory case that would take0755to0777— is dead code. The staging dirs are already0777by the time the tar filter runs, so neither branch changes a bit.Also in here
S_IFREGfor a directory entry. Harmless, since libopkg masks& 0o7777, but wrong.0/5000.ares-cliwrites whoever ran the build instead, but the install discards both, so there is nothing to match here.Result
Output now matches
ares-clion every member exceptpackageinfo.json, where it emits0666and this emits0644—fs.writeFile's default0666falling through the forced umask, rather than a decision.Two tests added: every directory is
0o040_777+EntryType::Directory, and files are neither group- nor world-writable.Not addressed
ares-clidoesentry.mode |= 0o004on every file, guaranteeing world-readable. We take the source mode as-is, so a0600file in the source ships as0600. That's a parity gap, but it's a file-mode change and out of scope here.