opencontainers / opencontainers/runc

consider unifying mountEntry.srcFD and mountEntry.idmapFD approach

Open
#3,935 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

I'm somewhat curious why we use a string for srcFD and an int for idmapFD. Wondering if we should unify the approach (probably can be done in a follow-up)

Originally posted by @thaJeztah in https://github.com/opencontainers/runc/pull/3717#discussion_r1259736922

One uses a string with the path (/proc/self/fd/<FD>), whereas the other uses the bare FD (int).

We could consider using an int for both, and update mountViaFDs() (which is not exported) to internalize constructing the path if the value is not -1; https://github.com/opencontainers/runc/blob/05669c8aba9bd3ee4cb9935a74dbd96828f65fc7/libcontainer/mount_linux.go#L67-L71

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in libcontainer/mount_linux.go, focusing on mountEntry.srcFD, mountEntry.idmapFD, and the unexported mountViaFDs() referenced in the issue. Trace how each descriptor is passed, then unify their representations and have mountViaFDs() construct the /proc/self/fd path for valid descriptors; done means both fields use the same approach without changing mount behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.