Make assoldap compatible with multi-value fields.
authorDominik George <dominik.george@teckids.org>
Sun, 29 Nov 2015 18:28:26 +0000 (18:28 +0000)
committermirabilos <m@mirbsd.org>
Sun, 29 Nov 2015 18:28:26 +0000 (18:28 +0000)
API break, requires upcoming changes…

mksh/assoldap.ksh

index 6839457..c80866f 100644 (file)
@@ -104,7 +104,10 @@ function asso_setldap {
                        rm -rf "$T"
                        return 255
                fi
-               asso_sets "$value" "${arrpath[@]}" "$dn" "$x"
+
+               c=$(asso_getv "${arrpath[@]}" "$dn" "$x" count)
+               asso_sets "$value" "${arrpath[@]}" "$dn" "$x" $((c))
+               asso_seti $((++c)) "${arrpath[@]}" "$dn" "$x" count
        done <"$T/out"
        rm -rf "$T"
        if [[ -n $dn ]]; then