+2005-03-08 Helge Hess <helge.hess@opengroupware.org>
+
+ * NGLdapConnection.m: fixed not to do unauthenticated binds (related to
+ OGo bug #957) (v4.5.22)
+
2004-12-14 Marcus Mueller <znek@mulle-kybernetik.com>
* NGLdap.xcode: minor fixes and updated
if (LDAPDebugEnabled)
[self logWithFormat:@"check pwd of login '%@' on %@", _login, _baseDN];
+ if ([_pwd length] == 0) {
+ if (LDAPDebugEnabled) [self logWithFormat:@" no password provided."];
+ return NO;
+ }
+
if (self->handle == NULL) {
if (![self _reinit]) {
NSLog(@"%s: _reinit failed...:", __PRETTY_FUNCTION__);
*/
didBind = NO;
- NS_DURING
+ NS_DURING {
+ /* Note: beware: do _not_ use empty passwords! (unauthenticated binds) */
didBind = [self bindWithMethod:@"simple" binddn:strDN credentials:_pwd];
+ }
NS_HANDLER
didBind = NO;
NS_ENDHANDLER;
NSLog(@"LDAP: check pwd of login '%@' on %@,%i,%@ ...",
_login, _hostName, _port, _baseDN);
}
+ if ([_pwd length] == 0) {
+ if (LDAPDebugEnabled) [self logWithFormat:@" no password provided."];
+ return NO;
+ }
if ((ldap = [[self alloc] initWithHostName:_hostName port:_port]) == nil) {
if (LDAPDebugEnabled)