hugsy / gef

GEF (GDB Enhanced Features) - a modern experience for GDB with advanced debugging capabilities for exploit devs & reverse engineers on Linux
https://hugsy.github.io/gef
MIT License
7.02k stars 739 forks source link

Use shutil when looking for executables on the host system #1146

Closed mkrasnitski closed 3 weeks ago

mkrasnitski commented 3 weeks ago

Description

The implementation of the which function only checks for the executable flag on paths, which means it can return a directory (at least on POSIX), causing weird permission errors down the line. It should instead defer to shutil.which; that function contains a platform-agnostic implementation that should hopefully match the behavior of the GNU which utility.

Checklist

github-actions[bot] commented 3 weeks ago

🤖 Coverage update for f053502116ef4eafc4ab9dd561d1f6e4a9c2108c 🟢

Old New
Commit ba70548a3ee24355c1c6daca0aa302d326dc2335 f053502116ef4eafc4ab9dd561d1f6e4a9c2108c
Score 71.2773% 71.2773% (0)
github-actions[bot] commented 3 weeks ago

🤖 Coverage update for a00d9f15385eaf0bcfebc2442e352a4391d3c08e 🟢

Old New
Commit ba70548a3ee24355c1c6daca0aa302d326dc2335 a00d9f15385eaf0bcfebc2442e352a4391d3c08e
Score 71.2773% 71.2773% (0)
github-actions[bot] commented 3 weeks ago

🤖 Coverage update for 13ff22c341453c69dfc36b350b1f356bceecd0f6 🟢

Old New
Commit ba70548a3ee24355c1c6daca0aa302d326dc2335 13ff22c341453c69dfc36b350b1f356bceecd0f6
Score 71.2773% 71.2773% (0)