浏览代码

fix settings from --[smrn]gid options getting lost

Thomas Lotterer 22 年之前
父节点
当前提交
16e89a28cc
共有 2 个文件被更改,包括 13 次插入8 次删除
  1. 1 0
      openpkg/HISTORY
  2. 12 8
      openpkg/aux.usrgrp.sh

+ 1 - 0
openpkg/HISTORY

@@ -2,6 +2,7 @@
 2004
 ====
 
+20040112 settings from [smrn]gid options get lost; fix by introducing a temporary variable
 20040112 fix RPM internal handling of %_excludedocs macro
 20040107 fix config.cache file handling in building of GNU tar and GNU patch
 20040107 downgrade to GNU tar 1.13.25 again because --no-recursion is broken in <= 1.13.92

+ 12 - 8
openpkg/aux.usrgrp.sh

@@ -94,9 +94,10 @@ fi
 if [ ".$sgrp" = . ]; then
     sgrp=`(id -gn $susr) 2>/dev/null`
     if [ ".$sgrp" = . ]; then
-        sgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+        tgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
               grep "^${susr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
-        if [ ".$sgid" != . ]; then
+        if [ ".$tgid" != . ]; then
+            sgid="${tgid}"
             sgrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
                   grep ":${sgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
         fi
@@ -116,9 +117,10 @@ fi
 if [ ".$mgrp" = . ]; then
     mgrp=`(id -gn $musr) 2>/dev/null`
     if [ ".$mgrp" = . ]; then
-        mgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+        tgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
               grep "^${musr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
-        if [ ".$mgid" != . ]; then
+        if [ ".$tgid" != . ]; then
+            mgid="${tgid}"
             mgrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
                   grep ":${mgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
         fi
@@ -141,9 +143,10 @@ fi
 if [ ".$rgrp" = . ]; then
     rgrp=`(id -gn $rusr) 2>/dev/null`
     if [ ".$rgrp" = . ]; then
-        rgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+        tgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
               grep "^${rusr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
-        if [ ".$rgid" != . ]; then
+        if [ ".$tgid" != . ]; then
+            rgid="${tgid}"
             rgrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
                   grep ":${rgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
         fi
@@ -166,9 +169,10 @@ fi
 if [ ".$ngrp" = . ]; then
     ngrp=`(id -gn $nusr) 2>/dev/null`
     if [ ".$ngrp" = . ]; then
-        ngid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+        tgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
               grep "^${nusr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
-        if [ ".$ngid" != . ]; then
+        if [ ".$tgid" != . ]; then
+            ngid="${tgid}"
             ngrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
                   grep ":${ngid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
         fi