apps+base+libc: Use /usr/bin paths instead of /bin everywhere
This commit is contained in:
parent
3c9b2c49aa
commit
c5e11bb6cf
@ -45,7 +45,7 @@ Result<int> luna_main(int argc, char** argv)
|
|||||||
username = name.view();
|
username = name.view();
|
||||||
}
|
}
|
||||||
|
|
||||||
execl("/bin/su", "login", "-lp", "--", username.chars(), nullptr);
|
execl("/usr/bin/su", "login", "-lp", "--", username.chars(), nullptr);
|
||||||
|
|
||||||
perror("su");
|
perror("su");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -72,10 +72,9 @@ int main()
|
|||||||
// Now, mount the /dev file system on the new root.
|
// Now, mount the /dev file system on the new root.
|
||||||
mount_devfs();
|
mount_devfs();
|
||||||
|
|
||||||
setenv("PATH", "/sbin:/usr/bin", 1);
|
char* argv[] = { "/usr/bin/init", nullptr };
|
||||||
char* argv[] = { "init", nullptr };
|
|
||||||
char* envp[] = { nullptr };
|
char* envp[] = { nullptr };
|
||||||
execvpe(argv[0], argv, envp);
|
execve(argv[0], argv, envp);
|
||||||
|
|
||||||
fail_errno("Failed to execute init");
|
fail_errno("Failed to execute init");
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ Result<int> luna_main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
chdir(entry->pw_dir);
|
chdir(entry->pw_dir);
|
||||||
clearenv();
|
clearenv();
|
||||||
setenv("PATH", "/bin:/sbin", 1);
|
setenv("PATH", "/usr/bin:/usr/local/bin", 1);
|
||||||
setpgid(0, 0);
|
setpgid(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
root:toor:0:0:Administrator:/:/bin/sh
|
root:toor:0:0:Administrator:/:/usr/bin/sh
|
||||||
selene:moon:1000:1000:User:/home/selene:/bin/sh
|
selene:moon:1000:1000:User:/home/selene:/usr/bin/sh
|
||||||
|
@ -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);
|
if (strchr(name, '/')) return execve(name, argv, envp);
|
||||||
|
|
||||||
char* path = getenv("PATH");
|
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(":"));
|
Vector<String> paths = TRY(StringView { path }.split(":"));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user