From 93c2088983342ad31a6fc2f51c56bb73772aaa92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 13 Jun 2007 23:12:00 +0000 Subject: [PATCH] * Removed all user paths from the default runtime_loader paths. * $PATH is now set differently when booted in safe mode (just like LIBRARY_PATH, and ADDON_PATH already were). * This closes ticket #1103. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21406 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- data/system/boot/SetupEnvironment | 4 ++-- src/system/runtime_loader/runtime_loader.c | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/data/system/boot/SetupEnvironment b/data/system/boot/SetupEnvironment index 0572b19e7a..25558c5ef4 100644 --- a/data/system/boot/SetupEnvironment +++ b/data/system/boot/SetupEnvironment @@ -42,13 +42,13 @@ export BE_LINKER=ld export BE_DEFAULT_C_FLAGS="" export BE_DEFAULT_CPLUS_FLAGS="" -export PATH=.:$HOME/config/bin:/bin:/boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:$BETOOLS - if [ "$SAFEMODE" != "yes" ] then + export PATH=.:$HOME/config/bin:/bin:/boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:$BETOOLS export LIBRARY_PATH="%A/lib:$HOME/config/lib:/boot/beos/system/lib" export ADDON_PATH="%A/add-ons:$HOME/config/add-ons:/boot/beos/system/add-ons" else + export PATH=.:/bin:/boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:$BETOOLS export LIBRARY_PATH="%A/lib:/boot/beos/system/lib" export ADDON_PATH="%A/add-ons:/boot/beos/system/add-ons" fi diff --git a/src/system/runtime_loader/runtime_loader.c b/src/system/runtime_loader/runtime_loader.c index 7b7302db88..358c985d74 100644 --- a/src/system/runtime_loader/runtime_loader.c +++ b/src/system/runtime_loader/runtime_loader.c @@ -49,14 +49,17 @@ search_path_for_type(image_type type) return NULL; } - // ToDo: for now, if the variable was not set, return default paths if (path != NULL) return path; + // The environment variables may not have been set yet - in that case, + // we're returning some useful defaults. + // Since the kernel does not set any variables, this is also needed + // to start the root shell. + switch (type) { case B_APP_IMAGE: - return "/boot/home/config/bin:" - "/bin:" + return "/bin:" "/boot/apps:" "/boot/preferences:" "/boot/beos/apps:" @@ -64,11 +67,10 @@ search_path_for_type(image_type type) "/boot/develop/tools/gnupro/bin"; case B_LIBRARY_IMAGE: - return "%A/lib:/boot/home/config/lib:/boot/beos/system/lib"; + return "%A/lib:/boot/beos/system/lib"; case B_ADD_ON_IMAGE: return "%A/add-ons" - ":/boot/home/config/add-ons" ":/boot/beos/system/add-ons"; default: