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...)

link|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
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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