Skip to content

Conversation

@SilentSobs
Copy link

This PR fixes a portability issue in Msf::Post::File.stat where the implementation assumed GNU stat --format output.

On non-GNU systems (such as BSD variants), the existing code raised a runtime exception because the stat output did not match the expected format. This change preserves existing GNU/Linux behavior and adds a minimal, behavior-based fallback to a BSD-compatible stat -f format when the initial output does not match expectations.

No OS detection is introduced, and no external interfaces are changed.

Fixes #20030

@SilentSobs SilentSobs changed the title Fix FileStat stat parsing on non-GNU systems #20030 Fix FileStat stat parsing on non-GNU systems Dec 29, 2025
@bcoles bcoles added the bug label Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Msf::Post::File: format argument of stat command not behaving as expected

2 participants