Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ldap/ns_ldap/idsconfig.sh
          +++ new/usr/src/cmd/ldap/ns_ldap/idsconfig.sh
↓ open down ↓ 966 lines elided ↑ open up ↑
 967  967      PROG=`basename $0`  # Program name
 968  968      PID=$$              # Program ID
 969  969      VERB='> /dev/null 2>&1'     # NULL or "> /dev/null"
 970  970      ECHO="/bin/echo"    # print message on screen
 971  971      EVAL="eval"         # eval or echo
 972  972      EGREP="/usr/bin/egrep"
 973  973      GREP="/usr/bin/grep"
 974  974      DEBUG=0             # Set Debug OFF
 975  975      BACKUP=no_ldap      # backup suffix
 976  976      HOST=""             # NULL or <hostname>
 977      -    NAWK="/usr/bin/nawk"
      977 +    AWK="/usr/xpg4/bin/awk"
 978  978      RM="/usr/bin/rm"
 979  979      WC="/usr/bin/wc"
 980  980      CAT="/usr/bin/cat"
 981  981      SED="/usr/bin/sed"
 982  982      MV="/usr/bin/mv"
 983  983  
 984  984      DOM=""              # Set to NULL
 985  985      # If DNS domain (resolv.conf) exists use that, otherwise use domainname.
 986  986      if [ -f /etc/resolv.conf ]; then
 987  987          DOM=`/usr/xpg4/bin/grep -i -E '^domain|^search' /etc/resolv.conf \
↓ open down ↓ 429 lines elided ↑ open up ↑
1417 1417      if [ $? -eq 1 ]; then
1418 1418          LDAP_ENABLE_SHADOW_UPDATE="TRUE"
1419 1419      else
1420 1420          LDAP_ENABLE_SHADOW_UPDATE="FALSE"
1421 1421      fi
1422 1422  }
1423 1423  
1424 1424  get_krb_realm() {
1425 1425  
1426 1426      # To upper cases
1427      -    LDAP_KRB_REALM=`${ECHO} ${LDAP_DOMAIN} | ${NAWK} '{ print toupper($0) }'`
     1427 +    LDAP_KRB_REALM=`${ECHO} ${LDAP_DOMAIN} | ${AWK} '{ print toupper($0) }'`
1428 1428      get_ans_req "Enter Kerberos Realm:" "$LDAP_KRB_REALM"
1429 1429      # To upper cases
1430      -    LDAP_KRB_REALM=`${ECHO} ${ANS} | ${NAWK} '{ print toupper($0) }'`
     1430 +    LDAP_KRB_REALM=`${ECHO} ${ANS} | ${AWK} '{ print toupper($0) }'`
1431 1431  }
1432 1432  
1433 1433  # $1: DN
1434 1434  # $2: ldif file
1435 1435  add_entry_by_DN() {
1436 1436  
1437 1437      ${EVAL} "${LDAPSEARCH} ${LDAP_ARGS} -b \"${1}\" -s base \"objectclass=*\" ${VERB}"
1438 1438      if [ $? -eq 0 ]; then
1439 1439              ${ECHO} "  ${1} already exists"
1440 1440              return 0
↓ open down ↓ 3615 lines elided ↑ open up ↑
5056 5056          ${SED} -e 's/aci=//' > ${TMPDIR}/grep_proxyread_aci 2>&1
5057 5057      if [ $? -ne 0 ]; then
5058 5058          ${ECHO} "Proxy ACI ${PROXY_ACI_NAME} does not exist for ${LDAP_BASEDN}."
5059 5059          return 0
5060 5060      fi
5061 5061  
5062 5062      # We need to remove proxy agent's read access to user passwords,
5063 5063      # but We do not know the value of the ${LDAP_PROXYAGENT} here, so
5064 5064      # 1. if only one match found, delete it
5065 5065      # 2. if more than one matches found, ask the user which one to delete
5066      -    HOWMANY=`${WC} -l ${TMPDIR}/grep_proxyread_aci | ${NAWK} '{print $1}'`
     5066 +    HOWMANY=`${WC} -l ${TMPDIR}/grep_proxyread_aci | ${AWK} '{print $1}'`
5067 5067      if [ $HOWMANY -eq 0 ]; then
5068 5068          ${ECHO} "Proxy ACI ${PROXY_ACI_NAME} does not exist for ${LDAP_BASEDN}."
5069 5069          return 0
5070 5070      fi
5071 5071      if [ $HOWMANY -eq 1 ];then
5072 5072          proxy_aci=`${CAT} ${TMPDIR}/grep_proxyread_aci`
5073 5073      else
5074 5074              ${CAT} << EOF
5075 5075  
5076 5076  Proxy agent is not allowed to read user passwords when shadow
↓ open down ↓ 3 lines elided ↑ open up ↑
5080 5080  
5081 5081  The proxy agents are:
5082 5082  
5083 5083  EOF
5084 5084              # generate the proxy agent list
5085 5085              ${SED} -e "s/.*ldap:\/\/\/.*ldap:\/\/\///" \
5086 5086              ${TMPDIR}/grep_proxyread_aci | ${SED} -e "s/\";)//" > \
5087 5087                  ${TMPDIR}/proxy_agent_list
5088 5088  
5089 5089              # print the proxy agent list
5090      -            ${NAWK} '{print NR ": " $0}' ${TMPDIR}/proxy_agent_list
     5090 +            ${AWK} '{print NR ": " $0}' ${TMPDIR}/proxy_agent_list
5091 5091  
5092 5092              # ask the user to pick one
5093 5093              _MENU_PROMPT="Select the proxy agent (1-$HOWMANY): "
5094 5094              get_menu_choice "${_MENU_PROMPT}" "0" "$HOWMANY"
5095 5095              _CH=$MN_CH
5096 5096              proxy_aci=`${SED} -n "$_CH p" ${TMPDIR}/grep_proxyread_aci`
5097 5097      fi
5098 5098  
5099 5099      # Create the tmp file to delete the ACI.
5100 5100      ( cat <<EOF
↓ open down ↓ 274 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX