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
|
|