Browse Source

fix uid/gid determination loops by not being confused by multiple query results

Ralf S. Engelschall 21 years ago
parent
commit
ec02703bd6
2 changed files with 8 additions and 5 deletions
  1. 1 0
      openpkg/HISTORY
  2. 7 5
      openpkg/openpkg.spec

+ 1 - 0
openpkg/HISTORY

@@ -2,6 +2,7 @@
 2004
 2004
 ====
 ====
 
 
+20040810 fix uid/gid determination loops by not being confused by multiple query results
 20040804 upgrade to BeeCrypt 4.0.0 and GNU Bash 3.0
 20040804 upgrade to BeeCrypt 4.0.0 and GNU Bash 3.0
 20040725 fix a few typos in rc(8) manual page 
 20040725 fix a few typos in rc(8) manual page 
 20040725 remove useless "Provides" for the corresponding RELEASE version
 20040725 remove useless "Provides" for the corresponding RELEASE version

+ 7 - 5
openpkg/openpkg.spec

@@ -39,7 +39,7 @@
 #   o any cc(1)
 #   o any cc(1)
 
 
 #   the package version/release
 #   the package version/release
-%define       V_openpkg  20040804
+%define       V_openpkg  20040810
 
 
 #   the used software versions
 #   the used software versions
 %define       V_rpm      4.2.1
 %define       V_rpm      4.2.1
@@ -1340,7 +1340,7 @@ Provides:     OpenPKG
         eval "xgid=\"\$${class}gid\""
         eval "xgid=\"\$${class}gid\""
         if [ ".$xuid" = . ]; then
         if [ ".$xuid" = . ]; then
             xuid=`(getent passwd; cat /etc/passwd; ypcat passwd; nidump passwd .) 2>/dev/null |\
             xuid=`(getent passwd; cat /etc/passwd; ypcat passwd; nidump passwd .) 2>/dev/null |\
-                  grep "^${xusr}:" | awk -F: '{ print $3; }'`
+                  grep "^${xusr}:" | awk -F: '{ print $3; }' | sed -e q`
             if [ ".$xuid" = . ]; then
             if [ ".$xuid" = . ]; then
                 #   seek for a reasonably uid/gid pair
                 #   seek for a reasonably uid/gid pair
                 xuid=1000
                 xuid=1000
@@ -1348,11 +1348,13 @@ Provides:     OpenPKG
                 while [ ".$ok" = .0 ]; do
                 while [ ".$ok" = .0 ]; do
                     eval "u_exists=\$u_exists_$xuid"
                     eval "u_exists=\$u_exists_$xuid"
                     if [ ".$u_exists" = . ]; then
                     if [ ".$u_exists" = . ]; then
-                        u_exists=`(getent passwd; cat /etc/passwd; ypcat passwd; nidump passwd .) 2>/dev/null | grep "^[^:]*:[^:]*:$xuid:"`
+                        u_exists=`(getent passwd; cat /etc/passwd; ypcat passwd; nidump passwd .) 2>/dev/null |\
+                                  grep "^[^:]*:[^:]*:$xuid:"`
                     fi
                     fi
                     eval "g_exists=\$g_exists_$xuid"
                     eval "g_exists=\$g_exists_$xuid"
                     if [ ".$g_exists" = . ]; then
                     if [ ".$g_exists" = . ]; then
-                        g_exists=`(getent group; cat /etc/group; ypcat group; nidump group .) 2>/dev/null | grep "^[^:]*:[^:]*:$xuid:"`
+                        g_exists=`(getent group; cat /etc/group; ypcat group; nidump group .) 2>/dev/null |\
+                                  grep "^[^:]*:[^:]*:$xuid:"`
                     fi
                     fi
                     if [ ".$u_exists" = . -a ".$g_exists" = . ]; then
                     if [ ".$u_exists" = . -a ".$g_exists" = . ]; then
                         ok=1
                         ok=1
@@ -1366,7 +1368,7 @@ Provides:     OpenPKG
         fi
         fi
         if [ ".$xgid" = . ]; then
         if [ ".$xgid" = . ]; then
             xgid=`(getent group; cat /etc/group; ypcat group; nidump group .) 2>/dev/null |\
             xgid=`(getent group; cat /etc/group; ypcat group; nidump group .) 2>/dev/null |\
-                  grep "^${xgrp}:" | awk -F: '{ print $3; }'`
+                  grep "^${xgrp}:" | awk -F: '{ print $3; }' | sed -e q`
             if [ ".$xgid" = . ]; then
             if [ ".$xgid" = . ]; then
                 xgid="$xuid"
                 xgid="$xuid"
             fi
             fi