OSSP CVS Repository

ossp - Check-in [5657]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5657
Date: 2006-Sep-29 08:13:16 (local)
2006-Sep-29 06:13:16 (UTC)
User:rse
Branch:
Comment: Fix and enhance "shtool echo -e" command by adding a missing line-continuation and adding support for MacOS X via nidump(8).
Tickets:
Inspections:
Files:
ossp-pkg/shtool/ChangeLog      1.228 -> 1.229     6 inserted, 0 deleted
ossp-pkg/shtool/sh.echo      1.40 -> 1.41     18 inserted, 6 deleted

ossp-pkg/shtool/ChangeLog 1.228 -> 1.229

--- ChangeLog    2006/04/19 16:35:17     1.228
+++ ChangeLog    2006/09/29 06:13:16     1.229
@@ -9,6 +9,12 @@
 
  ChangeLog
 
+ Changes between 2.0.6 and 2.0.7 (19-Apr-2006 to xx-Sep-2006):
+
+   *) Fix and enhance "shtool echo -e" command by adding a missing
+      line-continuation and adding support for MacOS X via nidump(8).
+      [Ralf S. Engelschall]
+
  Changes between 2.0.5 and 2.0.6 (07-Feb-2006 to 19-Apr-2006):
 
    *) Add support for Sun Niagara (sun4v) architecture to


ossp-pkg/shtool/sh.echo 1.40 -> 1.41

--- sh.echo      2006/02/04 09:43:25     1.40
+++ sh.echo      2006/09/29 06:13:17     1.41
@@ -146,11 +146,14 @@
                     userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
                             sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                     if [ ".$userid" = . ]; then
-                        userid=`(ypcat passwd) 2>/dev/null |
-                                grep "^${username}:" | \
+                        userid=`(ypmatch "${username}" passwd) 2>/dev/null | \
                                 sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
                         if [ ".$userid" = . ]; then
-                            userid='?'
+                            userid=`(nidump passwd . | grep "^${username}:") 2>/dev/null | \
+                                    sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+                            if [ ".$userid" = . ]; then
+                                userid='?'
+                            fi
                         fi
                     fi
                 fi
@@ -175,10 +178,14 @@
                 groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
                          sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
                 if [ ".$groupid" = . ]; then
-                    groupid=`(ypcat passwd) 2>/dev/null | grep "^${username}:" | \
+                    groupid=`(ypmatch "${username}" passwd) 2>/dev/null | \
                              sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
                     if [ ".$groupid" = . ]; then
-                        groupid='?'
+                        groupid=`(nidump passwd . | grep "^${username}:") 2>/dev/null | \
+                                 sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+                        if [ ".$groupid" = . ]; then
+                            groupid='?'
+                        fi
                     fi
                 fi
             fi
@@ -207,7 +214,12 @@
                                grep "^[^:]*:[^:]*:${groupid}:" | \
                                sed -e 's/:.*$//'`
                     if [ ".$groupname" = . ]; then
-                        groupname='?'
+                        groupname=`(nidump group .) 2>/dev/null | \
+                                   grep "^[^:]*:[^:]*:${groupid}:" | \
+                                   sed -e 's/:.*$//'`
+                        if [ ".$groupname" = . ]; then
+                            groupname='?'
+                        fi
                     fi
                 fi
             fi

CVSTrac 2.0.1