From: Michael Tremer Date: Tue, 13 Nov 2012 21:27:49 +0000 (+0100) Subject: bash: Fix startfiles. X-Git-Tag: v2.13-beta1~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a6448326f80cfa1349ded50eae96fd92df1565a;p=people%2Fms%2Fipfire-2.x.git bash: Fix startfiles. Sanitize PATH variable and fix wrong path to hostname command. --- diff --git a/config/etc/profile b/config/etc/profile index cc638788af..912d3d0b91 100644 --- a/config/etc/profile +++ b/config/etc/profile @@ -42,7 +42,7 @@ else pathmunge /usr/sbin after fi -HOSTNAME=`/usr/bin/hostname 2>/dev/null` +HOSTNAME=`/bin/hostname 2>/dev/null` HISTSIZE=1000 if [ "$HISTCONTROL" = "ignorespace" ] ; then export HISTCONTROL=ignoreboth diff --git a/lfs/bash b/lfs/bash index 34bf075339..4fef89e9b8 100644 --- a/lfs/bash +++ b/lfs/bash @@ -93,6 +93,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/bash/bash32-$$(printf "%03d" "$${i}") || exit 1; \ done + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash-4.0-paths-1.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash-4.0-profile-1.patch cd $(DIR_APP) && ./configure $(EXTRA_CONFIG) cd $(DIR_APP) && make $(EXTRA_MAKE) cd $(DIR_APP) && make $(EXTRA_INSTALL) install diff --git a/src/patches/bash-4.0-paths-1.patch b/src/patches/bash-4.0-paths-1.patch new file mode 100644 index 0000000000..735a3810f0 --- /dev/null +++ b/src/patches/bash-4.0-paths-1.patch @@ -0,0 +1,30 @@ +--- bash-3.0/config.h.in.paths 2004-07-21 21:08:31.000000000 +0100 ++++ bash-3.0/config.h.in 2004-07-28 09:16:27.257884999 +0100 +@@ -197,7 +197,7 @@ + + /* System paths */ + +-#define DEFAULT_MAIL_DIRECTORY "/usr/spool/mail" ++#define DEFAULT_MAIL_DIRECTORY "/var/spool/mail" + + /* Characteristics of the system's header files and libraries that affect + the compilation environment. */ +--- bash-3.0/config-top.h.paths 2003-08-05 15:36:12.000000000 +0100 ++++ bash-3.0/config-top.h 2004-07-28 09:36:27.117205637 +0100 +@@ -52,14 +52,14 @@ + /* The default value of the PATH variable. */ + #ifndef DEFAULT_PATH_VALUE + #define DEFAULT_PATH_VALUE \ +- "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:." ++ "/usr/local/bin:/bin:/usr/bin" + #endif + + /* The value for PATH when invoking `command -p'. This is only used when + the Posix.2 confstr () function, or CS_PATH define are not present. */ + #ifndef STANDARD_UTILS_PATH + #define STANDARD_UTILS_PATH \ +- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" ++ "/bin:/usr/bin:/usr/sbin:/sbin" + #endif + + /* Default primary and secondary prompt strings. */ diff --git a/src/patches/bash-4.0-profile-1.patch b/src/patches/bash-4.0-profile-1.patch new file mode 100644 index 0000000000..ba3344b3cc --- /dev/null +++ b/src/patches/bash-4.0-profile-1.patch @@ -0,0 +1,12 @@ +diff -up bash-3.2/config-top.h.profile bash-3.2/config-top.h +--- bash-3.2/config-top.h.profile 2008-07-17 13:35:39.000000000 +0200 ++++ bash-3.2/config-top.h 2008-07-17 13:42:18.000000000 +0200 +@@ -26,6 +26,8 @@ + what POSIX.2 specifies. */ + #define CONTINUE_AFTER_KILL_ERROR + ++#define NON_INTERACTIVE_LOGIN_SHELLS ++ + /* Define BREAK_COMPLAINS if you want the non-standard, but useful + error messages about `break' and `continue' out of context. */ + #define BREAK_COMPLAINS