LDAP, netrc, username with space
Date: Wed, 19 Jun 2019 14:12:07 +0000
Hi curl users,
I have a situation attempting to use a netrc file with LDAP/S protocol and cannot find clear documentation.
Two questions:
1) Should a netrc file be usable with the LDAP protocol?
2) Should a username with a space function normally, or is there quoting or escaping required?
Credentials with -u (succeeds):
$ curl 'ldap://localhost:1389/cn=monitor?uptime' -u "cn=Directory Manager:$(cat /var/secret/monitor_user.pwd)" -k --trace-ascii -
== Info: Trying 127.0.0.1...
== Info: TCP_NODELAY set
== Info: Connected to localhost (127.0.0.1) port 1389 (#0)
== Info: LDAP local: ldap://localhost:1389/cn=monitor?uptime
DN: cn=monitor
uptime: 0 days 21 hours 30 minutes 53 seconds
<= Recv data, 0 bytes (0x0)
== Info: Connection #0 to host localhost left intact
Credentials within netrc (fails):
$ echo "machine localhost login cn=Directory Manager password $(cat /var/secret/monitor_user.pwd)" > /tmp/.netrc
$ curl 'ldap://localhost:1389/cn=monitor?uptime' --netrc-file /tmp/.netrc -k --trace-ascii -
== Info: Trying 127.0.0.1...
== Info: TCP_NODELAY set
== Info: Connected to localhost (127.0.0.1) port 1389 (#0)
== Info: LDAP remote: bind failed Success
== Info: Closing connection 0
curl: (67) LDAP remote: bind failed Success
I would appreciate any suggests how to get the credentials out of the command for LDAP when the username is this kind of typical LDAP username.
Kind Regards,
Tim
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
- application/pkcs7-signature attachment: smime.p7s