[Buildroot] [PATCH 1/1] Fix umask settings for non-bash shells for root user

Petr Vorel petr.vorel at gmail.com
Mon Jun 15 14:20:26 UTC 2015


From: Petr Vorel <petr.vorel at gmail.com>

.bash_profile is not readed by some shells (e.g. busybox), so move umask into
.profile. Here it's also loaded .bashrc, when presented and shell is
bash.

CREDITS: inspired by Debian skeleton files.

Signed-off-by: Petr Vorel <petr.vorel at gmail.com>
---
 system/skeleton/root/.bash_profile |  7 -------
 system/skeleton/root/.profile      | 10 ++++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)
 delete mode 100644 system/skeleton/root/.bash_profile
 create mode 100644 system/skeleton/root/.profile

diff --git a/system/skeleton/root/.bash_profile b/system/skeleton/root/.bash_profile
deleted file mode 100644
index 0ee04a3..0000000
--- a/system/skeleton/root/.bash_profile
+++ /dev/null
@@ -1,7 +0,0 @@
-# .bash_profile
-
-umask 022
-
-if [ -f ~/.bashrc ]; then
-    source ~/.bashrc
-fi
diff --git a/system/skeleton/root/.profile b/system/skeleton/root/.profile
new file mode 100644
index 0000000..452ae20
--- /dev/null
+++ b/system/skeleton/root/.profile
@@ -0,0 +1,10 @@
+# ~/.profile: executed by the command interpreter for login shells.
+# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
+# exists.
+umask 022
+
+if [ -n "$BASH_VERSION" ]; then
+    if [ -f ~/.bashrc ]; then
+        source ~/.bashrc
+    fi
+fi
-- 
1.8.0



More information about the buildroot mailing list