ldapadd with a Rebol command string

130 Views Asked by At

I can add or modify an LDAP entry with Rebol by calling ldapadd or ldapmodify by reading the entries from a file with the ldap command option -f.
Even the Rebol redirection call/console is working if I add the entries by hand.
But I do not know how to do it with just one command string or with call/input and an input string. I tried it with different combinations of lf EOF a.s.o. No success

nl: "^/^M"; nl: ""  etc
call  join  {c:\openldap\bin\ldapmodify -h localhost -p 1389  -x -D "cn=Admin" -w password} [ nl
   {dn: uid=user.10,ou=People,dc=example,dc=com}  nl
   {changetype: modify}  nl
   {replace: sn} nl
   {sn: NichtAlles}"^Z"]
1

There are 1 best solutions below

3
On

call/input requires two arguments, but you are passing only one, as you are join-ing them. Try rather with:

call/input
    {c:\openldap\bin\ldapmodify -h localhost -p 1389  -x -D "cn=Admin" -w password}
    rejoin [
        {dn: uid=user.10,ou=People,dc=example,dc=com} newline
        {changetype: modify} newline
        {replace: sn} newline
        {sn: NichtAlles} newline
    ]