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

libpod: make hasCapSysResource platform-specific #25275

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

dfr
Copy link
Contributor

@dfr dfr commented Feb 10, 2025

I'm not sure if there is an equivalent to CAP_SYS_RESOURCE on FreeBSD but for now, I have added a no-op stub which returns false.

Does this PR introduce a user-facing change?

None


// hasCapSysResource returns whether the current process has CAP_SYS_RESOURCE.
func hasCapSysResource() (bool, error) {
return false, nil
Copy link
Member

Choose a reason for hiding this comment

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

Can you extend the hard limits as root on freebsd? If so that should likely return true. Especially since the behavior before this new CAP_SYS_RESOURCE check was to behave like true does now.

The reason we added this check that on linux we need CAP_SYS_RESOURCE to raise the limit, default is 1048576 for NOFILE and NOFILE, so if a user has less we can not bump and instead just set it to the hard limit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Root can raise the hard limits on the host or (I think) inside a jail with the right privileges. I will change the stub to return true.

Copy link

Cockpit tests failed for commit 61d76eb. @martinpitt, @jelly, @mvollmer please check.

I'm not sure if there is an equivalent to CAP_SYS_RESOURCE on FreeBSD
but for now, I have added a no-op stub which returns false.

Signed-off-by: Doug Rabson <[email protected]>
@dfr dfr force-pushed the freebsd-hascapresource branch from 61d76eb to ab04109 Compare February 10, 2025 14:52
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Feb 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dfr, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2025
@Luap99 Luap99 added the No New Tests Allow PR to proceed without adding regression tests label Feb 10, 2025
@rhatdan
Copy link
Member

rhatdan commented Feb 10, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit e943a2b into containers:main Feb 10, 2025
83 checks passed
@dfr dfr deleted the freebsd-hascapresource branch February 11, 2025 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. No New Tests Allow PR to proceed without adding regression tests release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants