#include "libnet/libnet_join.h"
#include "../libcli/auth/libcli_auth.h"
#include "../librpc/gen_ndr/srv_wkssvc.h"
+#include "../libcli/security/security.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
char *admin_domain = NULL;
char *admin_account = NULL;
WERROR werr;
- struct nt_user_token *token = p->server_info->ptok;
+ struct security_token *token = p->server_info->ptok;
if (!r->in.domain_name) {
return WERR_INVALID_PARAM;
return WERR_INVALID_PARAM;
}
- if (!user_has_privileges(token, &se_machine_account) &&
+ if (!security_token_has_privilege(token, SEC_PRIV_MACHINE_ACCOUNT) &&
!nt_token_check_domain_rid(token, DOMAIN_RID_ADMINS) &&
!nt_token_check_sid(&global_sid_Builtin_Administrators, token)) {
DEBUG(5,("_wkssvc_NetrJoinDomain2: account doesn't have "
j->in.admin_password = cleartext_pwd;
j->in.debug = true;
j->in.modify_config = lp_config_backend_is_registry();
- j->in.msg_ctx = smbd_messaging_context();
+ j->in.msg_ctx = p->msg_ctx;
become_root();
werr = libnet_Join(p->mem_ctx, j);
char *admin_domain = NULL;
char *admin_account = NULL;
WERROR werr;
- struct nt_user_token *token = p->server_info->ptok;
+ struct security_token *token = p->server_info->ptok;
if (!r->in.account || !r->in.encrypted_password) {
return WERR_INVALID_PARAM;
}
- if (!user_has_privileges(token, &se_machine_account) &&
+ if (!security_token_has_privilege(token, SEC_PRIV_MACHINE_ACCOUNT) &&
!nt_token_check_domain_rid(token, DOMAIN_RID_ADMINS) &&
!nt_token_check_sid(&global_sid_Builtin_Administrators, token)) {
DEBUG(5,("_wkssvc_NetrUnjoinDomain2: account doesn't have "
u->in.admin_password = cleartext_pwd;
u->in.debug = true;
u->in.modify_config = lp_config_backend_is_registry();
- u->in.msg_ctx = smbd_messaging_context();
+ u->in.msg_ctx = p->msg_ctx;
become_root();
werr = libnet_Unjoin(p->mem_ctx, u);