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

Static fchown instead of permission check #371

Closed
alkuzad opened this issue Jul 21, 2022 · 0 comments
Closed

Static fchown instead of permission check #371

alkuzad opened this issue Jul 21, 2022 · 0 comments

Comments

@alkuzad
Copy link

alkuzad commented Jul 21, 2022

Expected Behavior

Logfile can be set to /dev/stdout

Current Behavior

Instead of doing fchown every time, check permissions and do it if needed. This breaks using /dev/stdout which is root owned but it's 777

hitch/src/hitch.c

Line 4192 in c8033c3

AZ(fchown(fileno(logfile), CONFIG->UID, CONFIG->GID));

Possible Solution

Do fchown only if write is not possible

Steps to Reproduce (for bugs)

  1. Set logfile config to /dev/stdout
  2. Start hitch

Context

This makes it hard to make sure container logs to stdout instead of stderr

Your Environment

Docker container - alpine:3.11, run as non-priviledged user

@alkuzad alkuzad changed the title Static chmod instead of permission check Static fchown instead of permission check Jul 21, 2022
daghf added a commit that referenced this issue Jun 7, 2023
@daghf daghf closed this as completed in fcf0e5b Aug 3, 2023
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

No branches or pull requests

1 participant