[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Invalid DN Syntax in Shell Script



On 2011.04.25 21.30, Inácio Alves wrote:
function verificaSenha(){
   whoAmI=`whoami`
   param=`echo "ldapsearch -x -W -D
\"uid=$whoAmI,ou=People,dc=ifce,dc=edu,dc=br\" -b \"dc=ifce,dc=edu,dc=br\"
\"(uid=$whoAmI)\""`
   exec `echo "$param"`
}

i'm not sure what the goal is here, but it seems convoluted.  if the goal is simply to run ldapsearch and print the output:

#!/bin/bash

function verify_user(){
    user=$(whoami)
    base_dn='dc=ifce,dc=edu,dc=br'
    ldapsearch -xWD "uid=${user},ou=people,${base_dn}" -b "${base_dn}" "(uid=${user})"
}

verify_user

exit 0