Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Fix umask settings for non-bash shells for root user
@ 2015-06-15 14:20 Petr Vorel
  2015-08-29  8:57 ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2015-06-15 14:20 UTC (permalink / raw)
  To: buildroot

From: Petr Vorel <petr.vorel@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@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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-03 21:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-15 14:20 [Buildroot] [PATCH 1/1] Fix umask settings for non-bash shells for root user Petr Vorel
2015-08-29  8:57 ` Thomas Petazzoni
2015-08-29  9:20   ` Yann E. MORIN
2015-08-29  9:29     ` Thomas Petazzoni
2015-08-29  9:33       ` Yann E. MORIN
2015-08-29  9:36         ` Thomas Petazzoni
2015-08-29 10:07     ` Arnout Vandecappelle
2015-08-29 11:44       ` Peter Korsgaard
2015-10-03 21:34         ` Maxime Hadjinlian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox