6 void usage (const char *argv0
);
7 void leak_loop (const char *host
, int port
, const char *binddn
,
11 main (int argc
, char **argv
)
13 char *host
= "localhost";
25 c
= getopt (argc
, argv
, "h:p:b:x:");
49 if (!binddn
|| !passwd
|| port
<= 0 || port
>= 1 << 16)
52 leak_loop (host
, port
, binddn
, passwd
);
58 usage (const char *argv0
)
60 fprintf (stderr
, "Usage: %s -b binndn -x passwd [-h host] [-p port]\n",
66 leak_loop (const char *host
, int port
, const char *binddn
,
73 for (i
= 0; i
< 1 << 12; i
++)
75 ld
= ldap_init (host
, port
);
77 version
= LDAP_VERSION3
;
78 ldap_set_option (ld
, LDAP_OPT_PROTOCOL_VERSION
, &version
);
80 rc
= ldap_simple_bind_s (ld
, binddn
, passwd
);
82 if (rc
!= LDAP_SUCCESS
)
84 fprintf (stderr
, "LDAP Error: %s\n", ldap_err2string (rc
));