mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-05 20:39:19 +00:00
kshell: Check for absolute path
This commit is contained in:
@ -558,11 +558,15 @@ void KShellThread()
|
||||
|
||||
std::string path = "/bin/";
|
||||
|
||||
if (fs->PathIsRelative(cmd_only.c_str()))
|
||||
{
|
||||
path += cmd_only;
|
||||
if (!fs->PathExists(path.c_str(), nullptr))
|
||||
path = "/usr/bin/";
|
||||
path = "/usr/bin/" + cmd_only;
|
||||
}
|
||||
else
|
||||
path = cmd_only;
|
||||
|
||||
path += cmd_only;
|
||||
debug("path: %s", path.c_str());
|
||||
if (fs->PathExists(path.c_str(), nullptr))
|
||||
{
|
||||
|
Reference in New Issue
Block a user