]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/aliases.in
shell/aliases: disallow su as root
[config/dotfiles.git] / shell / aliases.in
index eebda1ec1917c1cba1e15b5e9326f75886db9dab..cb59d9c4fc3953ba3595930c93702099b3be0600 100644 (file)
@@ -71,7 +71,7 @@ unalias ls 2>/dev/null
 # See `setup.sh` for details. LS_* are replaced with the appropriate values
 # when this file is generated.
 ls() {
-    LS_ENV command ls LS_COLOR LS_OPTIONS -C -F "$@" 2>&1 | less
+    LS_ARGS -C -F "$@" 2>&1 | less
 }
 
 unalias ll lt la lal lat 2>/dev/null
@@ -120,4 +120,14 @@ info() {
     command info "$@" 2>/dev/null | less
 }
 
+# Using su (or sudo) as root to a less privileged user might allow the other
+# user to run arbitrary commands as root. See also Debian bugs #628843 and
+# #657784.
+if test "`id -u`" -eq 0; then
+    su() {
+        echo 'never su as root' >&2
+        return 1
+    }
+fi
+
 # vim: ft=sh