Skip to content

pkg/unikontainers: unmask underlying errors in checkValidNsPath - #965

Open
srinivasr wants to merge 2 commits into
urunc-dev:mainfrom
srinivasr:fix-ns-path-errors
Open

pkg/unikontainers: unmask underlying errors in checkValidNsPath#965
srinivasr wants to merge 2 commits into
urunc-dev:mainfrom
srinivasr:fix-ns-path-errors

Conversation

@srinivasr

@srinivasr srinivasr commented Aug 13, 2026

Copy link
Copy Markdown

Description

checkValidNsPath previously caught all os.Lstat errors and returned ErrNotExistingNS. this masked permission-denied and I/O errors behind a generic missing-namespace error.

check for os.IsNotExist(err) specifically. wrap and return all other errors to the caller.

Related issues

How was this tested?

ran make unittest locally.
verified the ErrNotExistingNS sentinel is preserved for expected missing namespace scenarios (e.g. Kill() behavior).

LLM usage

I used Gemini 3.1 Pro to help debug the namespace path checks. The final patch and testing were completed entirely by me.

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

checkValidNsPath previously caught all os.Lstat errors and returned ErrNotExistingNS. this masked permission-denied and I/O errors behind a generic missing-namespace error.

check for os.IsNotExist(err) specifically. wrap and return all other errors to the caller.

Fixes: urunc-dev#890
Signed-off-by: B Srinivas Reddy <[email protected]>
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit a41d095
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a833c34c7611f0008a7e00a

Add unit tests covering missing, empty, valid, comma-containing, and
permission-denied namespace paths for checkValidNsPath. Also validate
comma separation prior to lstat.

Signed-off-by: B Srinivas Reddy <[email protected]>
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.

checkValidNsPath treats permission-denied and I/O errors as "namespace does not exist"

1 participant