From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] Fix umask settings for non-bash shells for root user
Date: Sat, 29 Aug 2015 10:57:07 +0200 [thread overview]
Message-ID: <20150829105707.3d5e0fec@free-electrons.com> (raw)
In-Reply-To: <1434378026-15007-1-git-send-email-vorel@jablocom.com>
Dear Petr Vorel,
Adding Yann, Arnout and Peter in Cc.
On Mon, 15 Jun 2015 16:20:26 +0200, Petr Vorel wrote:
> 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
Well, actually, I am wondering if we need to bundle a .profile file at
all. Our system/skeleton/root/ directory contains:
-rw-r--r-- 1 thomas thomas 0 oct. 4 2014 .bash_history
-rw-r--r-- 1 thomas thomas 175 oct. 4 2014 .bash_logout
-rw-rw-r-- 1 thomas thomas 78 mars 5 15:40 .bash_profile
I don't really see why we need any of those three files in our default
skeleton. Maybe we should simply remove them, use the default behavior
of whatever shell is installed, and let users provide their own custom
configuration if needed through a post-build script or rootfs overlay.
Yann, Arnout, Peter, your thoughts?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-08-29 8:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150829105707.3d5e0fec@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox