train icon indicating copy to clipboard operation
train copied to clipboard

Train needs more robust stat functionality on Linux

Open tas50 opened this issue 4 years ago • 0 comments

The current implementation of Stat functionality for Linux in Train is not robust enough to hand new / unknown linux variants.

There is logic at this line to determine if we should use --printf or -c when running the command: https://github.com/inspec/train/blob/6893b8ddfbb151b66c46d53569056756497b4e90/lib/train/extras/stat.rb#L37

This relies on a hard coded list of distros that need -c, which does not work when we encounter a new distro. It's made worse since the failures that occur here are not clear and you'd have to spend the time digging into train to fully understand where the stat command is failing.

tas50 avatar May 11 '21 14:05 tas50