Fixes #39132 - Do not rely on ACLs where not strictly necessary#131
Fixes #39132 - Do not rely on ACLs where not strictly necessary#131adamruzicka merged 1 commit intotheforeman:masterfrom
Conversation
ofedoren
left a comment
There was a problem hiding this comment.
Just a few cents: this fix explicitly checks if the user is root, but what about users that are sudoers, but are not root?
The steps in the issue suggest that it shouldn't fail for sudoers, but that's not that clear, thus asking.
| def ensure_effective_user_access(*paths, mode: 'rx') | ||
| unless @user_method.is_a? NoopUserMethod | ||
| ensure_remote_command("setfacl -m u:#{@user_method.effective_user}:#{mode} #{paths.join(' ')}") | ||
| return if @user_method.is_a?(NoopUserMethod) || @user_method.effective_user == 'root' |
There was a problem hiding this comment.
In case where @user_method.effective_user == 'root' && @user_method.ssh_user != 'root', does the ssh user have permissions to clean up all the working directories around L256 when the job is done?
There was a problem hiding this comment.
hm, well using the scenario from the downstream tests it does, but I suppose that's because it is in wheel, so I guess it would depend on the ssh_user rights. But this was the case before this change as well.
There was a problem hiding this comment.
that's because it is in wheel
Ohh, so the ownership transfers to the effective user, but the group ownership is left to the connection user's primary group, meaning the connection user retains write permissions through the group, cool. So not necessarily because of wheel, but because of a group
|
prt seem happy at the moment in SatelliteQE/robottelo#20950 |
Whether a user is a member of a specific group shouldn't really matter. This is somewhat configuration-dependant, but membership in sudoers/wheel only grants the user permissions to become another user, but until they change to be a different user, they're still an unprivileged user as any other. |
|
Thank you @pondrejk ! |
cases:
ssh user unprivileged + effective user unprivileged --> use setfacl as before
ssh user root + effective user unprivileged --> use ssh user privileges to set via chmod
ssh user unprivileged + effective user root --> no need for extra privileges