more open-like O_CREAT support?

Aperta
#192 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
linux, rust
Ambito
backend, security

Direzione di ricerca

Start by reading Root::create_file and comparing how the openat2 and O_PATH resolvers handle creation flags. The issue asks whether to support O_CREAT without O_EXCL and O_NOFOLLOW, including dangling symlink targets; determine what each resolver can safely implement and document the behavior. Done means the supported flag combinations and resolver behavior are settled and covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

impact/feature

At the moment, Root::create_file is explcitly O_CREAT|O_EXCL|O_NOFOLLOW which is the most secure and straight-forward implemementation that will work regardless of the resolver implementation.

However, it seems possible users might prefer having more open-like O_CREAT support. Namely:

  1. O_CREAT without O_EXCL, to allow you to create-or-open an existing directory (possibly with O_TRUNC). This is a fairly common thing programs do, so blocking it in the interests of safety is probably something people will bristle against.
  2. O_CREAT without O_NOFOLLOW allows you to create the target of a dangling symlink. I suspect this is a very rarely-used feature of O_CREAT (and I view it as a mis-feature) but it is something that it is not reasonably possible to emulate as a libpathrs user without going through a lot of hoops. It's not clear to me whether this is going to be reasonable to implement for the O_PATH resolver (for openat2 it's trivial).
Lingua principale
Rust
Stelle
146
Fork
12
Merge medio
1g 16h
PR unite (30g)
20

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cyphar/libpathrs

Tutte le issue di cyphar/libpathrs

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.