Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

"fchown: Operation not permitted" error while using crontab in containers running as non-root #203

Open
@kvlnkarthik

Description

@kvlnkarthik

We have cronie 1.5.7 rpm installed in a Pod running as non-root with no elevated privileges.

SecurityContext of the pod is as follows:

securityContext:
allowPrivilegeEscalation: false
appArmorProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
runAsGroup: 1234
runAsNonRoot: true
runAsUser: 1234
seccompProfile:
type: RuntimeDefault

When a user tries to run "crontab -e" in the pod, following error is thrown:

crontabber: installing new crontab
fchown: Operation not permitted
crontabber: edits left in /tmp/crontab.XwA4Wu

Looking at the codebase, we figured out the below line is causing the file_owner to be ROOT_UID in our pod
https://github.com/cronie-crond/cronie/blob/cronie-1.5.7/src/crontab.c#L878

file_owner = (getgid() == geteuid() && getgid() == getegid()) ? ROOT_UID : pw->pw_uid;

As the pod is running as non-root and the fchown operation is executed to set the tmp file as ROOT, the error is thrown.

We would like to understand the need of changing the file_owner to ROOT_UID in the /tmp location as this does not work in Pods running as non-root.

Could you please let me know if this is a bug. Is there any option to get this working in Pods without elevated privileges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp