diff options
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/cldap/cldap.c | 83 | ||||
-rw-r--r-- | libcli/util/doserr.c | 3 | ||||
-rw-r--r-- | libcli/util/ntstatus.h | 4 | ||||
-rw-r--r-- | libcli/util/werror.h | 4 |
4 files changed, 47 insertions, 47 deletions
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c index d3fb0bb1e9..8a0c2eec5e 100644 --- a/libcli/cldap/cldap.c +++ b/libcli/cldap/cldap.c @@ -51,7 +51,7 @@ */ struct cldap_socket { /* the low level socket */ - struct tsocket_context *sock; + struct tdgram_context *sock; /* * Are we in connected mode, which means @@ -120,8 +120,6 @@ struct cldap_search_state { static int cldap_socket_destructor(struct cldap_socket *c) { - tsocket_disconnect(c->sock); - while (c->searches.list) { struct cldap_search_state *s = c->searches.list; DLIST_REMOVE(c->searches.list, s); @@ -146,7 +144,7 @@ static bool cldap_recvfrom_setup(struct cldap_socket *c) return true; } - c->recv_subreq = tsocket_recvfrom_send(c->sock, c); + c->recv_subreq = tdgram_recvfrom_send(c, c->event.ctx, c->sock); if (!c->recv_subreq) { return false; } @@ -186,11 +184,11 @@ static void cldap_recvfrom_done(struct tevent_req *subreq) goto nomem; } - ret = tsocket_recvfrom_recv(subreq, - &in->recv_errno, - in, - &in->buf, - &in->src); + ret = tdgram_recvfrom_recv(subreq, + &in->recv_errno, + in, + &in->buf, + &in->src); talloc_free(subreq); subreq = NULL; if (ret >= 0) { @@ -337,23 +335,15 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx, goto nomem; } - ret = tsocket_address_create_socket(local_addr, - TSOCKET_TYPE_DGRAM, - c, &c->sock); + ret = tdgram_inet_udp_socket(local_addr, remote_addr, + c, &c->sock); if (ret != 0) { status = map_nt_error_from_unix(errno); goto nterror; } talloc_free(any); - tsocket_set_event_context(c->sock, c->event.ctx); - if (remote_addr) { - ret = tsocket_connect(c->sock, remote_addr); - if (ret != 0) { - status = map_nt_error_from_unix(errno); - goto nterror; - } c->connected = true; } @@ -408,7 +398,7 @@ struct cldap_reply_state { DATA_BLOB blob; }; -static void cldap_reply_state_destroy(struct tevent_req *req); +static void cldap_reply_state_destroy(struct tevent_req *subreq); /* queue a cldap reply for send @@ -419,7 +409,7 @@ NTSTATUS cldap_reply_send(struct cldap_socket *cldap, struct cldap_reply *io) struct ldap_message *msg; DATA_BLOB blob1, blob2; NTSTATUS status; - struct tevent_req *req; + struct tevent_req *subreq; if (cldap->connected) { return NT_STATUS_PIPE_CONNECTED; @@ -476,17 +466,18 @@ NTSTATUS cldap_reply_send(struct cldap_socket *cldap, struct cldap_reply *io) data_blob_free(&blob1); data_blob_free(&blob2); - req = tsocket_sendto_queue_send(state, - cldap->sock, - cldap->send_queue, - state->blob.data, - state->blob.length, - state->dest); - if (!req) { + subreq = tdgram_sendto_queue_send(state, + cldap->event.ctx, + cldap->sock, + cldap->send_queue, + state->blob.data, + state->blob.length, + state->dest); + if (!subreq) { goto nomem; } /* the callback will just free the state, as we don't need a result */ - tevent_req_set_callback(req, cldap_reply_state_destroy, state); + tevent_req_set_callback(subreq, cldap_reply_state_destroy, state); return NT_STATUS_OK; @@ -497,13 +488,13 @@ failed: return status; } -static void cldap_reply_state_destroy(struct tevent_req *req) +static void cldap_reply_state_destroy(struct tevent_req *subreq) { - struct cldap_reply_state *state = tevent_req_callback_data(req, + struct cldap_reply_state *state = tevent_req_callback_data(subreq, struct cldap_reply_state); /* we don't want to know the result here, we just free the state */ - talloc_free(req); + talloc_free(subreq); talloc_free(state); } @@ -630,12 +621,13 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx, goto post; } - subreq = tsocket_sendto_queue_send(state, - state->caller.cldap->sock, - state->caller.cldap->send_queue, - state->request.blob.data, - state->request.blob.length, - state->request.dest); + subreq = tdgram_sendto_queue_send(state, + state->caller.cldap->event.ctx, + state->caller.cldap->sock, + state->caller.cldap->send_queue, + state->request.blob.data, + state->request.blob.length, + state->request.dest); if (tevent_req_nomem(subreq, req)) { goto post; } @@ -659,7 +651,7 @@ static void cldap_search_state_queue_done(struct tevent_req *subreq) int sys_errno = 0; struct timeval next; - ret = tsocket_sendto_queue_recv(subreq, &sys_errno); + ret = tdgram_sendto_queue_recv(subreq, &sys_errno); talloc_free(subreq); if (ret == -1) { NTSTATUS status; @@ -708,12 +700,13 @@ static void cldap_search_state_wakeup_done(struct tevent_req *subreq) return; } - subreq = tsocket_sendto_queue_send(state, - state->caller.cldap->sock, - state->caller.cldap->send_queue, - state->request.blob.data, - state->request.blob.length, - state->request.dest); + subreq = tdgram_sendto_queue_send(state, + state->caller.cldap->event.ctx, + state->caller.cldap->sock, + state->caller.cldap->send_queue, + state->request.blob.data, + state->request.blob.length, + state->request.dest); if (tevent_req_nomem(subreq, req)) { return; } diff --git a/libcli/util/doserr.c b/libcli/util/doserr.c index 1a7422e3f6..1151d3236b 100644 --- a/libcli/util/doserr.c +++ b/libcli/util/doserr.c @@ -168,7 +168,10 @@ static const struct werror_code_struct dos_errs[] = { "WERR_REG_FILE_INVALID", WERR_REG_FILE_INVALID }, { "WERR_NO_SUCH_SERVICE", WERR_NO_SUCH_SERVICE }, { "WERR_SERVICE_DISABLED", WERR_SERVICE_DISABLED }, + { "WERR_SERVICE_MARKED_FOR_DELETE", WERR_SERVICE_MARKED_FOR_DELETE }, + { "WERR_SERVICE_EXISTS", WERR_SERVICE_EXISTS }, { "WERR_SERVICE_NEVER_STARTED", WERR_SERVICE_NEVER_STARTED }, + { "WERR_DUPLICATE_SERVICE_NAME", WERR_DUPLICATE_SERVICE_NAME }, { "WERR_PASSWORD_MUST_CHANGE", WERR_PASSWORD_MUST_CHANGE }, { "WERR_ACCOUNT_LOCKED_OUT", WERR_ACCOUNT_LOCKED_OUT }, { "WERR_UNKNOWN_PRINT_MONITOR", WERR_UNKNOWN_PRINT_MONITOR }, diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h index 1608e2874f..a97ef5337e 100644 --- a/libcli/util/ntstatus.h +++ b/libcli/util/ntstatus.h @@ -60,8 +60,8 @@ typedef uint32_t NTSTATUS; #define ERROR_INSUFFICIENT_BUFFER NT_STATUS(0x007a) #define ERROR_INVALID_DATATYPE NT_STATUS(0x070c) -/* XXX Win7 Status code: Name unknown. */ -#define NT_STATUS_WIN7_INVALID_RANGE NT_STATUS(0xC0000000 | 0x01a1) +/* Win7 status codes. */ +#define NT_STATUS_INVALID_LOCK_RANGE NT_STATUS(0xC0000000 | 0x01a1) /* Win32 Error codes extracted using a loop in smbclient then printing a netmon sniff to a file. */ diff --git a/libcli/util/werror.h b/libcli/util/werror.h index a69587f361..2e6b696d3f 100644 --- a/libcli/util/werror.h +++ b/libcli/util/werror.h @@ -113,7 +113,10 @@ typedef uint32_t WERROR; #define WERR_INVALID_SERVICE_CONTROL W_ERROR(1052) #define WERR_SERVICE_ALREADY_RUNNING W_ERROR(1056) #define WERR_SERVICE_DISABLED W_ERROR(1058) +#define WERR_SERVICE_MARKED_FOR_DELETE W_ERROR(1072) +#define WERR_SERVICE_EXISTS W_ERROR(1073) #define WERR_SERVICE_NEVER_STARTED W_ERROR(1077) +#define WERR_DUPLICATE_SERVICE_NAME W_ERROR(1078) #define WERR_DEVICE_NOT_CONNECTED W_ERROR(1167) #define WERR_NOT_FOUND W_ERROR(1168) #define WERR_INVALID_COMPUTERNAME W_ERROR(1210) @@ -195,6 +198,7 @@ typedef uint32_t WERROR; /* Configuration Manager Errors */ /* Basically Win32 errors meanings are specific to the \ntsvcs pipe */ +#define WERR_CM_INVALID_POINTER W_ERROR(3) #define WERR_CM_BUFFER_SMALL W_ERROR(26) #define WERR_CM_NO_MORE_HW_PROFILES W_ERROR(35) #define WERR_CM_NO_SUCH_VALUE W_ERROR(37) |