Skip to content

find -type rejects the legal letters b, c and s — block/char devices and sockets can never be matched #1377

Closed

Description

@caomengxuan666

Probe-verified (same-source mingw+Wine harness, two runs, GNU findutils 4.9.0):

  • find . -type b → WinuxCmd: find: invalid argument 'b' for -type, exit 1. GNU: exit 0.
  • find . -type c → same rejection. GNU: exit 0.
  • find . -type s with a live AF_UNIX socket in the fixture → WinuxCmd rejects the letter outright, exit 1; GNU matches the socket, exit 0.

Only f, d, l, p are accepted. b/c matter less on Windows, but s is fully meaningful (sockets exist in the Win32/WSL-adjacent world the tool serves), and scripts using any of the three fail before find even starts.

Expected (GNU find)

-type accepts b c d p u f l s (and D where supported); a type that cannot occur simply matches nothing.

Source

src/commands/find.cpp: the -type argument validator whitelists four letters.

Regression seed

In-repo test named with this issue number: the three probes above, including the socket fixture for s.

Activity

  1. added
    bug
    compat-gap
    on Oct 26, 2026
  2. added a commit that references this issue on Oct 27, 2026
  3. caomengxuan666 commented on Oct 27, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by #1400: find -type accepts the b/c/s letters (and rejects -type u like GNU findutils 4.9 per the oracle correction recorded in the issue). Regression pins issue_1377_* landed with the PR; find suite 152/153 in post-merge ctest (the 1 residual is the environment-bound issue_1309_ls baseline).

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

Metadata

Metadata

Labels

bugcompat-gap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions