Skip to content

dissect: add --manifest switch to generate a UAPI.16 manifest file fr…#41990

Open
poettering wants to merge 5 commits into
systemd:mainfrom
poettering:uapi16
Open

dissect: add --manifest switch to generate a UAPI.16 manifest file fr…#41990
poettering wants to merge 5 commits into
systemd:mainfrom
poettering:uapi16

Conversation

@poettering
Copy link
Copy Markdown
Member

@poettering poettering commented May 8, 2026

…om a directory tree

The UAPI.16 spec is being discussed here:

uapi-group/specifications#213

@poettering
Copy link
Copy Markdown
Member Author

Do not merge until the spec is also good to be merged.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Claude review of PR #41990 (334eca8)

Must fix

  • Unused variable escapedsrc/dissect/dissect.c:1348 — declared but never used in manifest_print_item(), will fail with -Werror
  • S_ISDIR(sx->stx_mask) should be S_ISDIR(sx->stx_mode)src/dissect/dissect.c:1386 — uses wrong struct field for file type check, causing directories to incorrectly enter the hardlink processing path
  • fd leak on lseek failure in rm_rf_childrensrc/shared/rm-rf.c:313-315 — when REMOVE_REWIND lseek fails, returns -errno without closing the fd, violating the function's ownership contract

Suggestions

  • NULL from inode_type_to_string()src/dissect/dissect.c:1397 — can return NULL for unknown inode types, producing a JSON null instead of a string
  • name_to_handle_at_try_fid hard failuresrc/dissect/dissect.c:1418 — non-fatal errors (e.g. -EOPNOTSUPP) abort the entire manifest, could gracefully skip hardlink detection instead
  • Missing log on sd_json_buildo failuresrc/dissect/dissect.c:1543 — error returned without logging, unlike the analogous call earlier in the file
  • stx_size accessed without STATX_SIZE mask checksrc/dissect/dissect.c:1543 — in the S_IFREG case, sx->stx_size is used after only checking STATX_TYPE, inconsistent with mtree_print_item which checks both
  • --mtree-hash flag reused for manifestsrc/dissect/dissect.c:1453 — the flag name and description reference mtree output only, but it now also controls manifest hashing
  • get_entry() helper has no failure guardtest/units/TEST-50-DISSECT.dissect.sh:1143 — if no entry matches, produces empty output leading to confusing assertion failures
  • --manifest on image only checks exit codetest/units/TEST-50-DISSECT.dissect.sh:1219 — output is discarded; consider verifying non-empty output or expected content

Nits

  • Double blank linesrc/dissect/dissect.c:1380-1382 — extra blank line between break; and case S_IFLNK:
  • Misleading error messagesrc/dissect/dissect.c:1427 — says "Failed to symlink" but the operation is readlinkat_malloc on the hardlink database
  • Pointer star stylesrc/dissect/dissect.c:1383const char* type should be const char *type
  • Operator spacingsrc/dissect/dissect.c:1475colon +1 should be colon + 1
  • Hardcoded SHA256 for empty filetest/units/TEST-50-DISSECT.dissect.sh:1162 — could compute dynamically like done for regular.txt
  • Hardcoded symlink sizetest/units/TEST-50-DISSECT.dissect.sh:1179"11" is strlen of target, would be more maintainable computed
  • Missing comma in man pageman/systemd-dissect.xml:272 — "Like --mtree this" should be "Like --mtree, this"
  • FID error message missing pathsrc/dissect/dissect.c:1395 — doesn't include the file path for debugging
  • Cycle avoidance startswith too broadsrc/dissect/dissect.c:1525startswith(path, "Uapi16Manifest.") also skips non-manifest files

Workflow run

Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c
@bluca bluca added ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR labels May 8, 2026
@github-actions github-actions Bot removed the ci-fails/needs-rework 🔥 Please rework this, the CI noticed an issue with the PR label May 10, 2026
Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c Outdated
Comment thread src/shared/rm-rf.c Outdated
Comment thread src/dissect/dissect.c
Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c Outdated
Comment thread src/dissect/dissect.c
Comment thread test/units/TEST-50-DISSECT.dissect.sh
Comment thread test/units/TEST-50-DISSECT.dissect.sh
Comment thread test/units/TEST-50-DISSECT.dissect.sh
Comment thread man/systemd-dissect.xml Outdated
Comment thread src/dissect/dissect.c
Comment thread src/dissect/dissect.c
Comment thread test/units/TEST-50-DISSECT.dissect.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants