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

rootless: not require userns for help/version #1268

Closed
wants to merge 1 commit into from

Conversation

giuseppe
Copy link
Member

these commands do not require to be root in an userns

Closes: #1263

Signed-off-by: Giuseppe Scrivano [email protected]

@vrothberg
Copy link
Member

podman help and podman version work but podman info gives me the following error:

could not get runtime: chown /home/vrothberg/.local/share/containers/storage/vfs: operation not permitted

@vrothberg
Copy link
Member

@giuseppe Can we add integration tests for those three cases? Just to avoid any potential regressions.

@giuseppe giuseppe force-pushed the no-rootless-for-version branch 3 times, most recently from a7d9342 to f4e4ab1 Compare August 14, 2018 10:31
"version",
}

func sliceContains(slice []string, s string) bool {
Copy link
Member

Choose a reason for hiding this comment

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

This function probably should live in utils.go.

Copy link
Member Author

Choose a reason for hiding this comment

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

moved

@giuseppe giuseppe force-pushed the no-rootless-for-version branch from f4e4ab1 to 0ec54b6 Compare August 14, 2018 11:08
@vrothberg
Copy link
Member

@giuseppe podman info isn't working with the latest commit.

args := c.Args()
if args.Present() {
name := args.First()
if name != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it impossible that if the args.Present() was true then args.First() == ""?

if args.Present() {
name := args.First()
if name != "" {
requiresRootless := !sliceContains(cmdsNotRequiringRootless, name)
Copy link
Member

Choose a reason for hiding this comment

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

Why create a variable for this?

@@ -25,19 +25,15 @@ var (
exitCode = 125
)

var cmdsNotRequiringRootless = []string{
"help",
Copy link
Member

Choose a reason for hiding this comment

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

Why not make this a map, then you don't need to the string compare stuff below,

Copy link
Member Author

Choose a reason for hiding this comment

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

yes that is better. I've pushed a new version

@giuseppe giuseppe force-pushed the no-rootless-for-version branch from 0ec54b6 to 66ef382 Compare August 14, 2018 13:23
these commands do not require to be root in an userns

Closes: containers#1263

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the no-rootless-for-version branch from 66ef382 to a8b04a2 Compare August 14, 2018 13:24
@mheon
Copy link
Member

mheon commented Aug 14, 2018

This LGTM, but you should update the title to remove info

@giuseppe giuseppe changed the title rootless: not require userns for help/info/version rootless: not require userns for help/version Aug 14, 2018
@giuseppe
Copy link
Member Author

done, I've updated the PR title

@vrothberg
Copy link
Member

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit a8b04a2 has been approved by vrothberg

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit a8b04a2 with merge a04ce68...

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

LGTM

@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: vrothberg
Pushing a04ce68 to master...

@giuseppe giuseppe deleted the no-rootless-for-version branch February 26, 2019 10:31
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants