apps+base+libc: Use /usr/bin paths instead of /bin everywhere

This commit is contained in:
apio 2023-09-04 11:44:10 +02:00
parent 3c9b2c49aa
commit c5e11bb6cf
Signed by: apio
GPG Key ID: B8A7D06E42258954
5 changed files with 7 additions and 8 deletions

View File

@ -45,7 +45,7 @@ Result<int> luna_main(int argc, char** argv)
username = name.view();
}
execl("/bin/su", "login", "-lp", "--", username.chars(), nullptr);
execl("/usr/bin/su", "login", "-lp", "--", username.chars(), nullptr);
perror("su");
return 1;

View File

@ -72,10 +72,9 @@ int main()
// Now, mount the /dev file system on the new root.
mount_devfs();
setenv("PATH", "/sbin:/usr/bin", 1);
char* argv[] = { "init", nullptr };
char* argv[] = { "/usr/bin/init", nullptr };
char* envp[] = { nullptr };
execvpe(argv[0], argv, envp);
execve(argv[0], argv, envp);
fail_errno("Failed to execute init");

View File

@ -127,7 +127,7 @@ Result<int> luna_main(int argc, char** argv)
{
chdir(entry->pw_dir);
clearenv();
setenv("PATH", "/bin:/sbin", 1);
setenv("PATH", "/usr/bin:/usr/local/bin", 1);
setpgid(0, 0);
}

View File

@ -1,2 +1,2 @@
root:toor:0:0:Administrator:/:/bin/sh
selene:moon:1000:1000:User:/home/selene:/bin/sh
root:toor:0:0:Administrator:/:/usr/bin/sh
selene:moon:1000:1000:User:/home/selene:/usr/bin/sh

View File

@ -23,7 +23,7 @@ static Result<int> try_execvpe(const char* name, char* const* argv, char* const*
if (strchr(name, '/')) return execve(name, argv, envp);
char* path = getenv("PATH");
if (!path) path = const_cast<char*>("/bin:/sbin");
if (!path) path = const_cast<char*>("/usr/bin:/usr/local/bin");
Vector<String> paths = TRY(StringView { path }.split(":"));