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

add use-sudo optional parameter defaulting to false. Fixes: #85 #84

Merged
merged 1 commit into from Jul 1, 2022

Conversation

jsolis
Copy link
Contributor

@jsolis jsolis commented Jun 29, 2022

Summary

Adds optional input use-sudo that can be set to true in the case that install-dir requires sudo privs. The reason for this is that always using sudo actually broke our self-hosted runners since the user the runner runs as doesn't have sudo privs by security design.

Ticket Link

Fixes #85

Release Note

* adds `use-sudo` optional input which defaults to false

@jsolis jsolis force-pushed the main branch 2 times, most recently from ac30cae to 2fe9b69 Compare June 29, 2022 20:28
@jsolis jsolis changed the title add use-sudo optional parameter defaulting to false. Fixes: #17 add use-sudo optional parameter defaulting to false. Fixes: #85 Jun 29, 2022
README.md Outdated Show resolved Hide resolved
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thanks for the PR, just a minor comments

@jsolis
Copy link
Contributor Author

jsolis commented Jun 30, 2022

The one failing test failed for cosign: error while loading shared libraries: libpcsclite.so.1: cannot open shared object file: No such file or directory when testing cosign 0.6.0. I don't believe my changes would have caused this 🤔

@cpanato
Copy link
Member

cpanato commented Jun 30, 2022

The one failing test failed for cosign: error while loading shared libraries: libpcsclite.so.1: cannot open shared object file: No such file or directory when testing cosign 0.6.0. I don't believe my changes would have caused this 🤔

The one failing test failed for cosign: error while loading shared libraries: libpcsclite.so.1: cannot open shared object file: No such file or directory when testing cosign 0.6.0. I don't believe my changes would have caused this 🤔

kind of, because that to install the lib it needs the sudo and now it is not setting

INFO: libpcsclite1 package is not installed, installing it now.
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

in this part: https://github.com/sigstore/cosign-installer/blob/main/action.yml#L208-L223
we might need to add the sudo back here

@jsolis
Copy link
Contributor Author

jsolis commented Jun 30, 2022

in this part: https://github.com/sigstore/cosign-installer/blob/main/action.yml#L208-L223 we might need to add the sudo back here

Yep ok, I'll fix this. I should have paid more attention to this failure, sorry about that.

Signed-off-by: Jason Solis <jsolis@gmail.com>
@jsolis
Copy link
Contributor Author

jsolis commented Jun 30, 2022

OK, I can see from before the sudo changes were made, that block of code always used sudo and my new changes broke that. I have put back the sudo commands instead of using $SUDO. All tests are now passing on my fork.

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thank you!

@cpanato cpanato merged commit 48866aa into sigstore:main Jul 1, 2022
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.

sudo breaks self-hosted runners
2 participants