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

@Wentao[master]: fix CentOS 7 execution permission over libnssfix_XXXX.so #200

Closed
wants to merge 1 commit into from
Closed

@Wentao[master]: fix CentOS 7 execution permission over libnssfix_XXXX.so #200

wants to merge 1 commit into from

Conversation

sansna
Copy link

@sansna sansna commented Oct 14, 2021

In CentOS7, pypi latest staticx 0.13.2 build static binary error, requesting execution permission for libnssfix_XXXX.so, fixed now.

@JonathonReinhart
Copy link
Owner

Hi @sansna,

I would appreciate it if you would please open an issue before submitting a pull request that claims to fix a bug.

Can you please explain exactly the problem that you are fixing?

  • Did the error occur while building the binary with staticx or while running the generated file?
  • Can you please copy and paste the exact error message?

@sansna
Copy link
Author

sansna commented Oct 14, 2021

Hi @sansna,

I would appreciate it if you would please open an issue before submitting a pull request that claims to fix a bug.

Can you please explain exactly the problem that you are fixing?

  • Did the error occur while building the binary with staticx or while running the generated file?
  • Can you please copy and paste the exact error message?

Hi @JonathonReinhart , issue opened at #203

@sansna sansna changed the title @Wentao[master]: fix CentOS 7 write permission over libnssfix_XXXX.so @Wentao[master]: fix CentOS 7 execution permission over libnssfix_XXXX.so Oct 14, 2021
@JonathonReinhart
Copy link
Owner

JonathonReinhart commented Oct 14, 2021

Thanks for the fix @sansna. I decided to handle this slightly differently (#204).

I'll leave feedback on the specific reasons.

Copy link
Owner

@JonathonReinhart JonathonReinhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left the following comments for your information, but I already implemented this in #204.

Also, I must point out that your commit message was oddly formatted, and should follow the format of the existing commits on the project.

@@ -13,6 +14,8 @@ def process_glibc_prog(sx):
try:
nssfix = copy_asset_to_tempfile(LIBNSSFIX, debug=sx.debug,
prefix='libnssfix-', suffix='.so')
umask=os.umask(0o755)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: This is bad because it changes the umask of the currently-running process to 0o755.

@@ -13,6 +14,8 @@ def process_glibc_prog(sx):
try:
nssfix = copy_asset_to_tempfile(LIBNSSFIX, debug=sx.debug,
prefix='libnssfix-', suffix='.so')
umask=os.umask(0o755)
os.chmod(nssfix.name, 0o755&~umask)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: There is already a make_executable function in staticx.utils.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Your new code shouldn't be inside of the existing try/except KeyError block.

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.

2 participants