Skip to content

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 #2196

Open

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions