Skip to content

Conversation

@giuseppe
Copy link
Member

@giuseppe giuseppe commented Jun 11, 2025

This reverts commit 17135c1

It introduced a regression.

Closes: #1783

Summary by Sourcery

Bug Fixes:

  • Remove ENOENT special-case in chroot_realpath to stop returning partial paths for missing components and restore previous behavior

This reverts commit 17135c1

It introduced a regression.

Closes: containers#1783

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@packit-as-a-service
Copy link

TMT tests failed. @containers/packit-build please check.

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 11, 2025

Reviewer's Guide

This PR reverts the previous change that caused chroot_realpath to return partial paths for non-existent components, restoring the original behavior of failing on ENOENT errors.

Sequence Diagram: Updated chroot_realpath Handling of ENOENT from readlink

sequenceDiagram
    participant C as Caller
    participant CRF as chroot_realpath
    participant FS as Filesystem (OS via readlink)

    C->>CRF: chroot_realpath(chroot, path, resolved_path_buf)
    CRF->>CRF: ...path resolution processing...
    CRF->>FS: readlink(current_component_path, ...)
    FS-->>CRF: returns -1 (error), errno = ENOENT

    CRF->>CRF: Check if errno is ENOENT (new handling)
    CRF->>CRF: sprintf(resolved_path_buf, "<translated_prefix>/<remaining_path_segment>")
    CRF-->>C: return resolved_path_buf (partially resolved path)
Loading

File-Level Changes

Change Details Files
Removed ENOENT special-case handling in chroot_realpath
  • Deleted the errno == ENOENT conditional branch
  • Removed sprintf-based path concatenation and early return for missing components
  • Reverted to original fall-through for symlink/non-symlink error handling
src/libcrun/chroot_realpath.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@packit-as-a-service
Copy link

TMT tests failed. @containers/packit-build please check.

@giuseppe
Copy link
Member Author

@flouthoc PTAL

Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe
Copy link
Member Author

thanks, merging now

@giuseppe giuseppe merged commit d89542c into containers:main Jun 12, 2025
36 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot resolve null under rootfs

2 participants