#include "lib/netapi/netapi.h"
#include "libnet/libnet.h"
+/********************************************************************
+********************************************************************/
+
static WERROR NetGetDCNameLocal(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
return WERR_NOT_SUPPORTED;
}
+/********************************************************************
+********************************************************************/
+
static WERROR NetGetDCNameRemote(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
return werr;
}
+/********************************************************************
+********************************************************************/
+
static WERROR libnetapi_NetGetDCName(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
buffer);
}
+/****************************************************************
+ NetGetDCName
+****************************************************************/
+
NET_API_STATUS NetGetDCName(const char *server_name,
const char *domain_name,
uint8_t **buffer)
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}
+/********************************************************************
+********************************************************************/
+
static WERROR NetGetAnyDCNameLocal(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
return WERR_NOT_SUPPORTED;
}
+/********************************************************************
+********************************************************************/
+
static WERROR NetGetAnyDCNameRemote(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
}
+/********************************************************************
+********************************************************************/
+
static WERROR libnetapi_NetGetAnyDCName(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
buffer);
}
+/****************************************************************
+ NetGetAnyDCName
+****************************************************************/
+
NET_API_STATUS NetGetAnyDCName(const char *server_name,
const char *domain_name,
uint8_t **buffer)
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}
#include "lib/netapi/netapi.h"
#include "libnet/libnet.h"
+/****************************************************************
+****************************************************************/
+
static WERROR NetJoinDomainLocal(struct libnetapi_ctx *mem_ctx,
const char *server_name,
const char *domain_name,
status = dsgetdcname(mem_ctx, NULL, domain_name,
NULL, NULL, flags, &info);
if (!NT_STATUS_IS_OK(status)) {
+ libnetapi_set_error_string(mem_ctx,
+ "%s", get_friendly_nt_error_msg(status));
return ntstatus_to_werror(status);
}
r->in.dc_name = talloc_strdup(mem_ctx,
werr = libnet_Join(mem_ctx, r);
if (!W_ERROR_IS_OK(werr) && r->out.error_string) {
- libnetapi_set_error_string(mem_ctx, r->out.error_string);
+ libnetapi_set_error_string(mem_ctx, "%s", r->out.error_string);
}
TALLOC_FREE(r);
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetJoinDomainRemote(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR libnetapi_NetJoinDomain(struct libnetapi_ctx *ctx,
const char *server_name,
const char *domain_name,
join_flags);
}
+/****************************************************************
+ NetJoinDomain
+****************************************************************/
+
NET_API_STATUS NetJoinDomain(const char *server_name,
const char *domain_name,
const char *account_ou,
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetUnjoinDomainLocal(struct libnetapi_ctx *mem_ctx,
const char *server_name,
const char *account,
r->in.dc_name = talloc_strdup(mem_ctx, server_name);
W_ERROR_HAVE_NO_MEMORY(r->in.dc_name);
} else {
-
NTSTATUS status;
const char *domain = NULL;
struct DS_DOMAIN_CONTROLLER_INFO *info = NULL;
status = dsgetdcname(mem_ctx, NULL, domain,
NULL, NULL, flags, &info);
if (!NT_STATUS_IS_OK(status)) {
+ libnetapi_set_error_string(mem_ctx,
+ "%s", get_friendly_nt_error_msg(status));
return ntstatus_to_werror(status);
}
r->in.dc_name = talloc_strdup(mem_ctx,
r->in.unjoin_flags = unjoin_flags;
r->in.modify_config = true;
+ r->in.debug = true;
r->in.domain_sid = &domain_sid;
- return libnet_Unjoin(mem_ctx, r);
+ werr = libnet_Unjoin(mem_ctx, r);
+ if (!W_ERROR_IS_OK(werr) && r->out.error_string) {
+ libnetapi_set_error_string(mem_ctx, "%s", r->out.error_string);
+ }
+ TALLOC_FREE(r);
+ return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetUnjoinDomainRemote(struct libnetapi_ctx *ctx,
const char *server_name,
const char *account,
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR libnetapi_NetUnjoinDomain(struct libnetapi_ctx *ctx,
const char *server_name,
const char *account,
unjoin_flags);
}
+/****************************************************************
+ NetUnjoinDomain
+****************************************************************/
+
NET_API_STATUS NetUnjoinDomain(const char *server_name,
const char *account,
const char *password,
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetGetJoinInformationRemote(struct libnetapi_ctx *ctx,
const char *server_name,
const char **name_buffer,
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetGetJoinInformationLocal(struct libnetapi_ctx *ctx,
const char *server_name,
const char **name_buffer,
name_type);
}
+/****************************************************************
+ NetGetJoinInformation
+****************************************************************/
+
NET_API_STATUS NetGetJoinInformation(const char *server_name,
const char **name_buffer,
uint16_t *name_type)
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}
#include "lib/netapi/netapi.h"
#include "libnet/libnet.h"
+/****************************************************************
+****************************************************************/
+
static WERROR NetServerGetInfoLocal_1005(struct libnetapi_ctx *ctx,
uint8_t **buffer)
{
return WERR_OK;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetServerGetInfoLocal(struct libnetapi_ctx *ctx,
const char *server_name,
uint32_t level,
return WERR_UNKNOWN_LEVEL;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetServerGetInfoRemote(struct libnetapi_ctx *ctx,
const char *server_name,
uint32_t level,
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR libnetapi_NetServerGetInfo(struct libnetapi_ctx *ctx,
const char *server_name,
uint32_t level,
}
+/****************************************************************
+ NetServerGetInfo
+****************************************************************/
+
NET_API_STATUS NetServerGetInfo(const char *server_name,
uint32_t level,
uint8_t **buffer)
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetServerSetInfoLocal_1005(struct libnetapi_ctx *ctx,
uint8_t *buffer,
uint32_t *parm_error)
{
WERROR werr;
struct libnet_conf_ctx *conf_ctx;
- TALLOC_CTX *mem_ctx;
-
struct srvsvc_NetSrvInfo1005 *info1005;
if (!buffer) {
return WERR_NOT_SUPPORTED;
}
- mem_ctx = talloc_stackframe();
- werr = libnet_conf_open(mem_ctx, &conf_ctx);
+ werr = libnet_conf_open(ctx, &conf_ctx);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
"server string",
info1005->comment);
-done:
+ done:
libnet_conf_close(conf_ctx);
- TALLOC_FREE(mem_ctx);
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetServerSetInfoLocal(struct libnetapi_ctx *ctx,
const char *server_name,
uint32_t level,
return WERR_UNKNOWN_LEVEL;
}
+/****************************************************************
+****************************************************************/
+
static WERROR NetServerSetInfoRemote(struct libnetapi_ctx *ctx,
const char *server_name,
uint32_t level,
return werr;
}
+/****************************************************************
+****************************************************************/
+
static WERROR libnetapi_NetServerSetInfo(struct libnetapi_ctx *ctx,
const char *server_name,
uint32_t level,
parm_error);
}
+/****************************************************************
+ NetServerSetInfo
+****************************************************************/
NET_API_STATUS NetServerSetInfo(const char *server_name,
uint32_t level,
return W_ERROR_V(werr);
}
- return 0;
+ return NET_API_STATUS_SUCCESS;
}