summaryrefslogtreecommitdiff
path: root/source4/libcli/ldap
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2004-09-27 14:11:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:22 -0500
commit456e2f82e801cbc26898fad20c273b05248ee0d6 (patch)
treefe4a7a814571b96cbc104494122bf6df7b7eff55 /source4/libcli/ldap
parent718bb5e8ffb04ab48cb5e9c0a7df848212340a57 (diff)
downloadsamba-456e2f82e801cbc26898fad20c273b05248ee0d6.tar.gz
samba-456e2f82e801cbc26898fad20c273b05248ee0d6.tar.bz2
samba-456e2f82e801cbc26898fad20c273b05248ee0d6.zip
r2689: Use consistent naming Del -> Delete
Add delete functionality to ldb simple lda server backend add some const in ldap.h (This used to be commit 5ed9a6eb184f34eb572dd81202237042518ec7cd)
Diffstat (limited to 'source4/libcli/ldap')
-rw-r--r--source4/libcli/ldap/ldap.c26
-rw-r--r--source4/libcli/ldap/ldap.h11
-rw-r--r--source4/libcli/ldap/ldap_ldif.c7
3 files changed, 21 insertions, 23 deletions
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index af21962265..12842b4dc4 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -547,16 +547,16 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result)
ldap_encode_response(msg->type, r, &data);
break;
}
- case LDAP_TAG_DelRequest: {
- struct ldap_DelRequest *r = &msg->r.DelRequest;
+ case LDAP_TAG_DeleteRequest: {
+ struct ldap_DeleteRequest *r = &msg->r.DeleteRequest;
asn1_push_tag(&data,
- ASN1_APPLICATION_SIMPLE(LDAP_TAG_DelRequest));
+ ASN1_APPLICATION_SIMPLE(LDAP_TAG_DeleteRequest));
asn1_write(&data, r->dn, strlen(r->dn));
asn1_pop_tag(&data);
break;
}
- case LDAP_TAG_DelResponse: {
- struct ldap_Result *r = &msg->r.DelResponse;
+ case LDAP_TAG_DeleteResponse: {
+ struct ldap_Result *r = &msg->r.DeleteResponse;
ldap_encode_response(msg->type, r, &data);
break;
}
@@ -1009,13 +1009,13 @@ BOOL ldap_decode(ASN1_DATA *data, struct ldap_message *msg)
break;
}
- case ASN1_APPLICATION_SIMPLE(LDAP_TAG_DelRequest): {
- struct ldap_DelRequest *r = &msg->r.DelRequest;
+ case ASN1_APPLICATION_SIMPLE(LDAP_TAG_DeleteRequest): {
+ struct ldap_DeleteRequest *r = &msg->r.DeleteRequest;
int len;
char *dn;
- msg->type = LDAP_TAG_DelRequest;
+ msg->type = LDAP_TAG_DeleteRequest;
asn1_start_tag(data,
- ASN1_APPLICATION_SIMPLE(LDAP_TAG_DelRequest));
+ ASN1_APPLICATION_SIMPLE(LDAP_TAG_DeleteRequest));
len = asn1_tag_remaining(data);
dn = talloc(msg->mem_ctx, len+1);
if (dn == NULL)
@@ -1027,11 +1027,11 @@ BOOL ldap_decode(ASN1_DATA *data, struct ldap_message *msg)
break;
}
- case ASN1_APPLICATION(LDAP_TAG_DelResponse): {
- struct ldap_Result *r = &msg->r.DelResponse;
- msg->type = LDAP_TAG_DelResponse;
+ case ASN1_APPLICATION(LDAP_TAG_DeleteResponse): {
+ struct ldap_Result *r = &msg->r.DeleteResponse;
+ msg->type = LDAP_TAG_DeleteResponse;
ldap_decode_response(msg->mem_ctx, data,
- LDAP_TAG_DelResponse, r);
+ LDAP_TAG_DeleteResponse, r);
break;
}
diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h
index 449be9e015..cda065ce6e 100644
--- a/source4/libcli/ldap/ldap.h
+++ b/source4/libcli/ldap/ldap.h
@@ -33,8 +33,8 @@ enum ldap_request_tag {
LDAP_TAG_ModifyResponse = 7,
LDAP_TAG_AddRequest = 8,
LDAP_TAG_AddResponse = 9,
- LDAP_TAG_DelRequest = 10,
- LDAP_TAG_DelResponse = 11,
+ LDAP_TAG_DeleteRequest = 10,
+ LDAP_TAG_DeleteResponse = 11,
LDAP_TAG_ModifyDNRequest = 12,
LDAP_TAG_ModifyDNResponse = 13,
LDAP_TAG_CompareRequest = 14,
@@ -53,6 +53,7 @@ enum ldap_auth_mechanism {
enum ldap_result_code {
LDAP_SUCCESS = 0,
LDAP_SASL_BIND_IN_PROGRESS = 0x0e,
+ LDAP_NO_SUCH_OBJECT = 0x20,
LDAP_INVALID_CREDENTIALS = 0x31,
LDAP_OTHER = 0x50
};
@@ -154,7 +155,7 @@ struct ldap_AddRequest {
struct ldap_attribute *attributes;
};
-struct ldap_DelRequest {
+struct ldap_DeleteRequest {
const char *dn;
};
@@ -198,8 +199,8 @@ union ldap_Request {
struct ldap_Result ModifyResponse;
struct ldap_AddRequest AddRequest;
struct ldap_Result AddResponse;
- struct ldap_DelRequest DelRequest;
- struct ldap_Result DelResponse;
+ struct ldap_DeleteRequest DeleteRequest;
+ struct ldap_Result DeleteResponse;
struct ldap_ModifyDNRequest ModifyDNRequest;
struct ldap_Result ModifyDNResponse;
struct ldap_CompareRequest CompareRequest;
diff --git a/source4/libcli/ldap/ldap_ldif.c b/source4/libcli/ldap/ldap_ldif.c
index 8fe50b6d08..df912c038a 100644
--- a/source4/libcli/ldap/ldap_ldif.c
+++ b/source4/libcli/ldap/ldap_ldif.c
@@ -3,9 +3,6 @@
LDAP protocol helper functions for SAMBA
Copyright (C) Andrew Tridgell 2004
- Copyright (C) Volker Lendecke 2004
- Copyright (C) Stefan Metzmacher 2004
- Copyright (C) Simo Sorce 2004
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -352,8 +349,8 @@ static struct ldap_message *ldif_read(int (*fgetc_fn)(void *),
}
if (strequal(value.data, "delete")) {
- msg->type = LDAP_TAG_DelRequest;
- msg->r.DelRequest.dn = dn;
+ msg->type = LDAP_TAG_DeleteRequest;
+ msg->r.DeleteRequest.dn = dn;
return msg;
}