diff options
| author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-03-26 16:09:19 -0500 |
|---|---|---|
| committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-03-26 16:09:19 -0500 |
| commit | 89682db9a2259e15a88423b87e33b6dd504206d9 (patch) | |
| tree | acc9cfc4876efe76a7ce64c49a4c92becb75e06b /sc-ap/ldap1.cpp | |
| parent | 6610cd15cf186fe1f8e82628f6f12aa2c490bac2 (diff) | |
| download | windows-ldap-integration-89682db9a2259e15a88423b87e33b6dd504206d9.tar.gz windows-ldap-integration-89682db9a2259e15a88423b87e33b6dd504206d9.zip | |
Fix crashes
Fix incorrect LDAP attributes
Fix local backdoor
Fix build warnings
Allow configured groups to become machine local administrators
Fix workstation unlock
Diffstat (limited to 'sc-ap/ldap1.cpp')
| -rwxr-xr-x | sc-ap/ldap1.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sc-ap/ldap1.cpp b/sc-ap/ldap1.cpp index 435c210..08b5eda 100755 --- a/sc-ap/ldap1.cpp +++ b/sc-ap/ldap1.cpp @@ -122,31 +122,37 @@ CLDAP::CLDAP( const std::list<mystring>& servers, FILE *fp, const mystring& bind lp = ldap_init( (const PWCHAR) ptr->c_str(), LDAP_PORT); ULONG version = LDAP_VERSION3; if (!lp) { - fprintf( fp, "ldap_init error on server %S\n", ptr->c_str()); + if (fp) { + fprintf( fp, "ldap_init error on server %S\n", ptr->c_str()); + } continue; } int ret = ldap_set_option( lp, LDAP_OPT_VERSION, &version); if (ret != LDAP_SUCCESS) { - fprintf( fp, "ldap_set_option error %x on server %S\n", ret, ptr->c_str()); - ldap_unbind( lp); - continue; + if (fp) { + fprintf( fp, "ldap_set_option error %x on server %S\n", ret, ptr->c_str()); + } + ldap_unbind( lp); + continue; } if (binddn == L"" || bindpasswd == L"") { ret = ldap_simple_bind_s( lp, NULL, NULL); if (LDAP_SUCCESS != ret) { - if (fp) + if (fp) { fprintf( fp, "anonymous ldap_simple_bind_s error %x on server %S\n", ret, ptr->c_str()); + } ldap_unbind( lp); lp = NULL; } } else { ret = ldap_simple_bind_s( lp, (PWCHAR) binddn.c_str(), (PWCHAR) bindpasswd.c_str()); if (LDAP_SUCCESS != ret) { - if (fp) + if (fp) { fprintf( fp, "ldap_simple_bind_s error %x on server %S, basedn %S, passwd %S\n", ret, ptr->c_str(), binddn.c_str(), bindpasswd.c_str()); + } ldap_unbind( lp); lp = NULL; } |
