LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2005, 01:22 AM   #1
tclwp
Member
 
Registered: Jan 2005
Posts: 37

Rep: Reputation: 15
Can curl download a binary entry from a ldap server ?


Thanks a lot
 
Old 07-18-2005, 06:01 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,794

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
why not ?
 
Old 07-19-2005, 12:08 AM   #3
tclwp
Member
 
Registered: Jan 2005
Posts: 37

Original Poster
Rep: Reputation: 15
Is there a C code example?
Thanks in advance
 
Old 07-19-2005, 07:53 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
The curl manual says:
Quote:
LDAP

If you have installed the OpenLDAP library, curl can take advantage of it
and offer ldap:// support.

LDAP is a complex thing and writing an LDAP query is not an easy task. I do
advice you to dig up the syntax description for that elsewhere. Two places
that might suit you are:

Netscape's "Netscape Directory SDK 3.0 for C Programmer's Guide Chapter 10:
Working with LDAP URLs":
http://developer.netscape.com/docs/m...csdk30/url.htm

RFC 2255, "The LDAP URL Format" http://www.rfc-editor.org/rfc/rfc2255.txt

To show you an example, this is now I can get all people from my local LDAP
server that has a certain sub-domain in their email address:

curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se"

If I want the same info in HTML format, I can get it by not using the -B
(enforce ASCII) flag.
 
Old 07-19-2005, 07:57 AM   #5
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
And if it turns out curl doesn't do the trick in your case, try "ldapsearch" from the standard OpenLDAP utils.

ldapsearch has an option to download attribute-values to a temp-file.
From "man ldapsearch":
Quote:
-t Write retrieved non-printable values to a set of temporary files. This is useful for dealing with values containing non-character data such as jpegPhoto or audio.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP: Can't contact master ldap server rulirahm Linux - Networking 2 07-14-2014 02:02 AM
LDAP server not starting as user LDAP klnasveschuk Fedora 1 02-15-2007 04:49 AM
Pros and cons of CLI download tools [wget and curl] Conjurer Linux - Software 1 12-01-2005 02:45 PM
ldap-abook unable to get street name in ldap-entry Jingle Linux - Software 1 06-06-2004 07:13 PM
how to use curl to download? gexiaofei Linux - Software 6 07-26-2003 05:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration