Skip to content

files.find does not catch everything doing recursive search #4646

Open
@mm-weber

Description

@mm-weber

Describe the bug
files.find does not catch everything doing recursive search

To Reproduce

Test A: This check is proof the desired files in /boot/efi/EFI are findable

cnspec> files.find(from: "/boot/efi", type: "file").where(basename == /grub./ || basename == "user.cfg")
files.find.where.list: [
  0: file path="/boot/efi/EFI/rocky/grubx64.efi" size=2541896 permissions.string="-rwx------"
  1: file path="/boot/efi/EFI/rocky/grub.cfg" size=159 permissions.string="-rwx------"
]

Test B: The check below should include the files from the check above, too.

cnspec> files.find(from: "/boot/", type: "file").where(basename == /grub./ || basename == "user.cfg")
files.find.where.list: [
  0: file path="/boot/grub2/grub.cfg" size=6877 permissions.string="-rw-------"
  1: file path="/boot/grub2/grubenv" size=1024 permissions.string="-rw-------"
]

Desktop (please complete the following information):

Rocky Linux release 9.4 (Blue Onyx)
[root@ip-10-0-101-166 ~]# cnspec providers version

→ builtin (found 3 providers)

  core 11.0.7
  mock 9.0.0 with connectors: mock, upstream
  sbom 11.0.0 with connectors: sbom

→ /opt/mondoo/providers (found 1 providers)

  os 11.2.27 with connectors: local, ssh, winrm, vagrant, container, docker, filesystem, device

[root@ip-10-0-101-166 ~]# cnspec version
cnspec 11.20.1 (b3e8840, 2024-09-03T12:48:48Z


Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglinux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions