zshrc: use sudo su for alias su
authorMichael Prokop <mika@grml.org>
Mon, 11 Feb 2008 17:01:19 +0000 (18:01 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 11 Feb 2008 17:01:19 +0000 (18:01 +0100)
debian/changelog
etc/zsh/zshrc

index cae1f33..f99ea58 100644 (file)
@@ -9,8 +9,11 @@ grml-etc-core (0.3.48) unstable; urgency=low
 
   [ Michael Prokop ]
   * zshrc: enable 'setopt longlistjobs' by default
+  * zshrc: re-enable use of 'sudo su' instead of 'sudo -s' for alias su,
+    otherwise it breaks "su - $USER". Thanks for bringing this up,
+    Martin Yazdzik!
 
- -- Michael Prokop <mika@grml.org>  Fri, 01 Feb 2008 02:52:14 +0100
+ -- Michael Prokop <mika@grml.org>  Mon, 11 Feb 2008 17:58:42 +0100
 
 grml-etc-core (0.3.47) unstable; urgency=low
 
index 42de4c4..47c7944 100644 (file)
@@ -3,7 +3,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Sam Dez 22 19:17:27 CET 2007 [mika]
+# Latest change: Mon Feb 11 18:00:55 CET 2008 [mika]
 ################################################################################
 # This file is sourced only for interactive shells. It
 # should contain commands to set up aliases, functions,
@@ -1357,7 +1357,11 @@ if [[ -r /etc/debian_version ]] ; then
         fi
     }
 
-    isgrmlcd && alias su="sudo -s"          # get a root shell
+    # get a root shell as normal user in live-cd mode:
+    if isgrmlcd && [[ $UID -ne 0 ]] ; then
+       alias su="sudo su"
+     fi
+
     #a1# Take a look at the syslog: \kbd{\$PAGER /var/log/syslog}
     alias llog="$PAGER /var/log/syslog"     # take a look at the syslog
     #a1# Take a look at the syslog: \kbd{tail -f /var/log/syslog}