feature: support hardlinking fds into `Root`s

Abierto
#355 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
linux, rust
Área
backend, security

Línea de trabajo

Start by reading the existing Root APIs and their tests to understand how file descriptors and mount identity checks are handled; the issue does not name specific files or tests. Then trace how /proc/self/fd/$n is used with linkat(2) and what same-mount-id check is required. Done means libpathrs provides a helper for linking an unlinked file descriptor into a Root, with the required check.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

api/cffi api/root api/rust impact/feature

Unlinked files (such as those created by O_TMPFILE) can be linked back to the filesystem via /proc/self/fd/$n (or linkat(AT_EMPTY_PATH) but this requires privileges and is thus less preferable). There is also a planned extension to renameat2(2) to allow you to also clobber the target file in the same atomic operation.

This is a very useful operation, especially if you use O_TMPFILE to create and populate a temporary file before making it visible to other programs through the filesystem, but is currently not provided by libpathrs.

This is also something that libpathrs really should provide helpers for, because it requires non-trivial usage of /proc/self/fd/$n that cannot be accomplished purely through our APIs (namely the linkat(2) operation needs to do a same-mount-id check for the fd magiclink).

Lenguaje dominante
Rust
Estrellas
146
Forks
12
Merge medio
1 d 16 h
PR fusionados (30 d)
20

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cyphar/libpathrs

Todos los issues de cyphar/libpathrs

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.