Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

getvictor
Copy link
Contributor

@getvictor getvictor commented Aug 9, 2024

Fixes #8354: inotify treats symlinks to individual files as directories.

Demo video of the fix: https://www.loom.com/share/c7044edec1ff47158fd93f49a1b0af63

@directionless
Copy link
Member

FYI #8392

@getvictor getvictor marked this pull request as ready for review August 10, 2024 17:51
@getvictor getvictor requested review from a team as code owners August 10, 2024 17:51
@getvictor
Copy link
Contributor Author

FYI #8392

Yes, looks like these two PRs will need to be manually merged.

@getvictor getvictor changed the title inotify fix directories (inotify) fix -- check if symlinks point to directories Aug 10, 2024
@getvictor getvictor changed the title directories (inotify) fix -- check if symlinks point to directories directories fix -- check if symlinks point to directories Aug 10, 2024
@getvictor getvictor changed the title directories fix -- check if symlinks point to directories listDirectoriesInDirectory fix -- check if symlinks point to directories Aug 10, 2024
@directionless
Copy link
Member

directionless commented Aug 10, 2024

FYI #8392

Yes, looks like these two PRs will need to be manually merged.

I think they achieve the same goal, and we probably only need one. Oh, I see some things here, you're doing on top. So maybe we merge 8392, then add in this one.

@getvictor
Copy link
Contributor Author

FYI #8392

Yes, looks like these two PRs will need to be manually merged.

I think they achieve the same goal, and we probably only need one. Oh, I see some things here, you're doing on top. So maybe we merge 8392, then add in this one.

@directionless Is it possible to get this one into 5.13.1? We have a customer with a lot of symlinks that's getting flooded with warning messages from this issue.

cc: @zwass @lucasmrod

osquery/filesystem/tests/filesystem.cpp Show resolved Hide resolved
ASSERT_TRUE(!found_directories.empty());

ASSERT_TRUE(found_directories.size() == EXPECTED_NR_OF_DIRECTORIES);
ASSERT_TRUE(found_directories.empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this empty now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this is a link that points to itself. It cannot be resolved canonically, so it doesn't make sense to return it as a directory.

osquery/filesystem/tests/filesystem.cpp Show resolved Hide resolved
Copy link
Contributor

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM. Left a few comments on the test files.

Copy link
Contributor

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When directories are monitored recursively symlink targets are considered directories.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.