summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/cldap/cldap.c12
-rw-r--r--source4/libcli/cldap/cldap.h6
-rw-r--r--source4/libcli/clilist.c8
-rw-r--r--source4/libcli/composite/composite.c6
-rw-r--r--source4/libcli/config.mk2
-rw-r--r--source4/libcli/dgram/dgramsocket.c8
-rw-r--r--source4/libcli/dgram/libdgram.h10
-rw-r--r--source4/libcli/dgram/mailslot.c8
-rw-r--r--source4/libcli/finddcs.c2
-rw-r--r--source4/libcli/ldap/config.mk2
-rw-r--r--source4/libcli/ldap/ldap.h43
-rw-r--r--source4/libcli/ldap/ldap_errors.h66
-rw-r--r--source4/libcli/raw/clioplock.c4
-rw-r--r--source4/libcli/raw/clitransport.c34
-rw-r--r--source4/libcli/raw/interfaces.h2
-rw-r--r--source4/libcli/raw/libcliraw.h14
-rw-r--r--source4/libcli/raw/rawrequest.c2
-rw-r--r--source4/libcli/raw/rawsearch.c28
-rw-r--r--source4/libcli/resolve/dns_ex.c5
-rw-r--r--source4/libcli/security/config.mk4
-rw-r--r--source4/libcli/security/dom_sid.c306
-rw-r--r--source4/libcli/security/security.h3
-rw-r--r--source4/libcli/security/security_token.c1
-rw-r--r--source4/libcli/smb2/getinfo.c11
-rw-r--r--source4/libcli/smb2/smb2.h2
-rw-r--r--source4/libcli/smb2/transport.c28
-rw-r--r--source4/libcli/smb_composite/appendacl.c12
-rw-r--r--source4/libcli/smb_composite/connect.c10
-rw-r--r--source4/libcli/smb_composite/fsinfo.c4
-rw-r--r--source4/libcli/smb_composite/loadfile.c10
-rw-r--r--source4/libcli/smb_composite/savefile.c10
-rw-r--r--source4/libcli/smb_composite/sesssetup.c2
-rw-r--r--source4/libcli/util/nterr.c2
-rw-r--r--source4/libcli/wbclient/wbclient.c4
-rw-r--r--source4/libcli/wrepl/winsrepl.c12
-rw-r--r--source4/libcli/wrepl/winsrepl.h2
36 files changed, 205 insertions, 480 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index 556f9bcec3..8d2e2e374c 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -146,9 +146,9 @@ static void cldap_socket_recv(struct cldap_socket *cldap)
*/
static void cldap_request_timeout(struct tevent_context *event_ctx,
struct tevent_timer *te, struct timeval t,
- void *private)
+ void *private_data)
{
- struct cldap_request *req = talloc_get_type(private, struct cldap_request);
+ struct cldap_request *req = talloc_get_type(private_data, struct cldap_request);
/* possibly try again */
if (req->num_retries != 0) {
@@ -224,9 +224,9 @@ static void cldap_socket_send(struct cldap_socket *cldap)
handle fd events on a cldap_socket
*/
static void cldap_socket_handler(struct tevent_context *ev, struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct cldap_socket *cldap = talloc_get_type(private, struct cldap_socket);
+ struct cldap_socket *cldap = talloc_get_type(private_data, struct cldap_socket);
if (flags & EVENT_FD_WRITE) {
cldap_socket_send(cldap);
}
@@ -282,10 +282,10 @@ failed:
NTSTATUS cldap_set_incoming_handler(struct cldap_socket *cldap,
void (*handler)(struct cldap_socket *, struct ldap_message *,
struct socket_address *),
- void *private)
+ void *private_data)
{
cldap->incoming.handler = handler;
- cldap->incoming.private = private;
+ cldap->incoming.private_data = private_data;
EVENT_FD_READABLE(cldap->fde);
return NT_STATUS_OK;
}
diff --git a/source4/libcli/cldap/cldap.h b/source4/libcli/cldap/cldap.h
index 17e88716c5..8951daa775 100644
--- a/source4/libcli/cldap/cldap.h
+++ b/source4/libcli/cldap/cldap.h
@@ -63,7 +63,7 @@ struct cldap_request {
/* information on what to do on completion */
struct {
void (*fn)(struct cldap_request *);
- void *private;
+ void *private_data;
} async;
};
@@ -88,7 +88,7 @@ struct cldap_socket {
struct {
void (*handler)(struct cldap_socket *, struct ldap_message *,
struct socket_address *);
- void *private;
+ void *private_data;
} incoming;
};
@@ -117,7 +117,7 @@ struct cldap_socket *cldap_socket_init(TALLOC_CTX *mem_ctx,
NTSTATUS cldap_set_incoming_handler(struct cldap_socket *cldap,
void (*handler)(struct cldap_socket *, struct ldap_message *,
struct socket_address *),
- void *private);
+ void *private_data);
struct cldap_request *cldap_search_send(struct cldap_socket *cldap,
struct cldap_search *io);
NTSTATUS cldap_search_recv(struct cldap_request *req, TALLOC_CTX *mem_ctx,
diff --git a/source4/libcli/clilist.c b/source4/libcli/clilist.c
index 5d43606c61..65ee0a8303 100644
--- a/source4/libcli/clilist.c
+++ b/source4/libcli/clilist.c
@@ -73,9 +73,9 @@ static bool interpret_long_filename(enum smb_search_data_level level,
}
/* callback function used for trans2 search */
-static bool smbcli_list_new_callback(void *private, const union smb_search_data *file)
+static bool smbcli_list_new_callback(void *private_data, const union smb_search_data *file)
{
- struct search_private *state = (struct search_private*) private;
+ struct search_private *state = (struct search_private*) private_data;
struct clilist_file_info *tdl;
/* add file info to the dirlist pool */
@@ -231,9 +231,9 @@ static bool interpret_short_filename(enum smb_search_data_level level,
}
/* callback function used for smb_search */
-static bool smbcli_list_old_callback(void *private, const union smb_search_data *file)
+static bool smbcli_list_old_callback(void *private_data, const union smb_search_data *file)
{
- struct search_private *state = (struct search_private*) private;
+ struct search_private *state = (struct search_private*) private_data;
struct clilist_file_info *tdl;
/* add file info to the dirlist pool */
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index aff8f79481..ab32175d00 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -86,7 +86,7 @@ _PUBLIC_ NTSTATUS composite_wait_free(struct composite_context *c)
this is used to allow for a composite function to complete without
going through any state transitions. When that happens the caller
has had no opportunity to fill in the async callback fields
- (ctx->async.fn and ctx->async.private) which means the usual way of
+ (ctx->async.fn and ctx->async.private_data) which means the usual way of
dealing with composite functions doesn't work. To cope with this,
we trigger a timer event that will happen then the event loop is
re-entered. This gives the caller a chance to setup the callback,
@@ -184,7 +184,7 @@ _PUBLIC_ void composite_continue_irpc(struct composite_context *ctx,
{
if (composite_nomem(new_req, ctx)) return;
new_req->async.fn = continuation;
- new_req->async.private = private_data;
+ new_req->async.private_data = private_data;
}
_PUBLIC_ void composite_continue_smb(struct composite_context *ctx,
@@ -194,7 +194,7 @@ _PUBLIC_ void composite_continue_smb(struct composite_context *ctx,
{
if (composite_nomem(new_req, ctx)) return;
new_req->async.fn = continuation;
- new_req->async.private = private_data;
+ new_req->async.private_data = private_data;
}
_PUBLIC_ void composite_continue_smb2(struct composite_context *ctx,
diff --git a/source4/libcli/config.mk b/source4/libcli/config.mk
index 60baf83c8e..dc3431ab9f 100644
--- a/source4/libcli/config.mk
+++ b/source4/libcli/config.mk
@@ -87,8 +87,6 @@ PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-HOSTCONFIG
python_netbios_OBJ_FILES = $(libclinbtsrcdir)/pynbt.o
-$(python_libcli_nbt_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
-
[SUBSYSTEM::LIBCLI_DGRAM]
PUBLIC_DEPENDENCIES = LIBCLI_NBT LIBNDR LIBCLI_RESOLVE LIBCLI_NETLOGON
diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c
index 5c878f19fa..751706d2c5 100644
--- a/source4/libcli/dgram/dgramsocket.c
+++ b/source4/libcli/dgram/dgramsocket.c
@@ -140,9 +140,9 @@ static void dgm_socket_send(struct nbt_dgram_socket *dgmsock)
handle fd events on a nbt_dgram_socket
*/
static void dgm_socket_handler(struct tevent_context *ev, struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct nbt_dgram_socket *dgmsock = talloc_get_type(private,
+ struct nbt_dgram_socket *dgmsock = talloc_get_type(private_data,
struct nbt_dgram_socket);
if (flags & EVENT_FD_WRITE) {
dgm_socket_send(dgmsock);
@@ -200,10 +200,10 @@ NTSTATUS dgram_set_incoming_handler(struct nbt_dgram_socket *dgmsock,
void (*handler)(struct nbt_dgram_socket *,
struct nbt_dgram_packet *,
struct socket_address *),
- void *private)
+ void *private_data)
{
dgmsock->incoming.handler = handler;
- dgmsock->incoming.private = private;
+ dgmsock->incoming.private_data = private_data;
EVENT_FD_READABLE(dgmsock->fde);
return NT_STATUS_OK;
}
diff --git a/source4/libcli/dgram/libdgram.h b/source4/libcli/dgram/libdgram.h
index 8060d8cf53..a17a6042d9 100644
--- a/source4/libcli/dgram/libdgram.h
+++ b/source4/libcli/dgram/libdgram.h
@@ -55,7 +55,7 @@ struct nbt_dgram_socket {
struct {
void (*handler)(struct nbt_dgram_socket *, struct nbt_dgram_packet *,
struct socket_address *src);
- void *private;
+ void *private_data;
} incoming;
};
@@ -79,7 +79,7 @@ struct dgram_mailslot_handler {
const char *mailslot_name;
dgram_mailslot_handler_t handler;
- void *private;
+ void *private_data;
};
@@ -91,7 +91,7 @@ NTSTATUS dgram_set_incoming_handler(struct nbt_dgram_socket *dgmsock,
void (*handler)(struct nbt_dgram_socket *,
struct nbt_dgram_packet *,
struct socket_address *),
- void *private);
+ void *private_data);
struct nbt_dgram_socket *nbt_dgram_socket_init(TALLOC_CTX *mem_ctx,
struct tevent_context *event_ctx,
struct smb_iconv_convenience *);
@@ -102,11 +102,11 @@ struct dgram_mailslot_handler *dgram_mailslot_find(struct nbt_dgram_socket *dgms
struct dgram_mailslot_handler *dgram_mailslot_listen(struct nbt_dgram_socket *dgmsock,
const char *mailslot_name,
dgram_mailslot_handler_t handler,
- void *private);
+ void *private_data);
struct dgram_mailslot_handler *dgram_mailslot_temp(struct nbt_dgram_socket *dgmsock,
const char *mailslot_name,
dgram_mailslot_handler_t handler,
- void *private);
+ void *private_data);
DATA_BLOB dgram_mailslot_data(struct nbt_dgram_packet *dgram);
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c
index 3bd587aa54..261946e458 100644
--- a/source4/libcli/dgram/mailslot.c
+++ b/source4/libcli/dgram/mailslot.c
@@ -52,7 +52,7 @@ static int dgram_mailslot_destructor(struct dgram_mailslot_handler *dgmslot)
struct dgram_mailslot_handler *dgram_mailslot_listen(struct nbt_dgram_socket *dgmsock,
const char *mailslot_name,
dgram_mailslot_handler_t handler,
- void *private)
+ void *private_data)
{
struct dgram_mailslot_handler *dgmslot;
@@ -66,7 +66,7 @@ struct dgram_mailslot_handler *dgram_mailslot_listen(struct nbt_dgram_socket *dg
return NULL;
}
dgmslot->handler = handler;
- dgmslot->private = private;
+ dgmslot->private_data = private_data;
DLIST_ADD(dgmsock->mailslot_handlers, dgmslot);
talloc_set_destructor(dgmslot, dgram_mailslot_destructor);
@@ -115,7 +115,7 @@ const char *dgram_mailslot_name(struct nbt_dgram_packet *packet)
struct dgram_mailslot_handler *dgram_mailslot_temp(struct nbt_dgram_socket *dgmsock,
const char *mailslot_name,
dgram_mailslot_handler_t handler,
- void *private)
+ void *private_data)
{
char *name;
int i;
@@ -131,7 +131,7 @@ struct dgram_mailslot_handler *dgram_mailslot_temp(struct nbt_dgram_socket *dgms
talloc_free(name);
return NULL;
}
- dgmslot = dgram_mailslot_listen(dgmsock, name, handler, private);
+ dgmslot = dgram_mailslot_listen(dgmsock, name, handler, private_data);
talloc_free(name);
if (dgmslot != NULL) {
return dgmslot;
diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c
index 6e531391a6..2e4fad9332 100644
--- a/source4/libcli/finddcs.c
+++ b/source4/libcli/finddcs.c
@@ -174,7 +174,7 @@ static void finddcs_name_resolved(struct composite_context *ctx)
static void finddcs_getdc_replied(struct irpc_request *ireq)
{
struct finddcs_state *state =
- talloc_get_type(ireq->async.private, struct finddcs_state);
+ talloc_get_type(ireq->async.private_data, struct finddcs_state);
state->ctx->status = irpc_call_recv(ireq);
if (!composite_is_ok(state->ctx)) return;
diff --git a/source4/libcli/ldap/config.mk b/source4/libcli/ldap/config.mk
index 11157c5b63..2708c66b68 100644
--- a/source4/libcli/ldap/config.mk
+++ b/source4/libcli/ldap/config.mk
@@ -13,6 +13,6 @@ PUBLIC_HEADERS += $(libclisrcdir)/ldap/ldap.h $(libclisrcdir)/ldap/ldap_ndr.h
$(eval $(call proto_header_template,$(libclisrcdir)/ldap/ldap_proto.h,$(LIBCLI_LDAP_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LDAP_ENCODE]
-# FIXME PRIVATE_DEPENDENCIES = LIBLDB
+PRIVATE_DEPENDENCIES = LIBLDB
LDAP_ENCODE_OBJ_FILES = $(libclisrcdir)/ldap/ldap_ndr.o
diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h
index 5538c9dc06..abb4617c48 100644
--- a/source4/libcli/ldap/ldap.h
+++ b/source4/libcli/ldap/ldap.h
@@ -21,6 +21,7 @@
#ifndef _SMB_LDAP_H_
#define _SMB_LDAP_H_
+#include "libcli/ldap/ldap_errors.h"
#include "lib/ldb/include/ldb.h"
#include "librpc/gen_ndr/misc.h"
@@ -52,48 +53,6 @@ enum ldap_auth_mechanism {
LDAP_AUTH_MECH_SASL = 3
};
-enum ldap_result_code {
- LDAP_SUCCESS = 0,
- LDAP_OPERATIONS_ERROR = 1,
- LDAP_PROTOCOL_ERROR = 2,
- LDAP_TIME_LIMIT_EXCEEDED = 3,
- LDAP_SIZE_LIMIT_EXCEEDED = 4,
- LDAP_COMPARE_FALSE = 5,
- LDAP_COMPARE_TRUE = 6,
- LDAP_AUTH_METHOD_NOT_SUPPORTED = 7,
- LDAP_STRONG_AUTH_REQUIRED = 8,
- LDAP_REFERRAL = 10,
- LDAP_ADMIN_LIMIT_EXCEEDED = 11,
- LDAP_UNAVAILABLE_CRITICAL_EXTENSION = 12,
- LDAP_CONFIDENTIALITY_REQUIRED = 13,
- LDAP_SASL_BIND_IN_PROGRESS = 14,
- LDAP_NO_SUCH_ATTRIBUTE = 16,
- LDAP_UNDEFINED_ATTRIBUTE_TYPE = 17,
- LDAP_INAPPROPRIATE_MATCHING = 18,
- LDAP_CONSTRAINT_VIOLATION = 19,
- LDAP_ATTRIBUTE_OR_VALUE_EXISTS = 20,
- LDAP_INVALID_ATTRIBUTE_SYNTAX = 21,
- LDAP_NO_SUCH_OBJECT = 32,
- LDAP_ALIAS_PROBLEM = 33,
- LDAP_INVALID_DN_SYNTAX = 34,
- LDAP_ALIAS_DEREFERENCING_PROBLEM = 36,
- LDAP_INAPPROPRIATE_AUTHENTICATION = 48,
- LDAP_INVALID_CREDENTIALS = 49,
- LDAP_INSUFFICIENT_ACCESS_RIGHTS = 50,
- LDAP_BUSY = 51,
- LDAP_UNAVAILABLE = 52,
- LDAP_UNWILLING_TO_PERFORM = 53,
- LDAP_LOOP_DETECT = 54,
- LDAP_NAMING_VIOLATION = 64,
- LDAP_OBJECT_CLASS_VIOLATION = 65,
- LDAP_NOT_ALLOWED_ON_NON_LEAF = 66,
- LDAP_NOT_ALLOWED_ON_RDN = 67,
- LDAP_ENTRY_ALREADY_EXISTS = 68,
- LDAP_OBJECT_CLASS_MODS_PROHIBITED = 69,
- LDAP_AFFECTS_MULTIPLE_DSAS = 71,
- LDAP_OTHER = 80
-};
-
struct ldap_Result {
int resultcode;
const char *dn;
diff --git a/source4/libcli/ldap/ldap_errors.h b/source4/libcli/ldap/ldap_errors.h
new file mode 100644
index 0000000000..17ac43814c
--- /dev/null
+++ b/source4/libcli/ldap/ldap_errors.h
@@ -0,0 +1,66 @@
+/*
+ Unix SMB/CIFS Implementation.
+ LDAP protocol helper functions for SAMBA
+ Copyright (C) Volker Lendecke 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
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef _SMB_LDAP_ERRORS_H_
+#define _SMB_LDAP_ERRORS_H_
+
+enum ldap_result_code {
+ LDAP_SUCCESS = 0,
+ LDAP_OPERATIONS_ERROR = 1,
+ LDAP_PROTOCOL_ERROR = 2,
+ LDAP_TIME_LIMIT_EXCEEDED = 3,
+ LDAP_SIZE_LIMIT_EXCEEDED = 4,
+ LDAP_COMPARE_FALSE = 5,
+ LDAP_COMPARE_TRUE = 6,
+ LDAP_AUTH_METHOD_NOT_SUPPORTED = 7,
+ LDAP_STRONG_AUTH_REQUIRED = 8,
+ LDAP_REFERRAL = 10,
+ LDAP_ADMIN_LIMIT_EXCEEDED = 11,
+ LDAP_UNAVAILABLE_CRITICAL_EXTENSION = 12,
+ LDAP_CONFIDENTIALITY_REQUIRED = 13,
+ LDAP_SASL_BIND_IN_PROGRESS = 14,
+ LDAP_NO_SUCH_ATTRIBUTE = 16,
+ LDAP_UNDEFINED_ATTRIBUTE_TYPE = 17,
+ LDAP_INAPPROPRIATE_MATCHING = 18,
+ LDAP_CONSTRAINT_VIOLATION = 19,
+ LDAP_ATTRIBUTE_OR_VALUE_EXISTS = 20,
+ LDAP_INVALID_ATTRIBUTE_SYNTAX = 21,
+ LDAP_NO_SUCH_OBJECT = 32,
+ LDAP_ALIAS_PROBLEM = 33,
+ LDAP_INVALID_DN_SYNTAX = 34,
+ LDAP_ALIAS_DEREFERENCING_PROBLEM = 36,
+ LDAP_INAPPROPRIATE_AUTHENTICATION = 48,
+ LDAP_INVALID_CREDENTIALS = 49,
+ LDAP_INSUFFICIENT_ACCESS_RIGHTS = 50,
+ LDAP_BUSY = 51,
+ LDAP_UNAVAILABLE = 52,
+ LDAP_UNWILLING_TO_PERFORM = 53,
+ LDAP_LOOP_DETECT = 54,
+ LDAP_NAMING_VIOLATION = 64,
+ LDAP_OBJECT_CLASS_VIOLATION = 65,
+ LDAP_NOT_ALLOWED_ON_NON_LEAF = 66,
+ LDAP_NOT_ALLOWED_ON_RDN = 67,
+ LDAP_ENTRY_ALREADY_EXISTS = 68,
+ LDAP_OBJECT_CLASS_MODS_PROHIBITED = 69,
+ LDAP_AFFECTS_MULTIPLE_DSAS = 71,
+ LDAP_OTHER = 80
+};
+
+#endif /* _SMB_LDAP_ERRORS_H_ */
diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c
index 47ffb6dd31..42ac6b517b 100644
--- a/source4/libcli/raw/clioplock.c
+++ b/source4/libcli/raw/clioplock.c
@@ -55,8 +55,8 @@ set the oplock handler for a connection
****************************************************************************/
_PUBLIC_ void smbcli_oplock_handler(struct smbcli_transport *transport,
bool (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *),
- void *private)
+ void *private_data)
{
transport->oplock.handler = handler;
- transport->oplock.private = private;
+ transport->oplock.private_data = private_data;
}
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 22e2552edc..5cf0272e88 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -35,9 +35,9 @@
*/
static void smbcli_transport_event_handler(struct tevent_context *ev,
struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct smbcli_transport *transport = talloc_get_type(private,
+ struct smbcli_transport *transport = talloc_get_type(private_data,
struct smbcli_transport);
if (flags & EVENT_FD_READ) {
packet_recv(transport->packet);
@@ -61,13 +61,13 @@ static int transport_destructor(struct smbcli_transport *transport)
/*
handle receive errors
*/
-static void smbcli_transport_error(void *private, NTSTATUS status)
+static void smbcli_transport_error(void *private_data, NTSTATUS status)
{
- struct smbcli_transport *transport = talloc_get_type(private, struct smbcli_transport);
+ struct smbcli_transport *transport = talloc_get_type(private_data, struct smbcli_transport);
smbcli_transport_dead(transport, status);
}
-static NTSTATUS smbcli_transport_finish_recv(void *private, DATA_BLOB blob);
+static NTSTATUS smbcli_transport_finish_recv(void *private_data, DATA_BLOB blob);
/*
create a transport structure based on an established socket
@@ -308,16 +308,16 @@ again:
}
static void idle_handler(struct tevent_context *ev,
- struct tevent_timer *te, struct timeval t, void *private)
+ struct tevent_timer *te, struct timeval t, void *private_data)
{
- struct smbcli_transport *transport = talloc_get_type(private,
+ struct smbcli_transport *transport = talloc_get_type(private_data,
struct smbcli_transport);
struct timeval next = timeval_add(&t, 0, transport->idle.period);
transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
transport,
next,
idle_handler, transport);
- transport->idle.func(transport, transport->idle.private);
+ transport->idle.func(transport, transport->idle.private_data);
}
/*
@@ -327,10 +327,10 @@ static void idle_handler(struct tevent_context *ev,
_PUBLIC_ void smbcli_transport_idle_handler(struct smbcli_transport *transport,
void (*idle_func)(struct smbcli_transport *, void *),
uint64_t period,
- void *private)
+ void *private_data)
{
transport->idle.func = idle_func;
- transport->idle.private = private;
+ transport->idle.private_data = private_data;
transport->idle.period = period;
if (transport->socket->event.te != NULL) {
@@ -347,9 +347,9 @@ _PUBLIC_ void smbcli_transport_idle_handler(struct smbcli_transport *transport,
we have a full request in our receive buffer - match it to a pending request
and process
*/
-static NTSTATUS smbcli_transport_finish_recv(void *private, DATA_BLOB blob)
+static NTSTATUS smbcli_transport_finish_recv(void *private_data, DATA_BLOB blob)
{
- struct smbcli_transport *transport = talloc_get_type(private,
+ struct smbcli_transport *transport = talloc_get_type(private_data,
struct smbcli_transport);
uint8_t *buffer, *hdr, *vwv;
int len;
@@ -450,12 +450,12 @@ static NTSTATUS smbcli_transport_finish_recv(void *private, DATA_BLOB blob)
smb_setup_bufinfo(req);
if (!(req->flags2 & FLAGS2_32_BIT_ERROR_CODES)) {
- int class = CVAL(req->in.hdr,HDR_RCLS);
+ int eclass = CVAL(req->in.hdr,HDR_RCLS);
int code = SVAL(req->in.hdr,HDR_ERR);
- if (class == 0 && code == 0) {
+ if (eclass == 0 && code == 0) {
transport->error.e.nt_status = NT_STATUS_OK;
} else {
- transport->error.e.nt_status = NT_STATUS_DOS(class, code);
+ transport->error.e.nt_status = NT_STATUS_DOS(eclass, code);
}
} else {
transport->error.e.nt_status = NT_STATUS(IVAL(req->in.hdr, HDR_RCLS));
@@ -542,9 +542,9 @@ _PUBLIC_ bool smbcli_transport_process(struct smbcli_transport *transport)
handle timeouts of individual smb requests
*/
static void smbcli_timeout_handler(struct tevent_context *ev, struct tevent_timer *te,
- struct timeval t, void *private)
+ struct timeval t, void *private_data)
{
- struct smbcli_request *req = talloc_get_type(private, struct smbcli_request);
+ struct smbcli_request *req = talloc_get_type(private_data, struct smbcli_request);
if (req->state == SMBCLI_REQUEST_RECV) {
DLIST_REMOVE(req->transport->pending_recv, req);
diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h
index c2269cbbc2..a0584c0aa4 100644
--- a/source4/libcli/raw/interfaces.h
+++ b/source4/libcli/raw/interfaces.h
@@ -2698,7 +2698,7 @@ union smb_search_data {
};
/* Callback function passed to the raw search interface. */
-typedef bool (*smbcli_search_callback)(void *private, const union smb_search_data *file);
+typedef bool (*smbcli_search_callback)(void *private_data, const union smb_search_data *file);
enum smb_search_close_level {RAW_FINDCLOSE_GENERIC, RAW_FINDCLOSE_FCLOSE, RAW_FINDCLOSE_FINDCLOSE};
diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h
index 0ab6f5650c..a9fcdab9cc 100644
--- a/source4/libcli/raw/libcliraw.h
+++ b/source4/libcli/raw/libcliraw.h
@@ -128,7 +128,7 @@ struct smbcli_transport {
for a packet */
struct {
void (*func)(struct smbcli_transport *, void *);
- void *private;
+ void *private_data;
uint_t period;
} idle;
@@ -149,9 +149,9 @@ struct smbcli_transport {
struct {
/* a oplock break request handler */
bool (*handler)(struct smbcli_transport *transport,
- uint16_t tid, uint16_t fnum, uint8_t level, void *private);
+ uint16_t tid, uint16_t fnum, uint8_t level, void *private_data);
/* private data passed to the oplock handler */
- void *private;
+ void *private_data;
} oplock;
/* a list of async requests that are pending for receive on this connection */
@@ -286,7 +286,7 @@ struct smbcli_request {
*/
struct {
void (*fn)(struct smbcli_request *);
- void *private;
+ void *private_data;
} async;
};
@@ -328,11 +328,11 @@ struct smbcli_tree *smbcli_tree_init(struct smbcli_session *session, TALLOC_CTX
NTSTATUS smb_raw_tcon(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_tcon *parms);
void smbcli_oplock_handler(struct smbcli_transport *transport,
bool (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *),
- void *private);
+ void *private_data);
void smbcli_transport_idle_handler(struct smbcli_transport *transport,
void (*idle_func)(struct smbcli_transport *, void *),
uint64_t period,
- void *private);
+ void *private_data);
NTSTATUS smbcli_request_simple_recv(struct smbcli_request *req);
bool smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level);
NTSTATUS smb_raw_open(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_open *parms);
@@ -366,7 +366,7 @@ struct smbcli_request *smb_raw_echo_send(struct smbcli_transport *transport,
struct smb_echo *p);
NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
- union smb_search_first *io, void *private,
+ union smb_search_first *io, void *private_data,
smbcli_search_callback callback);
NTSTATUS smb_raw_flush(struct smbcli_tree *tree, union smb_flush *parms);
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index a257e3d0f1..029d56428d 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -388,7 +388,7 @@ bool smbcli_handle_oplock_break(struct smbcli_transport *transport, uint_t len,
uint16_t tid = SVAL(hdr, HDR_TID);
uint16_t fnum = SVAL(vwv,VWV(2));
uint8_t level = CVAL(vwv,VWV(3)+1);
- transport->oplock.handler(transport, tid, fnum, level, transport->oplock.private);
+ transport->oplock.handler(transport, tid, fnum, level, transport->oplock.private_data);
}
return true;
diff --git a/source4/libcli/raw/rawsearch.c b/source4/libcli/raw/rawsearch.c
index 99141574e2..9c90d45492 100644
--- a/source4/libcli/raw/rawsearch.c
+++ b/source4/libcli/raw/rawsearch.c
@@ -28,7 +28,7 @@
static void smb_raw_search_backend(struct smbcli_request *req,
TALLOC_CTX *mem_ctx,
uint16_t count,
- void *private,
+ void *private_data,
smbcli_search_callback callback)
{
@@ -57,7 +57,7 @@ static void smb_raw_search_backend(struct smbcli_request *req,
search_data.search.size = IVAL(p, 26);
smbcli_req_pull_ascii(&req->in.bufinfo, mem_ctx, &name, p+30, 13, STR_ASCII);
search_data.search.name = name;
- if (!callback(private, &search_data)) {
+ if (!callback(private_data, &search_data)) {
break;
}
p += 43;
@@ -69,7 +69,7 @@ static void smb_raw_search_backend(struct smbcli_request *req,
****************************************************************************/
static NTSTATUS smb_raw_search_first_old(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
- union smb_search_first *io, void *private,
+ union smb_search_first *io, void *private_data,
smbcli_search_callback callback)
{
@@ -99,7 +99,7 @@ static NTSTATUS smb_raw_search_first_old(struct smbcli_tree *tree,
if (NT_STATUS_IS_OK(req->status)) {
io->search_first.out.count = SVAL(req->in.vwv, VWV(0));
- smb_raw_search_backend(req, mem_ctx, io->search_first.out.count, private, callback);
+ smb_raw_search_backend(req, mem_ctx, io->search_first.out.count, private_data, callback);
}
return smbcli_request_destroy(req);
@@ -110,7 +110,7 @@ static NTSTATUS smb_raw_search_first_old(struct smbcli_tree *tree,
****************************************************************************/
static NTSTATUS smb_raw_search_next_old(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
- union smb_search_next *io, void *private,
+ union smb_search_next *io, void *private_data,
smbcli_search_callback callback)
{
@@ -146,7 +146,7 @@ static NTSTATUS smb_raw_search_next_old(struct smbcli_tree *tree,
if (NT_STATUS_IS_OK(req->status)) {
io->search_next.out.count = SVAL(req->in.vwv, VWV(0));
- smb_raw_search_backend(req, mem_ctx, io->search_next.out.count, private, callback);
+ smb_raw_search_backend(req, mem_ctx, io->search_next.out.count, private_data, callback);
}
return smbcli_request_destroy(req);
@@ -682,7 +682,7 @@ static NTSTATUS smb_raw_t2search_backend(struct smbcli_tree *tree,
uint16_t flags,
int16_t count,
DATA_BLOB *blob,
- void *private,
+ void *private_data,
smbcli_search_callback callback)
{
@@ -703,7 +703,7 @@ static NTSTATUS smb_raw_t2search_backend(struct smbcli_tree *tree,
/* the callback function can tell us that no more will
fit - in that case we stop, but it isn't an error */
- if (!callback(private, &search_data)) {
+ if (!callback(private_data, &search_data)) {
break;
}
@@ -721,7 +721,7 @@ static NTSTATUS smb_raw_t2search_backend(struct smbcli_tree *tree,
*/
_PUBLIC_ NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
- union smb_search_first *io, void *private,
+ union smb_search_first *io, void *private_data,
smbcli_search_callback callback)
{
DATA_BLOB p_blob, d_blob;
@@ -731,7 +731,7 @@ _PUBLIC_ NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
case RAW_SEARCH_SEARCH:
case RAW_SEARCH_FFIRST:
case RAW_SEARCH_FUNIQUE:
- return smb_raw_search_first_old(tree, mem_ctx, io, private, callback);
+ return smb_raw_search_first_old(tree, mem_ctx, io, private_data, callback);
case RAW_SEARCH_TRANS2:
break;
@@ -760,7 +760,7 @@ _PUBLIC_ NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
status = smb_raw_t2search_backend(tree, mem_ctx,
io->generic.data_level,
io->t2ffirst.in.flags, io->t2ffirst.out.count,
- &d_blob, private, callback);
+ &d_blob, private_data, callback);
return status;
}
@@ -769,7 +769,7 @@ _PUBLIC_ NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
*/
NTSTATUS smb_raw_search_next(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
- union smb_search_next *io, void *private,
+ union smb_search_next *io, void *private_data,
smbcli_search_callback callback)
{
DATA_BLOB p_blob, d_blob;
@@ -778,7 +778,7 @@ NTSTATUS smb_raw_search_next(struct smbcli_tree *tree,
switch (io->generic.level) {
case RAW_SEARCH_SEARCH:
case RAW_SEARCH_FFIRST:
- return smb_raw_search_next_old(tree, mem_ctx, io, private, callback);
+ return smb_raw_search_next_old(tree, mem_ctx, io, private_data, callback);
case RAW_SEARCH_FUNIQUE:
return NT_STATUS_INVALID_LEVEL;
@@ -809,7 +809,7 @@ NTSTATUS smb_raw_search_next(struct smbcli_tree *tree,
status = smb_raw_t2search_backend(tree, mem_ctx,
io->generic.data_level,
io->t2fnext.in.flags, io->t2fnext.out.count,
- &d_blob, private, callback);
+ &d_blob, private_data, callback);
return status;
}
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 2970681d59..ce41d0cea8 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -37,6 +37,11 @@
#include "libcli/composite/composite.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "libcli/resolve/resolve.h"
+
+#ifdef class
+#undef class
+#endif
+
#include "heimdal/lib/roken/resolve.h"
struct dns_ex_state {
diff --git a/source4/libcli/security/config.mk b/source4/libcli/security/config.mk
index 4b35841507..cd5b75bb81 100644
--- a/source4/libcli/security/config.mk
+++ b/source4/libcli/security/config.mk
@@ -1,8 +1,8 @@
[SUBSYSTEM::LIBSECURITY]
-PUBLIC_DEPENDENCIES = LIBNDR
+PUBLIC_DEPENDENCIES = LIBNDR LIBSECURITY_COMMON
LIBSECURITY_OBJ_FILES = $(addprefix $(libclisrcdir)/security/, \
security_token.o security_descriptor.o \
- dom_sid.o access_check.o privilege.o sddl.o)
+ access_check.o privilege.o sddl.o)
$(eval $(call proto_header_template,$(libclisrcdir)/security/proto.h,$(LIBSECURITY_OBJ_FILES:.o=.c)))
diff --git a/source4/libcli/security/dom_sid.c b/source4/libcli/security/dom_sid.c
deleted file mode 100644
index e1a6b8e8ee..0000000000
--- a/source4/libcli/security/dom_sid.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Samba utility functions
-
- Copyright (C) Stefan (metze) Metzmacher 2002-2004
- Copyright (C) Andrew Tridgell 1992-2004
- Copyright (C) Jeremy Allison 1999
-
- 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
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "librpc/gen_ndr/security.h"
-#include "libcli/security/security.h"
-
-/*****************************************************************
- Compare the auth portion of two sids.
-*****************************************************************/
-
-static int dom_sid_compare_auth(const struct dom_sid *sid1, const struct dom_sid *sid2)
-{
- int i;
-
- if (sid1 == sid2)
- return 0;
- if (!sid1)
- return -1;
- if (!sid2)
- return 1;
-
- if (sid1->sid_rev_num != sid2->sid_rev_num)
- return sid1->sid_rev_num - sid2->sid_rev_num;
-
- for (i = 0; i < 6; i++)
- if (sid1->id_auth[i] != sid2->id_auth[i])
- return sid1->id_auth[i] - sid2->id_auth[i];
-
- return 0;
-}
-
-/*****************************************************************
- Compare two sids.
-*****************************************************************/
-
-int dom_sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2)
-{
- int i;
-
- if (sid1 == sid2)
- return 0;
- if (!sid1)
- return -1;
- if (!sid2)
- return 1;
-
- /* Compare most likely different rids, first: i.e start at end */
- if (sid1->num_auths != sid2->num_auths)
- return sid1->num_auths - sid2->num_auths;
-
- for (i = sid1->num_auths-1; i >= 0; --i)
- if (sid1->sub_auths[i] != sid2->sub_auths[i])
- return sid1->sub_auths[i] - sid2->sub_auths[i];
-
- return dom_sid_compare_auth(sid1, sid2);
-}
-
-/*****************************************************************
- Compare two sids.
-*****************************************************************/
-
-bool dom_sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2)
-{
- return dom_sid_compare(sid1, sid2) == 0;
-}
-
-bool dom_sid_parse(const char *sidstr, struct dom_sid *ret)
-{
- uint_t rev, ia, num_sub_auths, i;
- char *p;
-
- if (strncasecmp(sidstr, "S-", 2)) {
- return false;
- }
-
- sidstr += 2;
-
- rev = strtol(sidstr, &p, 10);
- if (*p != '-') {
- return false;
- }
- sidstr = p+1;
-
- ia = strtol(sidstr, &p, 10);
- if (p == sidstr) {
- return false;
- }
- sidstr = p;
-
- num_sub_auths = 0;
- for (i=0;sidstr[i];i++) {
- if (sidstr[i] == '-') num_sub_auths++;
- }
-
- ret->sid_rev_num = rev;
- ret->id_auth[0] = 0;
- ret->id_auth[1] = 0;
- ret->id_auth[2] = ia >> 24;
- ret->id_auth[3] = ia >> 16;
- ret->id_auth[4] = ia >> 8;
- ret->id_auth[5] = ia;
- ret->num_auths = num_sub_auths;
-
- for (i=0;i<num_sub_auths;i++) {
- if (sidstr[0] != '-') {
- return false;
- }
- sidstr++;
- ret->sub_auths[i] = strtoul(sidstr, &p, 10);
- if (p == sidstr) {
- return false;
- }
- sidstr = p;
- }
-
- return true;
-}
-
-/*
- convert a string to a dom_sid, returning a talloc'd dom_sid
-*/
-struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr)
-{
- struct dom_sid *ret;
- ret = talloc(mem_ctx, struct dom_sid);
- if (!ret) {
- return NULL;
- }
- if (!dom_sid_parse(sidstr, ret)) {
- talloc_free(ret);
- return NULL;
- }
-
- return ret;
-}
-
-/*
- convert a string to a dom_sid, returning a talloc'd dom_sid
-*/
-struct dom_sid *dom_sid_parse_length(TALLOC_CTX *mem_ctx, const DATA_BLOB *sid)
-{
- struct dom_sid *ret;
- char *p = talloc_strndup(mem_ctx, (char *)sid->data, sid->length);
- if (!p) {
- return NULL;
- }
- ret = dom_sid_parse_talloc(mem_ctx, p);
- talloc_free(p);
- return ret;
-}
-
-/*
- copy a dom_sid structure
-*/
-struct dom_sid *dom_sid_dup(TALLOC_CTX *mem_ctx, const struct dom_sid *dom_sid)
-{
- struct dom_sid *ret;
- int i;
-
- if (!dom_sid) {
- return NULL;
- }
-
- ret = talloc(mem_ctx, struct dom_sid);
- if (!ret) {
- return NULL;
- }
-
- ret->sid_rev_num = dom_sid->sid_rev_num;
- ret->id_auth[0] = dom_sid->id_auth[0];
- ret->id_auth[1] = dom_sid->id_auth[1];
- ret->id_auth[2] = dom_sid->id_auth[2];
- ret->id_auth[3] = dom_sid->id_auth[3];
- ret->id_auth[4] = dom_sid->id_auth[4];
- ret->id_auth[5] = dom_sid->id_auth[5];
- ret->num_auths = dom_sid->num_auths;
-
- for (i=0;i<dom_sid->num_auths;i++) {
- ret->sub_auths[i] = dom_sid->sub_auths[i];
- }
-
- return ret;
-}
-
-/*
- add a rid to a domain dom_sid to make a full dom_sid. This function
- returns a new sid in the supplied memory context
-*/
-struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
- const struct dom_sid *domain_sid,
- uint32_t rid)
-{
- struct dom_sid *sid;
-
- sid = talloc(mem_ctx, struct dom_sid);
- if (!sid) return NULL;
-
- *sid = *domain_sid;
-
- sid->sub_auths[sid->num_auths] = rid;
- sid->num_auths++;
-
- return sid;
-}
-
-/*
- Split up a SID into its domain and RID part
-*/
-NTSTATUS dom_sid_split_rid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
- struct dom_sid **domain, uint32_t *rid)
-{
- if (sid->num_auths == 0) {
- return NT_STATUS_INVALID_PARAMETER;
- }
-
- if (domain) {
- if (!(*domain = dom_sid_dup(mem_ctx, sid))) {
- return NT_STATUS_NO_MEMORY;
- }
-
- (*domain)->num_auths -= 1;
- }
-
- if (rid) {
- *rid = sid->sub_auths[sid->num_auths - 1];
- }
-
- return NT_STATUS_OK;
-}
-
-/*
- return true if the 2nd sid is in the domain given by the first sid
-*/
-bool dom_sid_in_domain(const struct dom_sid *domain_sid,
- const struct dom_sid *sid)
-{
- int i;
-
- if (!domain_sid || !sid) {
- return false;
- }
-
- if (domain_sid->num_auths > sid->num_auths) {
- return false;
- }
-
- for (i = domain_sid->num_auths-1; i >= 0; --i) {
- if (domain_sid->sub_auths[i] != sid->sub_auths[i]) {
- return false;
- }
- }
-
- return dom_sid_compare_auth(domain_sid, sid) == 0;
-}
-
-/*
- convert a dom_sid to a string
-*/
-char *dom_sid_string(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
-{
- int i, ofs, maxlen;
- uint32_t ia;
- char *ret;
-
- if (!sid) {
- return talloc_strdup(mem_ctx, "(NULL SID)");
- }
-
- maxlen = sid->num_auths * 11 + 25;
- ret = talloc_array(mem_ctx, char, maxlen);
- if (!ret) return talloc_strdup(mem_ctx, "(SID ERR)");
-
- ia = (sid->id_auth[5]) +
- (sid->id_auth[4] << 8 ) +
- (sid->id_auth[3] << 16) +
- (sid->id_auth[2] << 24);
-
- ofs = snprintf(ret, maxlen, "S-%u-%lu",
- (unsigned int)sid->sid_rev_num, (unsigned long)ia);
-
- for (i = 0; i < sid->num_auths; i++) {
- ofs += snprintf(ret + ofs, maxlen - ofs, "-%lu", (unsigned long)sid->sub_auths[i]);
- }
-
- return ret;
-}
diff --git a/source4/libcli/security/security.h b/source4/libcli/security/security.h
index 46ef6186b8..517f3e8ebe 100644
--- a/source4/libcli/security/security.h
+++ b/source4/libcli/security/security.h
@@ -28,4 +28,7 @@ enum security_user_level {
struct auth_session_info;
+/* Moved the dom_sid functions to the top level dir with manual proto header */
+#include "libcli/security/dom_sid.h"
+
#include "libcli/security/proto.h"
diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c
index 0680c54258..e1349e06f8 100644
--- a/source4/libcli/security/security_token.c
+++ b/source4/libcli/security/security_token.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "dsdb/samdb/samdb.h"
#include "libcli/security/security.h"
#include "auth/session.h"
diff --git a/source4/libcli/smb2/getinfo.c b/source4/libcli/smb2/getinfo.c
index b462bab1de..14d911683e 100644
--- a/source4/libcli/smb2/getinfo.c
+++ b/source4/libcli/smb2/getinfo.c
@@ -95,18 +95,19 @@ NTSTATUS smb2_getinfo(struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
/*
map a generic info level to a SMB2 info level
*/
-uint16_t smb2_getinfo_map_level(uint16_t level, uint8_t class)
+uint16_t smb2_getinfo_map_level(uint16_t level, uint8_t info_class)
{
- if (class == SMB2_GETINFO_FILE &&
+ if (info_class == SMB2_GETINFO_FILE &&
level == RAW_FILEINFO_SEC_DESC) {
return SMB2_GETINFO_SECURITY;
}
- if ((level & 0xFF) == class) {
+ if ((level & 0xFF) == info_class) {
return level;
} else if (level > 1000) {
- return ((level-1000)<<8) | class;
+ return ((level-1000)<<8) | info_class;
}
- DEBUG(0,("Unable to map SMB2 info level 0x%04x of class %d\n", level, class));
+ DEBUG(0,("Unable to map SMB2 info level 0x%04x of class %d\n",
+ level, info_class));
return 0;
}
diff --git a/source4/libcli/smb2/smb2.h b/source4/libcli/smb2/smb2.h
index 9d63a4a95f..d1d5b842c3 100644
--- a/source4/libcli/smb2/smb2.h
+++ b/source4/libcli/smb2/smb2.h
@@ -59,7 +59,7 @@ struct smb2_transport {
for a packet */
struct {
void (*func)(struct smb2_transport *, void *);
- void *private;
+ void *private_data;
uint_t period;
} idle;
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 94ea2586ef..e112544c62 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -35,9 +35,9 @@
*/
static void smb2_transport_event_handler(struct tevent_context *ev,
struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct smb2_transport *transport = talloc_get_type(private,
+ struct smb2_transport *transport = talloc_get_type(private_data,
struct smb2_transport);
if (flags & EVENT_FD_READ) {
packet_recv(transport->packet);
@@ -61,14 +61,14 @@ static int transport_destructor(struct smb2_transport *transport)
/*
handle receive errors
*/
-static void smb2_transport_error(void *private, NTSTATUS status)
+static void smb2_transport_error(void *private_data, NTSTATUS status)
{
- struct smb2_transport *transport = talloc_get_type(private,
+ struct smb2_transport *transport = talloc_get_type(private_data,
struct smb2_transport);
smb2_transport_dead(transport, status);
}
-static NTSTATUS smb2_transport_finish_recv(void *private, DATA_BLOB blob);
+static NTSTATUS smb2_transport_finish_recv(void *private_data, DATA_BLOB blob);
/*
create a transport structure based on an established socket
@@ -181,9 +181,9 @@ static NTSTATUS smb2_handle_oplock_break(struct smb2_transport *transport,
we have a full request in our receive buffer - match it to a pending request
and process
*/
-static NTSTATUS smb2_transport_finish_recv(void *private, DATA_BLOB blob)
+static NTSTATUS smb2_transport_finish_recv(void *private_data, DATA_BLOB blob)
{
- struct smb2_transport *transport = talloc_get_type(private,
+ struct smb2_transport *transport = talloc_get_type(private_data,
struct smb2_transport);
uint8_t *buffer, *hdr;
int len;
@@ -302,9 +302,9 @@ error:
handle timeouts of individual smb requests
*/
static void smb2_timeout_handler(struct tevent_context *ev, struct tevent_timer *te,
- struct timeval t, void *private)
+ struct timeval t, void *private_data)
{
- struct smb2_request *req = talloc_get_type(private, struct smb2_request);
+ struct smb2_request *req = talloc_get_type(private_data, struct smb2_request);
if (req->state == SMB2_REQUEST_RECV) {
DLIST_REMOVE(req->transport->pending_recv, req);
@@ -381,16 +381,16 @@ void smb2_transport_send(struct smb2_request *req)
}
static void idle_handler(struct tevent_context *ev,
- struct tevent_timer *te, struct timeval t, void *private)
+ struct tevent_timer *te, struct timeval t, void *private_data)
{
- struct smb2_transport *transport = talloc_get_type(private,
+ struct smb2_transport *transport = talloc_get_type(private_data,
struct smb2_transport);
struct timeval next = timeval_add(&t, 0, transport->idle.period);
transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
transport,
next,
idle_handler, transport);
- transport->idle.func(transport, transport->idle.private);
+ transport->idle.func(transport, transport->idle.private_data);
}
/*
@@ -400,10 +400,10 @@ static void idle_handler(struct tevent_context *ev,
void smb2_transport_idle_handler(struct smb2_transport *transport,
void (*idle_func)(struct smb2_transport *, void *),
uint64_t period,
- void *private)
+ void *private_data)
{
transport->idle.func = idle_func;
- transport->idle.private = private;
+ transport->idle.private_data = private_data;
transport->idle.period = period;
if (transport->socket->event.te != NULL) {
diff --git a/source4/libcli/smb_composite/appendacl.c b/source4/libcli/smb_composite/appendacl.c
index 1f06b96e75..69ed62a106 100644
--- a/source4/libcli/smb_composite/appendacl.c
+++ b/source4/libcli/smb_composite/appendacl.c
@@ -46,7 +46,7 @@ static NTSTATUS appendacl_open(struct composite_context *c,
/* set the handler */
state->req->async.fn = appendacl_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = APPENDACL_GET;
talloc_free (state->io_open);
@@ -92,7 +92,7 @@ static NTSTATUS appendacl_get(struct composite_context *c,
/* call handler when done setting new security descriptor on file */
state->req->async.fn = appendacl_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = APPENDACL_SET;
talloc_free (state->io_fileinfo);
@@ -124,7 +124,7 @@ static NTSTATUS appendacl_set(struct composite_context *c,
/* set the handler */
state->req->async.fn = appendacl_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = APPENDACL_GETAGAIN;
talloc_free (state->io_setfileinfo);
@@ -159,7 +159,7 @@ static NTSTATUS appendacl_getagain(struct composite_context *c,
/* call the handler */
state->req->async.fn = appendacl_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = APPENDACL_CLOSEPATH;
talloc_free (state->io_fileinfo);
@@ -188,7 +188,7 @@ static NTSTATUS appendacl_close(struct composite_context *c,
*/
static void appendacl_handler(struct smbcli_request *req)
{
- struct composite_context *c = (struct composite_context *)req->async.private;
+ struct composite_context *c = (struct composite_context *)req->async.private_data;
struct appendacl_state *state = talloc_get_type(c->private_data, struct appendacl_state);
/* when this handler is called, the stage indicates what
@@ -270,7 +270,7 @@ struct composite_context *smb_composite_appendacl_send(struct smbcli_tree *tree,
/* setup the callback handler */
state->req->async.fn = appendacl_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = APPENDACL_OPENPATH;
return c;
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index e0f4919f0b..3db777ddc8 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -129,7 +129,7 @@ static NTSTATUS connect_session_setup_anon(struct composite_context *c,
}
state->req->async.fn = request_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = CONNECT_TCON;
return NT_STATUS_OK;
@@ -215,7 +215,7 @@ static NTSTATUS connect_session_setup(struct composite_context *c,
}
state->req->async.fn = request_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = CONNECT_TCON;
return NT_STATUS_OK;
@@ -285,7 +285,7 @@ static NTSTATUS connect_send_negprot(struct composite_context *c,
NT_STATUS_HAVE_NO_MEMORY(state->req);
state->req->async.fn = request_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = CONNECT_NEGPROT;
return NT_STATUS_OK;
@@ -354,7 +354,7 @@ static NTSTATUS connect_socket(struct composite_context *c,
NT_STATUS_HAVE_NO_MEMORY(state->req);
state->req->async.fn = request_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = CONNECT_SESSION_REQUEST;
return NT_STATUS_OK;
@@ -434,7 +434,7 @@ static void state_handler(struct composite_context *c)
*/
static void request_handler(struct smbcli_request *req)
{
- struct composite_context *c = talloc_get_type(req->async.private,
+ struct composite_context *c = talloc_get_type(req->async.private_data,
struct composite_context);
state_handler(c);
}
diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c
index 7c9c7963f4..3bc93b62ab 100644
--- a/source4/libcli/smb_composite/fsinfo.c
+++ b/source4/libcli/smb_composite/fsinfo.c
@@ -47,7 +47,7 @@ static NTSTATUS fsinfo_connect(struct composite_context *c,
state->fsinfo);
NT_STATUS_HAVE_NO_MEMORY(state->req);
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->req->async.fn = fsinfo_raw_handler;
state->stage = FSINFO_QUERY;
@@ -110,7 +110,7 @@ static void fsinfo_state_handler(struct composite_context *creq)
*/
static void fsinfo_raw_handler(struct smbcli_request *req)
{
- struct composite_context *c = talloc_get_type(req->async.private,
+ struct composite_context *c = talloc_get_type(req->async.private_data,
struct composite_context);
fsinfo_state_handler(c);
}
diff --git a/source4/libcli/smb_composite/loadfile.c b/source4/libcli/smb_composite/loadfile.c
index 952f24b811..994c29c77d 100644
--- a/source4/libcli/smb_composite/loadfile.c
+++ b/source4/libcli/smb_composite/loadfile.c
@@ -61,7 +61,7 @@ static NTSTATUS setup_close(struct composite_context *c,
/* call the handler again when the close is done */
state->req->async.fn = loadfile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = LOADFILE_CLOSE;
return NT_STATUS_OK;
@@ -113,7 +113,7 @@ static NTSTATUS loadfile_open(struct composite_context *c,
/* call the handler again when the first read is done */
state->req->async.fn = loadfile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = LOADFILE_READ;
talloc_free(state->io_open);
@@ -152,7 +152,7 @@ static NTSTATUS loadfile_read(struct composite_context *c,
/* call the handler again when the read is done */
state->req->async.fn = loadfile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
return NT_STATUS_OK;
}
@@ -180,7 +180,7 @@ static NTSTATUS loadfile_close(struct composite_context *c,
*/
static void loadfile_handler(struct smbcli_request *req)
{
- struct composite_context *c = (struct composite_context *)req->async.private;
+ struct composite_context *c = (struct composite_context *)req->async.private_data;
struct loadfile_state *state = talloc_get_type(c->private_data, struct loadfile_state);
/* when this handler is called, the stage indicates what
@@ -250,7 +250,7 @@ struct composite_context *smb_composite_loadfile_send(struct smbcli_tree *tree,
/* setup the callback handler */
state->req->async.fn = loadfile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
state->stage = LOADFILE_OPEN;
return c;
diff --git a/source4/libcli/smb_composite/savefile.c b/source4/libcli/smb_composite/savefile.c
index f02ca46f06..25a35c01a9 100644
--- a/source4/libcli/smb_composite/savefile.c
+++ b/source4/libcli/smb_composite/savefile.c
@@ -64,7 +64,7 @@ static NTSTATUS setup_close(struct composite_context *c,
/* call the handler again when the close is done */
state->stage = SAVEFILE_CLOSE;
state->req->async.fn = savefile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
return NT_STATUS_OK;
}
@@ -108,7 +108,7 @@ static NTSTATUS savefile_open(struct composite_context *c,
/* call the handler again when the first write is done */
state->stage = SAVEFILE_WRITE;
state->req->async.fn = savefile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
talloc_free(state->io_open);
return NT_STATUS_OK;
@@ -149,7 +149,7 @@ static NTSTATUS savefile_write(struct composite_context *c,
/* call the handler again when the write is done */
state->req->async.fn = savefile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
return NT_STATUS_OK;
}
@@ -181,7 +181,7 @@ static NTSTATUS savefile_close(struct composite_context *c,
*/
static void savefile_handler(struct smbcli_request *req)
{
- struct composite_context *c = (struct composite_context *)req->async.private;
+ struct composite_context *c = (struct composite_context *)req->async.private_data;
struct savefile_state *state = talloc_get_type(c->private_data, struct savefile_state);
/* when this handler is called, the stage indicates what
@@ -254,7 +254,7 @@ struct composite_context *smb_composite_savefile_send(struct smbcli_tree *tree,
/* setup the callback handler */
state->req->async.fn = savefile_handler;
- state->req->async.private = c;
+ state->req->async.private_data = c;
c->private_data = state;
return c;
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index 7c9d1fb731..83d15e98eb 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -80,7 +80,7 @@ static void set_user_session_key(struct smbcli_session *session,
*/
static void request_handler(struct smbcli_request *req)
{
- struct composite_context *c = (struct composite_context *)req->async.private;
+ struct composite_context *c = (struct composite_context *)req->async.private_data;
struct sesssetup_state *state = talloc_get_type(c->private_data, struct sesssetup_state);
struct smbcli_session *session = req->session;
DATA_BLOB session_key = data_blob(NULL, 0);
diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c
index e94ed36d39..8371837dcb 100644
--- a/source4/libcli/util/nterr.c
+++ b/source4/libcli/util/nterr.c
@@ -20,7 +20,7 @@
/* NT error codes. please read nterr.h */
#include "includes.h"
-#include "libcli/ldap/ldap.h"
+#include "libcli/ldap/ldap_errors.h"
#undef strcasecmp
typedef struct
diff --git a/source4/libcli/wbclient/wbclient.c b/source4/libcli/wbclient/wbclient.c
index b881e32f7b..da7d678da9 100644
--- a/source4/libcli/wbclient/wbclient.c
+++ b/source4/libcli/wbclient/wbclient.c
@@ -117,7 +117,7 @@ struct composite_context *wbc_sids_to_xids_send(struct wbc_context *wbc_ctx,
static void sids_to_xids_recv_ids(struct irpc_request *req)
{
struct wbc_idmap_state *state = talloc_get_type_abort(
- req->async.private,
+ req->async.private_data,
struct wbc_idmap_state);
state->ctx->status = irpc_call_recv(state->irpc_req);
@@ -183,7 +183,7 @@ struct composite_context *wbc_xids_to_sids_send(struct wbc_context *wbc_ctx,
static void xids_to_sids_recv_ids(struct irpc_request *req)
{
struct wbc_idmap_state *state = talloc_get_type_abort(
- req->async.private,
+ req->async.private_data,
struct wbc_idmap_state);
state->ctx->status = irpc_call_recv(state->irpc_req);
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c
index 61bb10bf6a..48a6abba9d 100644
--- a/source4/libcli/wrepl/winsrepl.c
+++ b/source4/libcli/wrepl/winsrepl.c
@@ -81,9 +81,9 @@ static void wrepl_request_timeout_handler(struct tevent_context *ev, struct teve
/*
handle recv events
*/
-static NTSTATUS wrepl_finish_recv(void *private, DATA_BLOB packet_blob_in)
+static NTSTATUS wrepl_finish_recv(void *private_data, DATA_BLOB packet_blob_in)
{
- struct wrepl_socket *wrepl_socket = talloc_get_type(private, struct wrepl_socket);
+ struct wrepl_socket *wrepl_socket = talloc_get_type(private_data, struct wrepl_socket);
struct wrepl_request *req = wrepl_socket->recv_queue;
DATA_BLOB blob;
enum ndr_err_code ndr_err;
@@ -123,9 +123,9 @@ static NTSTATUS wrepl_finish_recv(void *private, DATA_BLOB packet_blob_in)
handler for winrepl events
*/
static void wrepl_handler(struct tevent_context *ev, struct tevent_fd *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct wrepl_socket *wrepl_socket = talloc_get_type(private,
+ struct wrepl_socket *wrepl_socket = talloc_get_type(private_data,
struct wrepl_socket);
if (flags & EVENT_FD_READ) {
packet_recv(wrepl_socket->packet);
@@ -136,9 +136,9 @@ static void wrepl_handler(struct tevent_context *ev, struct tevent_fd *fde,
}
}
-static void wrepl_error(void *private, NTSTATUS status)
+static void wrepl_error(void *private_data, NTSTATUS status)
{
- struct wrepl_socket *wrepl_socket = talloc_get_type(private,
+ struct wrepl_socket *wrepl_socket = talloc_get_type(private_data,
struct wrepl_socket);
wrepl_socket_dead(wrepl_socket, status);
}
diff --git a/source4/libcli/wrepl/winsrepl.h b/source4/libcli/wrepl/winsrepl.h
index 738ba391eb..ec1fb6bb59 100644
--- a/source4/libcli/wrepl/winsrepl.h
+++ b/source4/libcli/wrepl/winsrepl.h
@@ -82,7 +82,7 @@ struct wrepl_request {
struct {
void (*fn)(struct wrepl_request *);
- void *private;
+ void *private_data;
} async;
};