Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rhatdan
Copy link
Collaborator

@rhatdan rhatdan commented Sep 26, 2022

Since label.Relabel ends up calling into selinux.chcon, we should do the check for invalid directories under chcon. This will allow the selinux.Chcon function to also be verified.

Signed-off-by: Daniel J Walsh [email protected]

Since label.Relabel ends up calling into selinux.chcon, we should
do the check for invalid directories under chcon. This will allow
the selinux.Chcon function to also be verified.

Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan
Copy link
Collaborator Author

rhatdan commented Sep 26, 2022

Comment on lines +1114 to +1122
if home := os.Getenv("HOME"); home != "" {
exclude_paths[home] = true
}

if sudoUser := os.Getenv("SUDO_USER"); sudoUser != "" {
if usr, err := user.Lookup(sudoUser); err == nil {
exclude_paths[usr.HomeDir] = true
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Will this part bring back the issue you ran into that you were trying to solve in #180?

But some users put homedirectories under /usr, and I see no reason to block them from relabeling.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No the #180 was blocking /usr/*
Now we are just blocking /usr or $HOME not $HOME/*

Copy link
Member

Choose a reason for hiding this comment

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

Ah, gotcha!

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@rhatdan
Copy link
Collaborator Author

rhatdan commented Sep 26, 2022

Copy link
Collaborator

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan merged commit b625eea into opencontainers:main Sep 26, 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.

3 participants