Commit 78735b9d authored by m3hm00d's avatar m3hm00d
Browse files

Cosmetic and coding changes as suggested by intrigeri

Multiple minor cosmetic and coding changes made in the following files:

1. 51-update-bash.bashrc
2. replace-su-with-sudo.sh
parent 3446570d
#!/bin/sh
set -e
set -u
# Update /etc/bash.bashrc at runtime as defined in /etc/bash.bashrc.d/*
# Make /etc/bash.bashrc source /etc/bash.bashrc.d/*
echo "Updating /etc/bash.bashrc"
OPTS_FILE='/etc/bash.bashrc'
OPTS_DIR='/etc/bash.bashrc.d/*'
cat <<EOF>> "${OPTS_FILE}"
for file in ${OPTS_DIR};
for file in /etc/bash.bashrc.d/*;
do
source "\$file"
done
......
#!/bin/bash
# Replace su by a message to use sudo
# Replace su by a message to use sudo.
#
# In Tails, the administration password doesn't work with 'su'. New
# users in particular may be puzzled by the authentication failures
# while trying to 'su' using administration password.
#
# This script introduces 'su' function for non-root users which asks
# them to use 'sudo' instead of 'su'.
#
# https://redmine.tails.boum.org/code/issues/15583
# Get LANG
......@@ -12,12 +20,13 @@ export LANG
TEXTDOMAIN="tails"
export TEXTDOMAIN
[ $USER == root ] && return
# Since we don't want to add 'su' function for root user, we will stop
# execution of this script if $USER is root.
[ "$USER" == root ] && return
su (){
tails_is_password_set.py
if [ $? -eq 0 ]; then
"`gettext \"su is disabled. Please use sudo instead.\"`"
if tails_is_password_set.py; then
echo "`gettext \"su is disabled. Please use sudo instead.\"`"
else
cat /usr/share/tails-greeter/no-password-lecture.txt
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment