Skip to content

Fixes #39132 - Do not rely on ACLs where not strictly necessary#131

Merged
adamruzicka merged 1 commit intotheforeman:masterfrom
pondrejk:acl-optional
Mar 11, 2026
Merged

Fixes #39132 - Do not rely on ACLs where not strictly necessary#131
adamruzicka merged 1 commit intotheforeman:masterfrom
pondrejk:acl-optional

Conversation

@pondrejk
Copy link
Copy Markdown
Contributor

@pondrejk pondrejk commented Mar 5, 2026

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

Copy link
Copy Markdown
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

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'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@pondrejk
Copy link
Copy Markdown
Contributor Author

pondrejk commented Mar 9, 2026

prt seem happy at the moment in SatelliteQE/robottelo#20950

@adamruzicka
Copy link
Copy Markdown
Contributor

Just a few cents: this fix explicitly checks if the user is root, but what about users that are sudoers, but are not root?

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.

@adamruzicka adamruzicka merged commit 34727c1 into theforeman:master Mar 11, 2026
11 checks passed
@adamruzicka
Copy link
Copy Markdown
Contributor

Thank you @pondrejk !

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