jim 99/04/22 04:58:57
Modified: src/helpers getuid.sh Log: Some changes as suggested by Ralf. Best to be conservative ;) Revision Changes Path 1.4 +14 -12 apache-1.3/src/helpers/getuid.sh Index: getuid.sh =================================================================== RCS file: /export/home/cvs/apache-1.3/src/helpers/getuid.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- getuid.sh 1999/04/21 19:37:17 1.3 +++ getuid.sh 1999/04/22 11:58:56 1.4 @@ -8,14 +8,16 @@ # See http://www.apache.org/docs/LICENSE # First we try 'id' -if AP_IDPATH=`./src/helpers/PrintPath id` ; then +if `./src/helpers/PrintPath -s id` ; then + AP_IDPATH=`./src/helpers/PrintPath id` # See if it's a POSIX 'id' - if AP_RETVAL=`$AP_IDPATH -u 2>/dev/null` ; then + if `$AP_IDPATH -u 2>/dev/null` ; then + AP_RETVAL=`$AP_IDPATH -u` echo $AP_RETVAL exit 0 else AP_RETVAL=`$AP_IDPATH | \ - sed -e 's/^.*uid=//' | \ + sed -e 's/^.*uid[ ]*=[ ]*[^0123456789]*//' | \ sed -e 's/[ ]*(.*$//'` echo $AP_RETVAL exit 0 @@ -29,22 +31,22 @@ # Try 'whoami' first, then 'who am i' (making sure to strip away # the who crud) and finally just copy $LOGNAME # -if AP_WHOAMI=`./src/helpers/PrintPath whoami` ; then - AP_LOGNAME=`$AP_WHOAMI` +if `./src/helpers/PrintPath -s whoami` ; then + AP_WAIPATH=`./src/helpers/PrintPath whoami` + AP_LOGNAME=`$AP_WAIPATH` else - if AP_LOGNAME=`who am i | tail -1 | sed -e 's/[ ][ ]*.*$//'` ; then - : - else - AP_LOGNAME=$LOGNAME - fi + AP_LOGNAME=`who am i | tail -1 | sed -e 's/[ ][ ]*.*$//'` fi # # See if we have a valid login name. # if [ "x$AP_LOGNAME" = "x" ]; then - echo "?" - exit 1 + AP_LOGNAME=$LOGNAME + if [ "x$AP_LOGNAME" = "x" ]; then + echo "?" + exit 1 + fi fi #