Skip to content

fix: dpkg-deb: error: control directory has bad permissions 756 (must…#347

Open
flyyuan wants to merge 7 commits into
electron-userland:mainfrom
flyyuan:main
Open

fix: dpkg-deb: error: control directory has bad permissions 756 (must…#347
flyyuan wants to merge 7 commits into
electron-userland:mainfrom
flyyuan:main

Conversation

@flyyuan

@flyyuan flyyuan commented Sep 12, 2023

Copy link
Copy Markdown

@flyyuan

flyyuan commented Sep 15, 2023

Copy link
Copy Markdown
Author

@fcastilloec

@fcastilloec

fcastilloec commented Sep 15, 2023

Copy link
Copy Markdown
Collaborator

@flyyuan
There's already a PR in progress (#261) that should fix this same issue.
From what I just read over there, it was missing a test, which this PR is also missing. If you add a test, you'll probably have better chances of getting this merge.
Last, your approach is slightly different than the older PR, I have no authorization to merge PRs, so I suggest you contact some of the other maintainers to see which direction is best.

PS: Always run any test locally so you don't see basic errors on the CI tests. (npm run test)

@flyyuan

flyyuan commented Sep 15, 2023

Copy link
Copy Markdown
Author

@fcastilloec Thank you~
I added a unit test for it and ran test locally, which didn't show any errors.

@flyyuan

flyyuan commented Sep 15, 2023

Copy link
Copy Markdown
Author

@unindented

@flyyuan

flyyuan commented Sep 16, 2023

Copy link
Copy Markdown
Author

Thank you for your feedback, @fcastilloec. I've taken note of PR #261, but I believe my approach might offer a different solution. I've added a unit test for this and ran the tests locally without encountering any errors. I hope my PR can provide an effective fix, especially considering the issues faced in specific environments like GitHub codespaces.

@unindented , could you please conduct a code review (CR) on this PR when you have a moment? Your insights would be greatly appreciated.

Thanks again for your guidance and suggestions, @fcastilloec

@flyyuan

flyyuan commented Sep 21, 2023

Copy link
Copy Markdown
Author

@fcastilloec @unindented

@unindented

Copy link
Copy Markdown
Contributor

@fcastilloec @unindented

Same as Felipe, I'm no longer a maintainer. Maybe try reaching out to the current maintainers.

@flyyuan

flyyuan commented Sep 22, 2023

Copy link
Copy Markdown
Author

@erickzhao @VerteDinde

# Conflicts:
#	src/installer.js
#	test/installer.js
Under restrictive umasks (e.g. GitHub Codespaces) the staging directory
tree can be left with permissions dpkg-deb rejects, failing with
"control directory has bad permissions 756 (must be >=0755)".

Recursively chmod directories under the staging dir to 0755 before
invoking dpkg-deb. Files are left untouched so data files aren't made
executable.

Closes electron-userland#346
@VerteDinde

Copy link
Copy Markdown
Contributor

Hi @flyyuan, first off, apologies this sat so long without a response - this slipped through the cracks when we started maintaining some userland packages. I'm very sorry about that, appreciate your patience here.

I've pushed a couple of commits directly to your branch, if that's no problem; I went that route deliberately to preserve your authorship and contribution credit, rather than opening a fresh PR and closing yours. Happy to do it differently if you'd prefer.

The repo migrated to ESM since you opened this, so on top of your original work I merged latest main, made setDirectoryPermissions recursive/awaited, scoped it to directories so data files don't become executable, and reworked the test to verify the recursive behavior directly.

Thanks again for the original fix - let me know if you'd like any changes, otherwise I'll get this merged for you. Thanks, and thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants