A file added by a patch is always created 0o444: the manifest has no per-file mode, so a patch cannot add an executable or a shared library

Aperta
#2,196 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
cli

Direzione di ricerca

Start in crates/socket-patch-core/src/patch/apply.rs, where a newly added file is staged with StageMode::ReadOnly (around line 878, with the mode described near line 608). Then read crates/socket-patch-core/src/manifest/schema.rs, where PatchFileInfo holds only beforeHash and afterHash. Done means an optional per-file mode in the manifest, absent meaning today's 0o444 behaviour, applied when the file is created and restored on rollback. The maintainer has not yet chosen between a general mode and a single execute-bit boolean, so confirm that first.

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

Descrizione

agent:triaged enhancement priority:p3

Summary

A file that a patch ADDS is written with mode 0o444 (StageMode::ReadOnly, crates/socket-patch-core/src/patch/apply.rs:878; the mode is described at apply.rs:608). The manifest has nowhere to say otherwise: PatchFileInfo holds only beforeHash and afterHash (crates/socket-patch-core/src/manifest/schema.rs:23). An existing file keeps its own mode, so this only affects new files.

Why this matters

A patch cannot add an executable script, or a new shared library where the platform expects the execute bit. For patches made of rebuilt artifacts this comes up when a fix adds a helper binary or splits a library.

Suggested direction

An optional per-file mode in the manifest (absent = today's behaviour), applied on create and restored by rollback. If a general mode is too broad, a single boolean for the execute bit would cover the cases above.

Lingua principale
Rust
Stelle
9
Fork
2
Merge medio
1g 8h
PR unite (30g)
309

Preparare l'ambiente

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 SocketDev/socket-patch

Tutte le issue di SocketDev/socket-patch

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.