Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At the end of my ldapsearch results I always get something like the following:

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

I know what the rest of it is doing, but I can't find any info on what the search: 2 line signifies. Any ideas? Is it the message ID? (with msgId:1 being the bind I guess)

(sigh, less than 200 rep means 'ldapsearch' isn't a valid tag...)

share|improve this question
    
The commented LDIF output of the old OpenLDAP search tool can be repressed with the -L, -LL, or -LLL command line options. –  Terry Gardner Oct 8 '11 at 10:32
add comment

1 Answer

up vote 1 down vote accepted

2 is indeed the messageID of the search operation.

From the source code of OpenLDAP, file clients/tools/ldapsearch.c, function print_result():

1823         if( search ) {
1824                 if ( ldif < 2 ) {
1825                         printf(_("# search result\n"));
1826                 }
1827                 if ( ldif < 1 ) {
1828                         printf("%s: %d\n", _("search"), ldap_msgid(result) );
1829                 }
1830         }

You can verify this with a packet sniffer such as Wireshark. If, for example, SASL GSSAPI authentication is used, then the search operation will be #5, resulting in search: 5.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.