Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-cloud / recipes-support / ldapscripts / files / allow-anonymous-bind-for-ldap-search.patch
1 From bee43b9f75ee7a2cee0391319528264014d775f7 Mon Sep 17 00:00:00 2001
2 From: Kam Nasim <kam.nasim@windriver.com>
3 Date: Mon, 16 Apr 2018 14:58:03 -0400
4 Subject: [PATCH] ldapscripts - allow anonymous bind for ldap search
5
6 ---
7  lib/runtime | 7 +++++--
8  1 file changed, 5 insertions(+), 2 deletions(-)
9
10 diff --git a/lib/runtime b/lib/runtime
11 index 012ac95..18acf3f 100644
12 --- a/lib/runtime
13 +++ b/lib/runtime
14 @@ -197,8 +197,11 @@ _ldapsearch () {
15    elif [ -n "$BINDPWDFILE" ]
16    then
17      $LDAPSEARCHBIN $LDAPBINOPTS $LDAPSEARCHOPTS -y "$BINDPWDFILE" -D "$BINDDN" -b "${1:-$SUFFIX}" -xH "$SERVER" -s sub -LLL "${2:-(objectclass=*)}" "${3:-*}" 2>>"$LOGFILE" 
18 -  else
19 +  elif [ -n "$BINDPWD" ]
20 +  then
21      $LDAPSEARCHBIN $LDAPBINOPTS $LDAPSEARCHOPTS -w "$BINDPWD" -D "$BINDDN" -b "${1:-$SUFFIX}" -xH "$SERVER" -s sub -LLL "${2:-(objectclass=*)}" "${3:-*}" 2>>"$LOGFILE" 
22 +  else
23 +    $LDAPSEARCHBIN $LDAPBINOPTS $LDAPSEARCHOPTS -D "$BINDDN" -b "${1:-$SUFFIX}" -xH "$SERVER" -s sub -LLL "${2:-(objectclass=*)}" "${3:-*}" 2>>"$LOGFILE" 
24    fi
25  }
26  
27 @@ -785,7 +788,7 @@ then
28      then
29        warn_log "Warning : using command-line passwords, ldapscripts may not be safe"
30      else
31 -      end_die "Unable to read password file $BINDPWDFILE, exiting..."
32 +      warn_log "Warning: Unable to read password file $BINDPWDFILE, binding anonymously..."
33      fi
34    fi
35  fi
36 -- 
37 1.8.3.1
38