2013-01-08 21:30:51 |
Hugo Heden |
bug |
|
|
added bug |
2013-01-08 21:34:46 |
Hugo Heden |
description |
I was invoking bash as follows:
env -i bash
This caused this message to be printed:
$ env -i bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
While I think I understand the rationale for the message, I found it more confusing than helpful in this situation. I thought I had done something wrong, or that there was some error with the new shell I was starting.
The message is, I believe, caused by the following snippet in /etc/bash.bashrc (not that the "env -i" part above causes $HOME to not be set)
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
It would perhaps be better if the if-statement also checked that $HOME is set (to refer to an existing directory?) before checking if $HOME/.sudo_as_admin_successful and $HOME/.hushlogin exist. |
I was invoking bash as follows:
env -i bash
This caused this message to be printed:
$ env -i bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
While I think I understand the rationale for the message, I found it more confusing than helpful in this situation. I thought I had done something wrong, or that there was some error with the new shell I was starting.
The message is, I believe, caused by the following snippet in /etc/bash.bashrc (note that the "env -i" part above causes $HOME to not be set)
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
It would perhaps be better if the if-statement also checked that $HOME is set (to refer to an existing directory?) before checking if $HOME/.sudo_as_admin_successful and $HOME/.hushlogin exist. |
|
2013-01-08 21:35:11 |
Hugo Heden |
description |
I was invoking bash as follows:
env -i bash
This caused this message to be printed:
$ env -i bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
While I think I understand the rationale for the message, I found it more confusing than helpful in this situation. I thought I had done something wrong, or that there was some error with the new shell I was starting.
The message is, I believe, caused by the following snippet in /etc/bash.bashrc (note that the "env -i" part above causes $HOME to not be set)
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
It would perhaps be better if the if-statement also checked that $HOME is set (to refer to an existing directory?) before checking if $HOME/.sudo_as_admin_successful and $HOME/.hushlogin exist. |
I was invoking bash as follows:
$ env -i bash
This caused this message to be printed:
$ env -i bash
> To run a command as administrator (user "root"), use "sudo <command>".
> See "man sudo_root" for details.
While I think I understand the rationale for the message, I found it more confusing than helpful in this situation. I thought I had done something wrong, or that there was some error with the new shell I was starting.
The message is, I believe, caused by the following snippet in /etc/bash.bashrc (note that the "env -i" part above causes $HOME to not be set)
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
It would perhaps be better if the if-statement also checked that $HOME is set (to refer to an existing directory?) before checking if $HOME/.sudo_as_admin_successful and $HOME/.hushlogin exist. |
|
2013-01-08 21:43:32 |
Hugo Heden |
description |
I was invoking bash as follows:
$ env -i bash
This caused this message to be printed:
$ env -i bash
> To run a command as administrator (user "root"), use "sudo <command>".
> See "man sudo_root" for details.
While I think I understand the rationale for the message, I found it more confusing than helpful in this situation. I thought I had done something wrong, or that there was some error with the new shell I was starting.
The message is, I believe, caused by the following snippet in /etc/bash.bashrc (note that the "env -i" part above causes $HOME to not be set)
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
It would perhaps be better if the if-statement also checked that $HOME is set (to refer to an existing directory?) before checking if $HOME/.sudo_as_admin_successful and $HOME/.hushlogin exist. |
I was invoking bash as follows:
$ env -i bash
This caused this message to be printed:
$ env -i bash
> To run a command as administrator (user "root"), use "sudo <command>".
> See "man sudo_root" for details.
While I think I understand the rationale for the message, I found it more confusing than helpful in this situation. I thought I had done something wrong, or that there was some error with the new shell I was starting. (It was as if I had done something that suggested I was trying to become root, which I hadn't. This just feels buggy.)
The message is, I believe, caused by the following snippet in /etc/bash.bashrc (note that the "env -i" part above causes $HOME to not be set)
# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
case " $(groups) " in *\ admin\ *)
if [ -x /usr/bin/sudo ]; then
cat <<-EOF
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
EOF
fi
esac
fi
It would perhaps be better if the if-statement also checked that $HOME is set (to refer to an existing directory?) before checking if $HOME/.sudo_as_admin_successful and $HOME/.hushlogin exist. |
|
2015-05-13 22:21:18 |
Launchpad Janitor |
bash (Ubuntu): status |
New |
Confirmed |
|