Package: base-files
Version: 3.1.2
Severity: minor
Tags: patch

See attached patch.

- Use /usr/bin/id instead of 'id' (faster, more reliable)
- Use variable to hold result (more efficient)
- Use "=" testing instead of -eq (more reliable, in case id fails;
  e.g. due to temporary configuration problem with permissions)

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ISO-8859-1) (ignored: LC_ALL set to en_US)

Versions of packages base-files depends on:
ii  base-passwd                   3.5.9      Debian base system master password
ii  gawk [awk]                    1:3.1.4-2  GNU awk, a pattern scanning and pr
ii  mawk [awk]                    1.3.3-11   a pattern scanning and text proces

-- no debconf information
cd /tmp/
diff -bwu /tmp/profile.orig /tmp/profile
--- /tmp/profile.orig   2005-04-03 19:56:59.855371484 +0300
+++ /tmp/profile        2005-04-03 19:58:22.065246902 +0300
@@ -1,7 +1,9 @@
 # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
 # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
 
-if [ "`id -u`" -eq 0 ]; then
+id=`/usr/bin/id -u`
+
+if [ "$id" = "0" ]; then
   
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
 else
   PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
@@ -11,7 +13,7 @@
   if [ "$BASH" ]; then
     PS1='[EMAIL PROTECTED]:\w\$ '
   else
-    if [ "`id -u`" -eq 0 ]; then
+    if [ "$id" = "0" ]; then
       PS1='# '
     else
       PS1='$ '
@@ -19,6 +21,7 @@
   fi
 fi
 
+unset id
 export PATH
 
 umask 022

Diff finished at Sun Apr  3 19:58:44

Reply via email to