Skip to content

[BUG] procfs: "cd /proc/n" succeeds #16237

@pipcet

Description

@pipcet

Description / Steps to reproduce the issue

The procfs code behaves strangely when dealing with a path which is a prefix of a valid procfs entry: changing directory to such a prefix works rather than failing, and the apparent entries correspond to the remaining path, with one byte omitted.

In this configuration, /proc/net exists, but /proc/n doesn't:

nsh> cd /proc/n
nsh> ls
/proc/n:
 t
 t/
nsh> 

I would have expected behavior analogous to:

nsh> cd /proc/x
nsh: cd: chdir failed: 2
nsh> 

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

6.6.21

NuttX Version

master

Issue Architecture

[Arch: xtensa]

Issue Area

[Area: File System]

Host information

No response

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: xtensaIssues related to the Xtensa architectureArea: File SystemFile System issuesOS: LinuxIssues related to Linux (building system, etc)Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions