summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-06-23 17:03:53 +0200
committerGünther Deschner <gd@samba.org>2008-06-23 23:38:52 +0200
commit8725626ec8b2b2a11b2c0bb5e7010f229d552b5e (patch)
tree7d21793f6a1bf36d4e2ee6b8eaf6c255038b1818 /source3
parentbd6fece98af7142790625ddd19769529eba4ada3 (diff)
downloadsamba-8725626ec8b2b2a11b2c0bb5e7010f229d552b5e.tar.gz
samba-8725626ec8b2b2a11b2c0bb5e7010f229d552b5e.tar.bz2
samba-8725626ec8b2b2a11b2c0bb5e7010f229d552b5e.zip
net_vampire: prepend libnet_ to the public samsync functions.
Guenther (This used to be commit f020c947cfb1482176af8827ed9c361d7c21e26f)
Diffstat (limited to 'source3')
-rw-r--r--source3/libnet/libnet_proto.h23
-rw-r--r--source3/libnet/libnet_samsync.c34
-rw-r--r--source3/utils/net_rpc_samsync.c58
3 files changed, 55 insertions, 60 deletions
diff --git a/source3/libnet/libnet_proto.h b/source3/libnet/libnet_proto.h
index 6f150d1579..ba73a3e8bc 100644
--- a/source3/libnet/libnet_proto.h
+++ b/source3/libnet/libnet_proto.h
@@ -45,20 +45,15 @@ _PUBLIC_ void ndr_print_libnet_UnjoinCtx(struct ndr_print *ndr, const char *name
/* The following definitions come from libnet/libnet_samsync.c */
-NTSTATUS samsync_fix_delta_array(TALLOC_CTX *mem_ctx,
- DATA_BLOB *session_key,
- bool rid_crypt,
- enum netr_SamDatabaseID database_id,
- struct netr_DELTA_ENUM_ARRAY *r);
-NTSTATUS samsync_init_context(TALLOC_CTX *mem_ctx,
- const struct dom_sid *domain_sid,
- const char *domain_name,
- enum net_samsync_mode mode,
- struct samsync_context **ctx_p);
-NTSTATUS samsync_process_database(struct rpc_pipe_client *pipe_hnd,
- enum netr_SamDatabaseID database_id,
- samsync_fn_t callback_fn,
- struct samsync_context *ctx);
+NTSTATUS libnet_samsync_init_context(TALLOC_CTX *mem_ctx,
+ const struct dom_sid *domain_sid,
+ const char *domain_name,
+ enum net_samsync_mode mode,
+ struct samsync_context **ctx_p);
+NTSTATUS libnet_samsync(struct rpc_pipe_client *pipe_hnd,
+ enum netr_SamDatabaseID database_id,
+ samsync_fn_t callback_fn,
+ struct samsync_context *ctx);
NTSTATUS pull_netr_AcctLockStr(TALLOC_CTX *mem_ctx,
struct lsa_BinaryString *r,
struct netr_AcctLockStr **str_p);
diff --git a/source3/libnet/libnet_samsync.c b/source3/libnet/libnet_samsync.c
index fab77e8398..7dd47b6399 100644
--- a/source3/libnet/libnet_samsync.c
+++ b/source3/libnet/libnet_samsync.c
@@ -163,11 +163,11 @@ static NTSTATUS samsync_fix_delta(TALLOC_CTX *mem_ctx,
* callback need only do the printing or application logic
*/
-NTSTATUS samsync_fix_delta_array(TALLOC_CTX *mem_ctx,
- DATA_BLOB *session_key,
- bool rid_crypt,
- enum netr_SamDatabaseID database_id,
- struct netr_DELTA_ENUM_ARRAY *r)
+static NTSTATUS samsync_fix_delta_array(TALLOC_CTX *mem_ctx,
+ DATA_BLOB *session_key,
+ bool rid_crypt,
+ enum netr_SamDatabaseID database_id,
+ struct netr_DELTA_ENUM_ARRAY *r)
{
NTSTATUS status;
int i;
@@ -188,14 +188,14 @@ NTSTATUS samsync_fix_delta_array(TALLOC_CTX *mem_ctx,
}
/**
- * samsync_init_context
+ * libnet_samsync_init_context
*/
-NTSTATUS samsync_init_context(TALLOC_CTX *mem_ctx,
- const struct dom_sid *domain_sid,
- const char *domain_name,
- enum net_samsync_mode mode,
- struct samsync_context **ctx_p)
+NTSTATUS libnet_samsync_init_context(TALLOC_CTX *mem_ctx,
+ const struct dom_sid *domain_sid,
+ const char *domain_name,
+ enum net_samsync_mode mode,
+ struct samsync_context **ctx_p)
{
struct samsync_context *ctx;
@@ -271,13 +271,13 @@ static const char *samsync_debug_str(TALLOC_CTX *mem_ctx,
}
/**
- * samsync_process_database
+ * libnet_samsync
*/
-NTSTATUS samsync_process_database(struct rpc_pipe_client *pipe_hnd,
- enum netr_SamDatabaseID database_id,
- samsync_fn_t callback_fn,
- struct samsync_context *ctx)
+NTSTATUS libnet_samsync(struct rpc_pipe_client *pipe_hnd,
+ enum netr_SamDatabaseID database_id,
+ samsync_fn_t callback_fn,
+ struct samsync_context *ctx)
{
NTSTATUS result;
TALLOC_CTX *mem_ctx;
@@ -292,7 +292,7 @@ NTSTATUS samsync_process_database(struct rpc_pipe_client *pipe_hnd,
ZERO_STRUCT(return_authenticator);
- if (!(mem_ctx = talloc_init("samsync_process_database"))) {
+ if (!(mem_ctx = talloc_init("libnet_samsync"))) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index c0a3de7190..4dfa72dcc9 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -39,23 +39,23 @@ NTSTATUS rpc_samdump_internals(struct net_context *c,
struct samsync_context *ctx = NULL;
NTSTATUS status;
- status = samsync_init_context(mem_ctx,
- domain_sid,
- domain_name,
- NET_SAMSYNC_MODE_DUMP,
- &ctx);
+ status = libnet_samsync_init_context(mem_ctx,
+ domain_sid,
+ domain_name,
+ NET_SAMSYNC_MODE_DUMP,
+ &ctx);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
- samsync_process_database(pipe_hnd, SAM_DATABASE_DOMAIN,
- display_sam_entries, ctx);
+ libnet_samsync(pipe_hnd, SAM_DATABASE_DOMAIN,
+ display_sam_entries, ctx);
- samsync_process_database(pipe_hnd, SAM_DATABASE_BUILTIN,
- display_sam_entries, ctx);
+ libnet_samsync(pipe_hnd, SAM_DATABASE_BUILTIN,
+ display_sam_entries, ctx);
- samsync_process_database(pipe_hnd, SAM_DATABASE_PRIVS,
- display_sam_entries, ctx);
+ libnet_samsync(pipe_hnd, SAM_DATABASE_PRIVS,
+ display_sam_entries, ctx);
TALLOC_FREE(ctx);
@@ -97,11 +97,11 @@ NTSTATUS rpc_vampire_internals(struct net_context *c,
NTSTATUS result;
struct samsync_context *ctx = NULL;
- result = samsync_init_context(mem_ctx,
- domain_sid,
- domain_name,
- NET_SAMSYNC_MODE_FETCH_PASSDB,
- &ctx);
+ result = libnet_samsync_init_context(mem_ctx,
+ domain_sid,
+ domain_name,
+ NET_SAMSYNC_MODE_FETCH_PASSDB,
+ &ctx);
if (!NT_STATUS_IS_OK(result)) {
return result;
}
@@ -122,8 +122,8 @@ NTSTATUS rpc_vampire_internals(struct net_context *c,
}
/* fetch domain */
- result = samsync_process_database(pipe_hnd, SAM_DATABASE_DOMAIN,
- fetch_sam_entries, ctx);
+ result = libnet_samsync(pipe_hnd, SAM_DATABASE_DOMAIN,
+ fetch_sam_entries, ctx);
if (!NT_STATUS_IS_OK(result) && ctx->error_message) {
d_fprintf(stderr, "%s\n", ctx->error_message);
@@ -137,8 +137,8 @@ NTSTATUS rpc_vampire_internals(struct net_context *c,
/* fetch builtin */
ctx->domain_sid = sid_dup_talloc(mem_ctx, &global_sid_Builtin);
ctx->domain_sid_str = sid_string_talloc(mem_ctx, ctx->domain_sid);
- result = samsync_process_database(pipe_hnd, SAM_DATABASE_BUILTIN,
- fetch_sam_entries, ctx);
+ result = libnet_samsync(pipe_hnd, SAM_DATABASE_BUILTIN,
+ fetch_sam_entries, ctx);
if (!NT_STATUS_IS_OK(result) && ctx->error_message) {
d_fprintf(stderr, "%s\n", ctx->error_message);
@@ -166,11 +166,11 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c,
NTSTATUS status;
struct samsync_context *ctx = NULL;
- status = samsync_init_context(mem_ctx,
- domain_sid,
- domain_name,
- NET_SAMSYNC_MODE_FETCH_LDIF,
- &ctx);
+ status = libnet_samsync_init_context(mem_ctx,
+ domain_sid,
+ domain_name,
+ NET_SAMSYNC_MODE_FETCH_LDIF,
+ &ctx);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -180,8 +180,8 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c,
}
/* fetch domain */
- status = samsync_process_database(pipe_hnd, SAM_DATABASE_DOMAIN,
- fetch_sam_entries_ldif, ctx);
+ status = libnet_samsync(pipe_hnd, SAM_DATABASE_DOMAIN,
+ fetch_sam_entries_ldif, ctx);
if (!NT_STATUS_IS_OK(status) && ctx->error_message) {
d_fprintf(stderr, "%s\n", ctx->error_message);
@@ -195,8 +195,8 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c,
/* fetch builtin */
ctx->domain_sid = sid_dup_talloc(mem_ctx, &global_sid_Builtin);
ctx->domain_sid_str = sid_string_talloc(mem_ctx, ctx->domain_sid);
- status = samsync_process_database(pipe_hnd, SAM_DATABASE_BUILTIN,
- fetch_sam_entries_ldif, ctx);
+ status = libnet_samsync(pipe_hnd, SAM_DATABASE_BUILTIN,
+ fetch_sam_entries_ldif, ctx);
if (!NT_STATUS_IS_OK(status) && ctx->error_message) {
d_fprintf(stderr, "%s\n", ctx->error_message);