summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2008-01-15 10:47:07 -0600
committerGerald (Jerry) Carter <jerry@samba.org>2008-01-15 10:47:07 -0600
commit43ddf12ef9ed400a3116c169700244ea137e593f (patch)
treeb1a128d74c7db4883f196ef8f1f79644a64cf43f /source3
parent64e5f2fd8033b14d84d468fde32ac220d82aedb8 (diff)
parentee8cf0ce40820b3e1ec025339f2b25c0001fda13 (diff)
downloadsamba-43ddf12ef9ed400a3116c169700244ea137e593f.tar.gz
samba-43ddf12ef9ed400a3116c169700244ea137e593f.tar.bz2
samba-43ddf12ef9ed400a3116c169700244ea137e593f.zip
Merge commit 'samba/v3-2-test' into v3-2-stable
(This used to be commit 5a527476a07ea43178dc5afeaf8ad78da8a4080c)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in13
-rw-r--r--source3/configure.in4
-rw-r--r--source3/include/smb.h2
-rw-r--r--source3/libnet/libnet.h2
-rw-r--r--source3/libnet/libnet_join.c16
-rw-r--r--source3/libnet/libnet_join.h75
-rw-r--r--source3/librpc/gen_ndr/libnet_join.h73
-rw-r--r--source3/librpc/gen_ndr/ndr_libnet_join.c103
-rw-r--r--source3/librpc/gen_ndr/ndr_libnet_join.h20
-rw-r--r--source3/librpc/idl/libnet_join.idl60
-rw-r--r--source3/librpc/ndr/ndr_basic.c11
-rw-r--r--source3/librpc/ndr/ndr_misc.c81
-rw-r--r--source3/modules/vfs_xattr_tdb.c (renamed from source3/modules/vfs_ea_tdb.c)197
-rw-r--r--source3/registry/reg_api.c25
-rw-r--r--source3/rpc_client/cli_lsarpc.c8
-rw-r--r--source3/rpcclient/rpcclient.c2
-rwxr-xr-xsource3/script/tests/selftest.sh2
-rw-r--r--source3/utils/net.h2
-rw-r--r--source3/utils/net_ads.c7
-rw-r--r--source3/utils/net_domain.c2
-rw-r--r--source3/utils/net_rpc.c11
-rw-r--r--source3/utils/net_rpc_join.c4
-rw-r--r--source3/winbindd/winbindd_cm.c6
23 files changed, 510 insertions, 216 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 42601452ea..46f733c0bc 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -268,7 +268,8 @@ LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_wkssvc.o \
librpc/gen_ndr/ndr_srvsvc.o \
librpc/gen_ndr/ndr_svcctl.o \
librpc/gen_ndr/ndr_eventlog.o \
- librpc/gen_ndr/ndr_notify.o
+ librpc/gen_ndr/ndr_notify.o \
+ librpc/gen_ndr/ndr_libnet_join.o
RPC_PARSE_OBJ0 = rpc_parse/parse_prs.o rpc_parse/parse_misc.o
@@ -503,7 +504,7 @@ VFS_CAP_OBJ = modules/vfs_cap.o
VFS_EXPAND_MSDFS_OBJ = modules/vfs_expand_msdfs.o
VFS_SHADOW_COPY_OBJ = modules/vfs_shadow_copy.o
VFS_AFSACL_OBJ = modules/vfs_afsacl.o
-VFS_EA_TDB_OBJ = modules/vfs_ea_tdb.o librpc/gen_ndr/ndr_xattr.o
+VFS_XATTR_TDB_OBJ = modules/vfs_xattr_tdb.o librpc/gen_ndr/ndr_xattr.o
VFS_POSIXACL_OBJ = modules/vfs_posixacl.o
VFS_AIXACL_OBJ = modules/vfs_aixacl.o modules/vfs_aixacl_util.o
VFS_AIXACL2_OBJ = modules/vfs_aixacl2.o modules/vfs_aixacl_util.o modules/nfs4_acls.o
@@ -1403,9 +1404,9 @@ bin/libwbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ)
@SONAMEFLAG@`basename $@`.$(SONAME_VER)
@ln -s -f `basename $@` $@.$(SONAME_VER)
-bin/libwbclient.a: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ)
+bin/libwbclient.a: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ0)
@echo Linking non-shared library $@
- @-$(AR) -rc $@ $(LIBWBCLIENT_OBJ)
+ @-$(AR) -rc $@ $(LIBWBCLIENT_OBJ0)
bin/libaddns.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
@echo Linking shared library $@
@@ -1685,9 +1686,9 @@ bin/afsacl.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AFSACL_OBJ)
@echo "Building plugin $@"
@$(SHLD_MODULE) $(VFS_AFSACL_OBJ)
-bin/ea_tdb.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_EA_TDB_OBJ)
+bin/xattr_tdb.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_XATTR_TDB_OBJ)
@echo "Building plugin $@"
- @$(SHLD_MODULE) $(VFS_EA_TDB_OBJ)
+ @$(SHLD_MODULE) $(VFS_XATTR_TDB_OBJ)
bin/posixacl.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_POSIXACL_OBJ)
@echo "Building plugin $@"
diff --git a/source3/configure.in b/source3/configure.in
index 4ddc64407c..cd04b598c0 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -707,7 +707,7 @@ dnl These have to be built static:
default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_winreg rpc_initshutdown rpc_lsa_ds rpc_wkssvc rpc_svcctl2 rpc_ntsvcs rpc_net rpc_netdfs rpc_srvsvc2 rpc_spoolss rpc_eventlog2 auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin vfs_default nss_info_template"
dnl These are preferably build shared, and static if dlopen() is not available
-default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script vfs_readahead vfs_syncops vfs_ea_tdb"
+default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy charset_CP850 charset_CP437 auth_script vfs_readahead vfs_syncops vfs_xattr_tdb"
if test "x$developer" = xyes; then
default_static_modules="$default_static_modules rpc_rpcecho"
@@ -6489,7 +6489,7 @@ SMB_MODULE(vfs_cap, \$(VFS_CAP_OBJ), "bin/cap.$SHLIBEXT", VFS)
SMB_MODULE(vfs_expand_msdfs, \$(VFS_EXPAND_MSDFS_OBJ), "bin/expand_msdfs.$SHLIBEXT", VFS)
SMB_MODULE(vfs_shadow_copy, \$(VFS_SHADOW_COPY_OBJ), "bin/shadow_copy.$SHLIBEXT", VFS)
SMB_MODULE(vfs_afsacl, \$(VFS_AFSACL_OBJ), "bin/afsacl.$SHLIBEXT", VFS)
-SMB_MODULE(vfs_ea_tdb, \$(VFS_EA_TDB_OBJ), "bin/ea_tdb.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_xattr_tdb, \$(VFS_XATTR_TDB_OBJ), "bin/xattr_tdb.$SHLIBEXT", VFS)
SMB_MODULE(vfs_posixacl, \$(VFS_POSIXACL_OBJ), "bin/posixacl.$SHLIBEXT", VFS)
SMB_MODULE(vfs_aixacl, \$(VFS_AIXACL_OBJ), "bin/aixacl.$SHLIBEXT", VFS)
SMB_MODULE(vfs_aixacl2, \$(VFS_AIXACL2_OBJ), "bin/aixacl2.$SHLIBEXT", VFS)
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 49245eaa83..744acd719f 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -322,6 +322,8 @@ struct id_map {
#include "librpc/gen_ndr/wkssvc.h"
#include "librpc/gen_ndr/echo.h"
#include "librpc/gen_ndr/svcctl.h"
+#include "librpc/gen_ndr/libnet_join.h"
+
struct lsa_dom_info {
bool valid;
diff --git a/source3/libnet/libnet.h b/source3/libnet/libnet.h
index d6238ca982..97e720f617 100644
--- a/source3/libnet/libnet.h
+++ b/source3/libnet/libnet.h
@@ -20,7 +20,7 @@
#ifndef __LIBNET_H__
#define __LIBNET_H__
-#include "libnet/libnet_join.h"
+#include "librpc/gen_ndr/libnet_join.h"
#include "libnet/libnet_conf.h"
#include "libnet/libnet_proto.h"
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index c60f4c9803..a189a38ea3 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -236,7 +236,6 @@ static ADS_STATUS libnet_join_find_machine_acct(TALLOC_CTX *mem_ctx,
goto done;
}
- TALLOC_FREE(r->out.dn);
r->out.dn = talloc_strdup(mem_ctx, dn);
if (!r->out.dn) {
status = ADS_ERROR_LDAP(LDAP_NO_MEMORY);
@@ -1214,6 +1213,10 @@ WERROR libnet_Join(TALLOC_CTX *mem_ctx,
{
WERROR werr;
+ if (r->in.debug) {
+ NDR_PRINT_IN_DEBUG(libnet_JoinCtx, r);
+ }
+
werr = libnet_join_pre_processing(mem_ctx, r);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -1231,6 +1234,9 @@ WERROR libnet_Join(TALLOC_CTX *mem_ctx,
goto done;
}
done:
+ if (r->in.debug) {
+ NDR_PRINT_OUT_DEBUG(libnet_JoinCtx, r);
+ }
return werr;
}
@@ -1321,6 +1327,10 @@ WERROR libnet_Unjoin(TALLOC_CTX *mem_ctx,
{
WERROR werr;
+ if (r->in.debug) {
+ NDR_PRINT_IN_DEBUG(libnet_UnjoinCtx, r);
+ }
+
werr = libnet_unjoin_pre_processing(mem_ctx, r);
if (!W_ERROR_IS_OK(werr)) {
goto done;
@@ -1339,5 +1349,9 @@ WERROR libnet_Unjoin(TALLOC_CTX *mem_ctx,
}
done:
+ if (r->in.debug) {
+ NDR_PRINT_OUT_DEBUG(libnet_UnjoinCtx, r);
+ }
+
return werr;
}
diff --git a/source3/libnet/libnet_join.h b/source3/libnet/libnet_join.h
deleted file mode 100644
index c47e8d934c..0000000000
--- a/source3/libnet/libnet_join.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * libnet Join Support
- * Copyright (C) Guenther Deschner 2007-2008
- *
- * 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 __LIBNET_JOIN_H__
-#define __LIBNET_JOIN_H__
-
-struct libnet_JoinCtx {
- struct {
- const char *dc_name;
- const char *machine_name;
- const char *domain_name;
- const char *account_ou;
- const char *admin_account;
- const char *admin_password;
- const char *machine_password;
- uint32_t join_flags;
- const char *os_version;
- const char *os_name;
- bool create_upn;
- const char *upn;
- bool modify_config;
- struct ads_struct *ads;
- bool debug;
- } in;
-
- struct {
- char *account_name;
- char *netbios_domain_name;
- char *dns_domain_name;
- char *dn;
- struct dom_sid *domain_sid;
- bool modified_config;
- WERROR result;
- char *error_string;
- bool domain_is_ad;
- } out;
-};
-
-struct libnet_UnjoinCtx {
- struct {
- const char *dc_name;
- const char *machine_name;
- const char *domain_name;
- const char *admin_account;
- const char *admin_password;
- uint32_t unjoin_flags;
- bool modify_config;
- struct dom_sid *domain_sid;
- struct ads_struct *ads;
- } in;
-
- struct {
- bool modified_config;
- WERROR result;
- char *error_string;
- } out;
-};
-
-#endif
diff --git a/source3/librpc/gen_ndr/libnet_join.h b/source3/librpc/gen_ndr/libnet_join.h
new file mode 100644
index 0000000000..40759cb489
--- /dev/null
+++ b/source3/librpc/gen_ndr/libnet_join.h
@@ -0,0 +1,73 @@
+/* header auto-generated by pidl */
+
+#include <stdint.h>
+
+#include "librpc/gen_ndr/wkssvc.h"
+#include "librpc/gen_ndr/security.h"
+#ifndef _HEADER_libnetjoin
+#define _HEADER_libnetjoin
+
+;
+
+
+struct libnet_JoinCtx {
+ struct {
+ const char * dc_name;
+ const char * machine_name;
+ const char * domain_name;/* [ref] */
+ const char * account_ou;
+ const char * admin_account;
+ const char * admin_password;
+ const char * machine_password;
+ uint32_t join_flags;
+ const char * os_version;
+ const char * os_name;
+ uint8_t create_upn;
+ const char * upn;
+ uint8_t modify_config;
+ struct ads_struct *ads;/* [ref] */
+ uint8_t debug;
+ } in;
+
+ struct {
+ const char * account_name;
+ const char * netbios_domain_name;
+ const char * dns_domain_name;
+ const char * dn;
+ struct dom_sid *domain_sid;/* [ref] */
+ uint8_t modified_config;
+ const char * error_string;
+ uint8_t domain_is_ad;
+ WERROR result;
+ } out;
+
+};
+
+
+struct libnet_UnjoinCtx {
+ struct {
+ const char * dc_name;
+ const char * machine_name;
+ const char * domain_name;
+ const char * account_ou;
+ const char * admin_account;
+ const char * admin_password;
+ const char * machine_password;
+ uint32_t unjoin_flags;
+ uint8_t modify_config;
+ struct dom_sid *domain_sid;/* [ref] */
+ struct ads_struct *ads;/* [ref] */
+ uint8_t debug;
+ } in;
+
+ struct {
+ const char * netbios_domain_name;
+ const char * dns_domain_name;
+ uint8_t modified_config;
+ const char * error_string;
+ WERROR result;
+ } out;
+
+};
+
+#endif /* _HEADER_libnetjoin */
diff --git a/source3/librpc/gen_ndr/ndr_libnet_join.c b/source3/librpc/gen_ndr/ndr_libnet_join.c
new file mode 100644
index 0000000000..5345bc0ad4
--- /dev/null
+++ b/source3/librpc/gen_ndr/ndr_libnet_join.c
@@ -0,0 +1,103 @@
+/* parser auto-generated by pidl */
+
+#include "includes.h"
+#include "librpc/gen_ndr/ndr_libnet_join.h"
+
+#include "librpc/gen_ndr/ndr_wkssvc.h"
+#include "librpc/gen_ndr/ndr_security.h"
+_PUBLIC_ void ndr_print_libnet_JoinCtx(struct ndr_print *ndr, const char *name, int flags, const struct libnet_JoinCtx *r)
+{
+ ndr_print_struct(ndr, name, "libnet_JoinCtx");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "libnet_JoinCtx");
+ ndr->depth++;
+ ndr_print_string(ndr, "dc_name", r->in.dc_name);
+ ndr_print_string(ndr, "machine_name", r->in.machine_name);
+ ndr_print_ptr(ndr, "domain_name", r->in.domain_name);
+ ndr->depth++;
+ ndr_print_string(ndr, "domain_name", r->in.domain_name);
+ ndr->depth--;
+ ndr_print_string(ndr, "account_ou", r->in.account_ou);
+ ndr_print_string(ndr, "admin_account", r->in.admin_account);
+ ndr_print_string(ndr, "admin_password", r->in.admin_password);
+ ndr_print_string(ndr, "machine_password", r->in.machine_password);
+ ndr_print_wkssvc_joinflags(ndr, "join_flags", r->in.join_flags);
+ ndr_print_string(ndr, "os_version", r->in.os_version);
+ ndr_print_string(ndr, "os_name", r->in.os_name);
+ ndr_print_uint8(ndr, "create_upn", r->in.create_upn);
+ ndr_print_string(ndr, "upn", r->in.upn);
+ ndr_print_uint8(ndr, "modify_config", r->in.modify_config);
+ ndr_print_ptr(ndr, "ads", r->in.ads);
+ ndr->depth++;
+ ndr_print_ads_struct(ndr, "ads", r->in.ads);
+ ndr->depth--;
+ ndr_print_uint8(ndr, "debug", r->in.debug);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "libnet_JoinCtx");
+ ndr->depth++;
+ ndr_print_string(ndr, "account_name", r->out.account_name);
+ ndr_print_string(ndr, "netbios_domain_name", r->out.netbios_domain_name);
+ ndr_print_string(ndr, "dns_domain_name", r->out.dns_domain_name);
+ ndr_print_string(ndr, "dn", r->out.dn);
+ ndr_print_ptr(ndr, "domain_sid", r->out.domain_sid);
+ ndr->depth++;
+ ndr_print_dom_sid(ndr, "domain_sid", r->out.domain_sid);
+ ndr->depth--;
+ ndr_print_uint8(ndr, "modified_config", r->out.modified_config);
+ ndr_print_string(ndr, "error_string", r->out.error_string);
+ ndr_print_uint8(ndr, "domain_is_ad", r->out.domain_is_ad);
+ ndr_print_WERROR(ndr, "result", r->out.result);
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+_PUBLIC_ void ndr_print_libnet_UnjoinCtx(struct ndr_print *ndr, const char *name, int flags, const struct libnet_UnjoinCtx *r)
+{
+ ndr_print_struct(ndr, name, "libnet_UnjoinCtx");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "libnet_UnjoinCtx");
+ ndr->depth++;
+ ndr_print_string(ndr, "dc_name", r->in.dc_name);
+ ndr_print_string(ndr, "machine_name", r->in.machine_name);
+ ndr_print_string(ndr, "domain_name", r->in.domain_name);
+ ndr_print_string(ndr, "account_ou", r->in.account_ou);
+ ndr_print_string(ndr, "admin_account", r->in.admin_account);
+ ndr_print_string(ndr, "admin_password", r->in.admin_password);
+ ndr_print_string(ndr, "machine_password", r->in.machine_password);
+ ndr_print_wkssvc_joinflags(ndr, "unjoin_flags", r->in.unjoin_flags);
+ ndr_print_uint8(ndr, "modify_config", r->in.modify_config);
+ ndr_print_ptr(ndr, "domain_sid", r->in.domain_sid);
+ ndr->depth++;
+ ndr_print_dom_sid(ndr, "domain_sid", r->in.domain_sid);
+ ndr->depth--;
+ ndr_print_ptr(ndr, "ads", r->in.ads);
+ ndr->depth++;
+ ndr_print_ads_struct(ndr, "ads", r->in.ads);
+ ndr->depth--;
+ ndr_print_uint8(ndr, "debug", r->in.debug);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "libnet_UnjoinCtx");
+ ndr->depth++;
+ ndr_print_string(ndr, "netbios_domain_name", r->out.netbios_domain_name);
+ ndr_print_string(ndr, "dns_domain_name", r->out.dns_domain_name);
+ ndr_print_uint8(ndr, "modified_config", r->out.modified_config);
+ ndr_print_string(ndr, "error_string", r->out.error_string);
+ ndr_print_WERROR(ndr, "result", r->out.result);
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
diff --git a/source3/librpc/gen_ndr/ndr_libnet_join.h b/source3/librpc/gen_ndr/ndr_libnet_join.h
new file mode 100644
index 0000000000..4a5fdf0d50
--- /dev/null
+++ b/source3/librpc/gen_ndr/ndr_libnet_join.h
@@ -0,0 +1,20 @@
+/* header auto-generated by pidl */
+
+#include "librpc/ndr/libndr.h"
+#include "librpc/gen_ndr/libnet_join.h"
+
+#ifndef _HEADER_NDR_libnetjoin
+#define _HEADER_NDR_libnetjoin
+
+#define NDR_LIBNET_JOINCTX (0x00)
+
+#define NDR_LIBNET_UNJOINCTX (0x01)
+
+#define NDR_LIBNETJOIN_CALL_COUNT (2)
+enum ndr_err_code ndr_push_libnet_JoinCtx(struct ndr_push *ndr, int flags, const struct libnet_JoinCtx *r);
+enum ndr_err_code ndr_pull_libnet_JoinCtx(struct ndr_pull *ndr, int flags, struct libnet_JoinCtx *r);
+void ndr_print_libnet_JoinCtx(struct ndr_print *ndr, const char *name, int flags, const struct libnet_JoinCtx *r);
+enum ndr_err_code ndr_push_libnet_UnjoinCtx(struct ndr_push *ndr, int flags, const struct libnet_UnjoinCtx *r);
+enum ndr_err_code ndr_pull_libnet_UnjoinCtx(struct ndr_pull *ndr, int flags, struct libnet_UnjoinCtx *r);
+void ndr_print_libnet_UnjoinCtx(struct ndr_print *ndr, const char *name, int flags, const struct libnet_UnjoinCtx *r);
+#endif /* _HEADER_NDR_libnetjoin */
diff --git a/source3/librpc/idl/libnet_join.idl b/source3/librpc/idl/libnet_join.idl
new file mode 100644
index 0000000000..2741b7bd7b
--- /dev/null
+++ b/source3/librpc/idl/libnet_join.idl
@@ -0,0 +1,60 @@
+#include "idl_types.h"
+
+import "wkssvc.idl", "security.idl";
+
+/*
+ libnetjoin interface definition
+*/
+
+[
+ pointer_default(unique)
+]
+interface libnetjoin
+{
+ typedef bitmap wkssvc_joinflags wkssvc_joinflags;
+
+ [nopush,nopull] WERROR libnet_JoinCtx(
+ [in] string dc_name,
+ [in] string machine_name,
+ [in,ref] string *domain_name,
+ [in] string account_ou,
+ [in] string admin_account,
+ [in] string admin_password,
+ [in] string machine_password,
+ [in] wkssvc_joinflags join_flags,
+ [in] string os_version,
+ [in] string os_name,
+ [in] boolean8 create_upn,
+ [in] string upn,
+ [in] boolean8 modify_config,
+ [in] ads_struct *ads,
+ [in] boolean8 debug,
+ [out] string account_name,
+ [out] string netbios_domain_name,
+ [out] string dns_domain_name,
+ [out] string dn,
+ [out] dom_sid *domain_sid,
+ [out] boolean8 modified_config,
+ [out] string error_string,
+ [out] boolean8 domain_is_ad
+ );
+
+ [nopush,nopull] WERROR libnet_UnjoinCtx(
+ [in] string dc_name,
+ [in] string machine_name,
+ [in] string domain_name,
+ [in] string account_ou,
+ [in] string admin_account,
+ [in] string admin_password,
+ [in] string machine_password,
+ [in] wkssvc_joinflags unjoin_flags,
+ [in] boolean8 modify_config,
+ [in] dom_sid *domain_sid,
+ [in] ads_struct *ads,
+ [in] boolean8 debug,
+ [out] string netbios_domain_name,
+ [out] string dns_domain_name,
+ [out] boolean8 modified_config,
+ [out] string error_string
+ );
+}
diff --git a/source3/librpc/ndr/ndr_basic.c b/source3/librpc/ndr/ndr_basic.c
index 0ef78a2a54..54397c9469 100644
--- a/source3/librpc/ndr/ndr_basic.c
+++ b/source3/librpc/ndr/ndr_basic.c
@@ -847,3 +847,14 @@ _PUBLIC_ uint32_t ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags)
if (!data) return ret;
return ret + data->length;
}
+
+_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b)
+{
+ ndr->print(ndr, "%-25s: %s", name, b?"true":"false");
+}
+
+_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
+{
+ char addr[INET6_ADDRSTRLEN];
+ ndr->print(ndr, "%-25s: %s", name, print_sockaddr(addr, sizeof(addr), ss));
+}
diff --git a/source3/librpc/ndr/ndr_misc.c b/source3/librpc/ndr/ndr_misc.c
index 2ca0cf08e8..245ba45215 100644
--- a/source3/librpc/ndr/ndr_misc.c
+++ b/source3/librpc/ndr/ndr_misc.c
@@ -153,3 +153,84 @@ void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct s
#endif
ndr->depth--;
}
+
+void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct ads_struct *r)
+{
+ if (!r) { return; }
+
+ ndr_print_struct(ndr, name, "ads_struct");
+ ndr->depth++;
+ ndr_print_bool(ndr, "is_mine", r->is_mine);
+ ndr_print_struct(ndr, name, "server");
+ ndr->depth++;
+ ndr_print_string(ndr, "realm", r->server.realm);
+ ndr_print_string(ndr, "workgroup", r->server.workgroup);
+ ndr_print_string(ndr, "ldap_server", r->server.ldap_server);
+ ndr_print_bool(ndr, "foreign", r->server.foreign);
+ ndr->depth--;
+ ndr_print_struct(ndr, name, "auth");
+ ndr->depth++;
+ ndr_print_string(ndr, "realm", r->auth.realm);
+#ifdef DEBUG_PASSWORD
+ ndr_print_string(ndr, "password", r->auth.password);
+#else
+ ndr_print_string(ndr, "password", "(PASSWORD ommited)");
+#endif
+ ndr_print_string(ndr, "user_name", r->auth.user_name);
+ ndr_print_string(ndr, "kdc_server", r->auth.kdc_server);
+ ndr_print_uint32(ndr, "flags", r->auth.flags);
+ ndr_print_uint32(ndr, "time_offset", r->auth.time_offset);
+ ndr_print_time_t(ndr, "tgt_expire", r->auth.tgt_expire);
+ ndr_print_time_t(ndr, "tgs_expire", r->auth.tgs_expire);
+ ndr_print_time_t(ndr, "renewable", r->auth.renewable);
+ ndr->depth--;
+ ndr_print_struct(ndr, name, "config");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "flags", r->config.flags);
+ ndr_print_string(ndr, "realm", r->config.realm);
+ ndr_print_string(ndr, "bind_path", r->config.bind_path);
+ ndr_print_string(ndr, "ldap_server_name", r->config.ldap_server_name);
+ ndr_print_string(ndr, "server_site_name", r->config.server_site_name);
+ ndr_print_string(ndr, "client_site_name", r->config.client_site_name);
+ ndr_print_time_t(ndr, "current_time", r->config.current_time);
+ ndr_print_bool(ndr, "tried_closest_dc", r->config.tried_closest_dc);
+ ndr_print_string(ndr, "schema_path", r->config.schema_path);
+ ndr_print_string(ndr, "config_path", r->config.config_path);
+ ndr->depth--;
+#ifdef HAVE_LDAP
+ ndr_print_struct(ndr, name, "ldap");
+ ndr->depth++;
+ ndr_print_ptr(ndr, "ld", r->ldap.ld);
+ ndr_print_sockaddr_storage(ndr, "ss", &r->ldap.ss);
+ ndr_print_time_t(ndr, "last_attempt", r->ldap.last_attempt);
+ ndr_print_uint32(ndr, "port", r->ldap.port);
+ ndr_print_uint16(ndr, "wrap_type", r->ldap.wrap_type);
+#ifdef HAVE_LDAP_SASL_WRAPPING
+ ndr_print_ptr(ndr, "sbiod", r->ldap.sbiod);
+#endif /* HAVE_LDAP_SASL_WRAPPING */
+ ndr_print_ptr(ndr, "mem_ctx", r->ldap.mem_ctx);
+ ndr_print_ptr(ndr, "wrap_ops", r->ldap.wrap_ops);
+ ndr_print_ptr(ndr, "wrap_private_data", r->ldap.wrap_private_data);
+ ndr_print_struct(ndr, name, "in");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "ofs", r->ldap.in.ofs);
+ ndr_print_uint32(ndr, "needed", r->ldap.in.needed);
+ ndr_print_uint32(ndr, "left", r->ldap.in.left);
+ ndr_print_uint32(ndr, "max_wrapped", r->ldap.in.max_wrapped);
+ ndr_print_uint32(ndr, "min_wrapped", r->ldap.in.min_wrapped);
+ ndr_print_uint32(ndr, "size", r->ldap.in.size);
+ ndr_print_array_uint8(ndr, "buf", r->ldap.in.buf, r->ldap.in.size);
+ ndr->depth--;
+ ndr_print_struct(ndr, name, "out");
+ ndr->depth++;
+ ndr_print_uint32(ndr, "ofs", r->ldap.out.ofs);
+ ndr_print_uint32(ndr, "left", r->ldap.out.left);
+ ndr_print_uint32(ndr, "max_unwrapped", r->ldap.out.max_unwrapped);
+ ndr_print_uint32(ndr, "sig_size", r->ldap.out.sig_size);
+ ndr_print_uint32(ndr, "size", r->ldap.out.size);
+ ndr_print_array_uint8(ndr, "buf", r->ldap.out.buf, r->ldap.out.size);
+ ndr->depth--;
+ ndr->depth--;
+#endif /* HAVE_LDAP */
+ ndr->depth--;
+}
diff --git a/source3/modules/vfs_ea_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 8cf04d79ad..3a72831b5b 100644
--- a/source3/modules/vfs_ea_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -28,9 +28,9 @@
* unmarshall tdb_xattrs
*/
-static NTSTATUS ea_tdb_pull_attrs(TALLOC_CTX *mem_ctx,
- const TDB_DATA *data,
- struct tdb_xattrs **presult)
+static NTSTATUS xattr_tdb_pull_attrs(TALLOC_CTX *mem_ctx,
+ const TDB_DATA *data,
+ struct tdb_xattrs **presult)
{
DATA_BLOB blob;
enum ndr_err_code ndr_err;
@@ -66,9 +66,9 @@ static NTSTATUS ea_tdb_pull_attrs(TALLOC_CTX *mem_ctx,
* marshall tdb_xattrs
*/
-static NTSTATUS ea_tdb_push_attrs(TALLOC_CTX *mem_ctx,
- const struct tdb_xattrs *attribs,
- TDB_DATA *data)
+static NTSTATUS xattr_tdb_push_attrs(TALLOC_CTX *mem_ctx,
+ const struct tdb_xattrs *attribs,
+ TDB_DATA *data)
{
DATA_BLOB blob;
enum ndr_err_code ndr_err;
@@ -91,10 +91,10 @@ static NTSTATUS ea_tdb_push_attrs(TALLOC_CTX *mem_ctx,
* Load tdb_xattrs for a file from the tdb
*/
-static NTSTATUS ea_tdb_load_attrs(TALLOC_CTX *mem_ctx,
- struct db_context *db_ctx,
- const struct file_id *id,
- struct tdb_xattrs **presult)
+static NTSTATUS xattr_tdb_load_attrs(TALLOC_CTX *mem_ctx,
+ struct db_context *db_ctx,
+ const struct file_id *id,
+ struct tdb_xattrs **presult)
{
uint8 id_buf[16];
NTSTATUS status;
@@ -108,7 +108,7 @@ static NTSTATUS ea_tdb_load_attrs(TALLOC_CTX *mem_ctx,
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- status = ea_tdb_pull_attrs(mem_ctx, &data, presult);
+ status = xattr_tdb_pull_attrs(mem_ctx, &data, presult);
TALLOC_FREE(data.dptr);
return NT_STATUS_OK;
}
@@ -117,9 +117,9 @@ static NTSTATUS ea_tdb_load_attrs(TALLOC_CTX *mem_ctx,
* fetch_lock the tdb_ea record for a file
*/
-static struct db_record *ea_tdb_lock_attrs(TALLOC_CTX *mem_ctx,
- struct db_context *db_ctx,
- const struct file_id *id)
+static struct db_record *xattr_tdb_lock_attrs(TALLOC_CTX *mem_ctx,
+ struct db_context *db_ctx,
+ const struct file_id *id)
{
uint8 id_buf[16];
push_file_id_16((char *)id_buf, id);
@@ -131,16 +131,16 @@ static struct db_record *ea_tdb_lock_attrs(TALLOC_CTX *mem_ctx,
* Save tdb_xattrs to a previously fetch_locked record
*/
-static NTSTATUS ea_tdb_save_attrs(struct db_record *rec,
- const struct tdb_xattrs *attribs)
+static NTSTATUS xattr_tdb_save_attrs(struct db_record *rec,
+ const struct tdb_xattrs *attribs)
{
TDB_DATA data;
NTSTATUS status;
- status = ea_tdb_push_attrs(talloc_tos(), attribs, &data);
+ status = xattr_tdb_push_attrs(talloc_tos(), attribs, &data);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("ea_tdb_push_attrs failed: %s\n",
+ DEBUG(0, ("xattr_tdb_push_attrs failed: %s\n",
nt_errstr(status)));
return status;
}
@@ -156,19 +156,19 @@ static NTSTATUS ea_tdb_save_attrs(struct db_record *rec,
* Worker routine for getxattr and fgetxattr
*/
-static ssize_t ea_tdb_getattr(struct db_context *db_ctx,
- const struct file_id *id,
- const char *name, void *value, size_t size)
+static ssize_t xattr_tdb_getattr(struct db_context *db_ctx,
+ const struct file_id *id,
+ const char *name, void *value, size_t size)
{
struct tdb_xattrs *attribs;
uint32_t i;
ssize_t result = -1;
NTSTATUS status;
- status = ea_tdb_load_attrs(talloc_tos(), db_ctx, id, &attribs);
+ status = xattr_tdb_load_attrs(talloc_tos(), db_ctx, id, &attribs);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("ea_tdb_fetch_attrs failed: %s\n",
+ DEBUG(10, ("xattr_tdb_fetch_attrs failed: %s\n",
nt_errstr(status)));
errno = EINVAL;
return -1;
@@ -199,9 +199,9 @@ static ssize_t ea_tdb_getattr(struct db_context *db_ctx,
return result;
}
-static ssize_t ea_tdb_getxattr(struct vfs_handle_struct *handle,
- const char *path, const char *name,
- void *value, size_t size)
+static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle,
+ const char *path, const char *name,
+ void *value, size_t size)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -215,12 +215,12 @@ static ssize_t ea_tdb_getxattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_getattr(db, &id, name, value, size);
+ return xattr_tdb_getattr(db, &id, name, value, size);
}
-static ssize_t ea_tdb_fgetxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const char *name, void *value, size_t size)
+static ssize_t xattr_tdb_fgetxattr(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ const char *name, void *value, size_t size)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -234,34 +234,34 @@ static ssize_t ea_tdb_fgetxattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_getattr(db, &id, name, value, size);
+ return xattr_tdb_getattr(db, &id, name, value, size);
}
/*
* Worker routine for setxattr and fsetxattr
*/
-static int ea_tdb_setattr(struct db_context *db_ctx,
- const struct file_id *id, const char *name,
- const void *value, size_t size, int flags)
+static int xattr_tdb_setattr(struct db_context *db_ctx,
+ const struct file_id *id, const char *name,
+ const void *value, size_t size, int flags)
{
NTSTATUS status;
struct db_record *rec;
struct tdb_xattrs *attribs;
uint32_t i;
- rec = ea_tdb_lock_attrs(talloc_tos(), db_ctx, id);
+ rec = xattr_tdb_lock_attrs(talloc_tos(), db_ctx, id);
if (rec == NULL) {
- DEBUG(0, ("ea_tdb_lock_attrs failed\n"));
+ DEBUG(0, ("xattr_tdb_lock_attrs failed\n"));
errno = EINVAL;
return -1;
}
- status = ea_tdb_pull_attrs(rec, &rec->value, &attribs);
+ status = xattr_tdb_pull_attrs(rec, &rec->value, &attribs);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("ea_tdb_fetch_attrs failed: %s\n",
+ DEBUG(10, ("xattr_tdb_fetch_attrs failed: %s\n",
nt_errstr(status)));
TALLOC_FREE(rec);
return -1;
@@ -295,7 +295,7 @@ static int ea_tdb_setattr(struct db_context *db_ctx,
attribs->xattrs[i].value.data = CONST_DISCARD(uint8 *, value);
attribs->xattrs[i].value.length = size;
- status = ea_tdb_save_attrs(rec, attribs);
+ status = xattr_tdb_save_attrs(rec, attribs);
TALLOC_FREE(rec);
@@ -307,9 +307,9 @@ static int ea_tdb_setattr(struct db_context *db_ctx,
return 0;
}
-static int ea_tdb_setxattr(struct vfs_handle_struct *handle,
- const char *path, const char *name,
- const void *value, size_t size, int flags)
+static int xattr_tdb_setxattr(struct vfs_handle_struct *handle,
+ const char *path, const char *name,
+ const void *value, size_t size, int flags)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -323,13 +323,13 @@ static int ea_tdb_setxattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_setattr(db, &id, name, value, size, flags);
+ return xattr_tdb_setattr(db, &id, name, value, size, flags);
}
-static int ea_tdb_fsetxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- const char *name, const void *value,
- size_t size, int flags)
+static int xattr_tdb_fsetxattr(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ const char *name, const void *value,
+ size_t size, int flags)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -343,37 +343,38 @@ static int ea_tdb_fsetxattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_setattr(db, &id, name, value, size, flags);
+ return xattr_tdb_setattr(db, &id, name, value, size, flags);
}
/*
* Worker routine for listxattr and flistxattr
*/
-static ssize_t ea_tdb_listattr(struct db_context *db_ctx,
- const struct file_id *id, char *list,
- size_t size)
+static ssize_t xattr_tdb_listattr(struct db_context *db_ctx,
+ const struct file_id *id, char *list,
+ size_t size)
{
NTSTATUS status;
struct tdb_xattrs *attribs;
uint32_t i;
size_t len = 0;
- status = ea_tdb_load_attrs(talloc_tos(), db_ctx, id, &attribs);
+ status = xattr_tdb_load_attrs(talloc_tos(), db_ctx, id, &attribs);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("ea_tdb_fetch_attrs failed: %s\n",
+ DEBUG(10, ("xattr_tdb_fetch_attrs failed: %s\n",
nt_errstr(status)));
errno = EINVAL;
return -1;
}
- DEBUG(10, ("ea_tdb_listattr: Found %d xattrs\n", attribs->num_xattrs));
+ DEBUG(10, ("xattr_tdb_listattr: Found %d xattrs\n",
+ attribs->num_xattrs));
for (i=0; i<attribs->num_xattrs; i++) {
size_t tmp;
- DEBUG(10, ("ea_tdb_listattr: xattrs[i].name: %s\n",
+ DEBUG(10, ("xattr_tdb_listattr: xattrs[i].name: %s\n",
attribs->xattrs[i].name));
tmp = strlen(attribs->xattrs[i].name);
@@ -412,8 +413,8 @@ static ssize_t ea_tdb_listattr(struct db_context *db_ctx,
return len;
}
-static ssize_t ea_tdb_listxattr(struct vfs_handle_struct *handle,
- const char *path, char *list, size_t size)
+static ssize_t xattr_tdb_listxattr(struct vfs_handle_struct *handle,
+ const char *path, char *list, size_t size)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -427,12 +428,12 @@ static ssize_t ea_tdb_listxattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_listattr(db, &id, list, size);
+ return xattr_tdb_listattr(db, &id, list, size);
}
-static ssize_t ea_tdb_flistxattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, char *list,
- size_t size)
+static ssize_t xattr_tdb_flistxattr(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, char *list,
+ size_t size)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -446,33 +447,33 @@ static ssize_t ea_tdb_flistxattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_listattr(db, &id, list, size);
+ return xattr_tdb_listattr(db, &id, list, size);
}
/*
* Worker routine for removexattr and fremovexattr
*/
-static int ea_tdb_removeattr(struct db_context *db_ctx,
- const struct file_id *id, const char *name)
+static int xattr_tdb_removeattr(struct db_context *db_ctx,
+ const struct file_id *id, const char *name)
{
NTSTATUS status;
struct db_record *rec;
struct tdb_xattrs *attribs;
uint32_t i;
- rec = ea_tdb_lock_attrs(talloc_tos(), db_ctx, id);
+ rec = xattr_tdb_lock_attrs(talloc_tos(), db_ctx, id);
if (rec == NULL) {
- DEBUG(0, ("ea_tdb_lock_attrs failed\n"));
+ DEBUG(0, ("xattr_tdb_lock_attrs failed\n"));
errno = EINVAL;
return -1;
}
- status = ea_tdb_pull_attrs(rec, &rec->value, &attribs);
+ status = xattr_tdb_pull_attrs(rec, &rec->value, &attribs);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("ea_tdb_fetch_attrs failed: %s\n",
+ DEBUG(10, ("xattr_tdb_fetch_attrs failed: %s\n",
nt_errstr(status)));
TALLOC_FREE(rec);
return -1;
@@ -500,7 +501,7 @@ static int ea_tdb_removeattr(struct db_context *db_ctx,
return 0;
}
- status = ea_tdb_save_attrs(rec, attribs);
+ status = xattr_tdb_save_attrs(rec, attribs);
TALLOC_FREE(rec);
@@ -512,8 +513,8 @@ static int ea_tdb_removeattr(struct db_context *db_ctx,
return 0;
}
-static int ea_tdb_removexattr(struct vfs_handle_struct *handle,
- const char *path, const char *name)
+static int xattr_tdb_removexattr(struct vfs_handle_struct *handle,
+ const char *path, const char *name)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -527,11 +528,11 @@ static int ea_tdb_removexattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_removeattr(db, &id, name);
+ return xattr_tdb_removeattr(db, &id, name);
}
-static int ea_tdb_fremovexattr(struct vfs_handle_struct *handle,
- struct files_struct *fsp, const char *name)
+static int xattr_tdb_fremovexattr(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, const char *name)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -545,14 +546,14 @@ static int ea_tdb_fremovexattr(struct vfs_handle_struct *handle,
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- return ea_tdb_removeattr(db, &id, name);
+ return xattr_tdb_removeattr(db, &id, name);
}
/*
* Open the tdb file upon VFS_CONNECT
*/
-static bool ea_tdb_init(int snum, struct db_context **p_db)
+static bool xattr_tdb_init(int snum, struct db_context **p_db)
{
struct db_context *db;
const char *dbname;
@@ -580,7 +581,7 @@ static bool ea_tdb_init(int snum, struct db_context **p_db)
/*
* On unlink we need to delete the tdb record
*/
-static int ea_tdb_unlink(vfs_handle_struct *handle, const char *path)
+static int xattr_tdb_unlink(vfs_handle_struct *handle, const char *path)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -602,7 +603,7 @@ static int ea_tdb_unlink(vfs_handle_struct *handle, const char *path)
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- rec = ea_tdb_lock_attrs(talloc_tos(), db, &id);
+ rec = xattr_tdb_lock_attrs(talloc_tos(), db, &id);
/*
* If rec == NULL there's not much we can do about it
@@ -619,7 +620,7 @@ static int ea_tdb_unlink(vfs_handle_struct *handle, const char *path)
/*
* On rmdir we need to delete the tdb record
*/
-static int ea_tdb_rmdir(vfs_handle_struct *handle, const char *path)
+static int xattr_tdb_rmdir(vfs_handle_struct *handle, const char *path)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
@@ -641,7 +642,7 @@ static int ea_tdb_rmdir(vfs_handle_struct *handle, const char *path)
id = SMB_VFS_FILE_ID_CREATE(handle->conn, sbuf.st_dev, sbuf.st_ino);
- rec = ea_tdb_lock_attrs(talloc_tos(), db, &id);
+ rec = xattr_tdb_lock_attrs(talloc_tos(), db, &id);
/*
* If rec == NULL there's not much we can do about it
@@ -665,7 +666,7 @@ static void close_ea_db(void **data)
TALLOC_FREE(*p_db);
}
-static int ea_tdb_connect(vfs_handle_struct *handle, const char *service,
+static int xattr_tdb_connect(vfs_handle_struct *handle, const char *service,
const char *user)
{
fstring sname;
@@ -686,7 +687,7 @@ static int ea_tdb_connect(vfs_handle_struct *handle, const char *service,
return 0;
}
- if (!ea_tdb_init(snum, &db)) {
+ if (!xattr_tdb_init(snum, &db)) {
DEBUG(5, ("Could not init ea tdb\n"));
lp_do_parameter(snum, "ea support", "False");
return 0;
@@ -702,35 +703,35 @@ static int ea_tdb_connect(vfs_handle_struct *handle, const char *service,
/* VFS operations structure */
-static const vfs_op_tuple ea_tdb_ops[] = {
- {SMB_VFS_OP(ea_tdb_getxattr), SMB_VFS_OP_GETXATTR,
+static const vfs_op_tuple xattr_tdb_ops[] = {
+ {SMB_VFS_OP(xattr_tdb_getxattr), SMB_VFS_OP_GETXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_fgetxattr), SMB_VFS_OP_FGETXATTR,
+ {SMB_VFS_OP(xattr_tdb_fgetxattr), SMB_VFS_OP_FGETXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_setxattr), SMB_VFS_OP_SETXATTR,
+ {SMB_VFS_OP(xattr_tdb_setxattr), SMB_VFS_OP_SETXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_fsetxattr), SMB_VFS_OP_FSETXATTR,
+ {SMB_VFS_OP(xattr_tdb_fsetxattr), SMB_VFS_OP_FSETXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_listxattr), SMB_VFS_OP_LISTXATTR,
+ {SMB_VFS_OP(xattr_tdb_listxattr), SMB_VFS_OP_LISTXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_flistxattr), SMB_VFS_OP_FLISTXATTR,
+ {SMB_VFS_OP(xattr_tdb_flistxattr), SMB_VFS_OP_FLISTXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_removexattr), SMB_VFS_OP_REMOVEXATTR,
+ {SMB_VFS_OP(xattr_tdb_removexattr), SMB_VFS_OP_REMOVEXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_fremovexattr), SMB_VFS_OP_FREMOVEXATTR,
+ {SMB_VFS_OP(xattr_tdb_fremovexattr), SMB_VFS_OP_FREMOVEXATTR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_unlink), SMB_VFS_OP_UNLINK,
+ {SMB_VFS_OP(xattr_tdb_unlink), SMB_VFS_OP_UNLINK,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_rmdir), SMB_VFS_OP_RMDIR,
+ {SMB_VFS_OP(xattr_tdb_rmdir), SMB_VFS_OP_RMDIR,
SMB_VFS_LAYER_TRANSPARENT},
- {SMB_VFS_OP(ea_tdb_connect), SMB_VFS_OP_CONNECT,
+ {SMB_VFS_OP(xattr_tdb_connect), SMB_VFS_OP_CONNECT,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP}
};
-NTSTATUS vfs_ea_tdb_init(void);
-NTSTATUS vfs_ea_tdb_init(void)
+NTSTATUS vfs_xattr_tdb_init(void);
+NTSTATUS vfs_xattr_tdb_init(void)
{
- return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "ea_tdb",
- ea_tdb_ops);
+ return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "xattr_tdb",
+ xattr_tdb_ops);
}
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index 8bbdb6abd3..d1657c8cf6 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -1,4 +1,4 @@
-/*
+/*
* Unix SMB/CIFS implementation.
* Virtual Windows Registry Layer
* Copyright (C) Volker Lendecke 2006
@@ -7,12 +7,12 @@
* 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/>.
*/
@@ -140,7 +140,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx,
result = WERR_BADFILE;
goto done;
}
-
+
/* check if the path really exists; failed is indicated by -1 */
/* if the subkey count failed, bail out */
@@ -153,7 +153,7 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx,
result = WERR_BADFILE;
goto done;
}
-
+
TALLOC_FREE( subkeys );
if ( !regkey_access_check( key, access_desired, &key->access_granted,
@@ -302,7 +302,7 @@ WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
SAFE_FREE(val);
return WERR_NOMEM;
}
-
+
*pval = val;
return WERR_OK;
}
@@ -494,7 +494,6 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
TALLOC_FREE(mem_ctx);
return err;
}
-
WERROR reg_deletekey(struct registry_key *parent, const char *path)
{
@@ -712,8 +711,8 @@ WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path,
}
/*
- * Utility function to delete a registry key with all its subkeys.
- * Note that reg_deletekey returns ACCESS_DENIED when called on a
+ * Utility function to delete a registry key with all its subkeys.
+ * Note that reg_deletekey returns ACCESS_DENIED when called on a
* key that has subkeys.
*/
WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx,
@@ -739,11 +738,11 @@ WERROR reg_deletekey_recursive_internal(TALLOC_CTX *ctx,
}
while (W_ERROR_IS_OK(werr = reg_enumkey(mem_ctx, key, 0,
- &subkey_name, NULL)))
+ &subkey_name, NULL)))
{
werr = reg_deletekey_recursive_internal(mem_ctx, key,
subkey_name,
- True);
+ true);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
@@ -771,12 +770,12 @@ WERROR reg_deletekey_recursive(TALLOC_CTX *ctx,
struct registry_key *parent,
const char *path)
{
- return reg_deletekey_recursive_internal(ctx, parent, path, True);
+ return reg_deletekey_recursive_internal(ctx, parent, path, true);
}
WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx,
struct registry_key *parent,
const char *path)
{
- return reg_deletekey_recursive_internal(ctx, parent, path, False);
+ return reg_deletekey_recursive_internal(ctx, parent, path, false);
}
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 77ade5cba1..286cc210e2 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -542,7 +542,8 @@ NTSTATUS rpccli_lsa_query_info_policy2_new(struct rpc_pipe_client *cli, TALLOC_C
NTSTATUS rpccli_lsa_query_info_policy(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
POLICY_HND *pol, uint16 info_class,
- char **domain_name, DOM_SID **domain_sid)
+ const char **domain_name,
+ DOM_SID **domain_sid)
{
prs_struct qbuf, rbuf;
LSA_Q_QUERY_INFO q;
@@ -632,8 +633,9 @@ NTSTATUS rpccli_lsa_query_info_policy(struct rpc_pipe_client *cli,
NTSTATUS rpccli_lsa_query_info_policy2(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
POLICY_HND *pol, uint16 info_class,
- char **domain_name, char **dns_name,
- char **forest_name,
+ const char **domain_name,
+ const char **dns_name,
+ const char **forest_name,
struct GUID **domain_guid,
DOM_SID **domain_sid)
{
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index dd8b911bb8..081e0fb15e 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -134,7 +134,7 @@ static void fetch_machine_sid(struct cli_state *cli)
POLICY_HND pol;
NTSTATUS result = NT_STATUS_OK;
uint32 info_class = 5;
- char *domain_name = NULL;
+ const char *domain_name = NULL;
static bool got_domain_sid;
TALLOC_CTX *mem_ctx;
DOM_SID *dom_sid = NULL;
diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh
index 08bfdf601c..5a170b2117 100755
--- a/source3/script/tests/selftest.sh
+++ b/source3/script/tests/selftest.sh
@@ -186,7 +186,7 @@ cat >$SERVERCONFFILE<<EOF
map hidden = yes
map system = yes
create mask = 755
- vfs objects = $BINDIR/ea_tdb.so
+ vfs objects = $BINDIR/xattr_tdb.so
[hideunread]
copy = tmp
hide unreadable = yes
diff --git a/source3/utils/net.h b/source3/utils/net.h
index 2ffa4d77b1..3a4b1da7b0 100644
--- a/source3/utils/net.h
+++ b/source3/utils/net.h
@@ -42,7 +42,7 @@ struct rpc_sh_ctx {
struct cli_state *cli;
DOM_SID *domain_sid;
- char *domain_name;
+ const char *domain_name;
const char *whoami;
const char *thiscmd;
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 0a9020bcfd..732ba8d8b6 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -817,7 +817,7 @@ static int net_ads_leave(int argc, const char **argv)
struct cli_state *cli = NULL;
TALLOC_CTX *ctx;
DOM_SID *dom_sid = NULL;
- char *short_domain_name = NULL;
+ const char *short_domain_name = NULL;
if (!secrets_init()) {
DEBUG(1,("Failed to initialise secrets database\n"));
@@ -961,7 +961,8 @@ static NTSTATUS check_ads_config( void )
********************************************************************/
static NTSTATUS net_join_domain(TALLOC_CTX *ctx, const char *servername,
- struct sockaddr_storage *pss, char **domain,
+ struct sockaddr_storage *pss,
+ const char **domain,
DOM_SID **dom_sid,
const char *password)
{
@@ -1445,7 +1446,7 @@ int net_ads_join(int argc, const char **argv)
ADS_STRUCT *ads = NULL;
ADS_STATUS status;
NTSTATUS nt_status;
- char *short_domain_name = NULL;
+ const char *short_domain_name = NULL;
char *tmp_password, *password;
TALLOC_CTX *ctx = NULL;
DOM_SID *domain_sid = NULL;
diff --git a/source3/utils/net_domain.c b/source3/utils/net_domain.c
index 3f1908e242..da5e61caf0 100644
--- a/source3/utils/net_domain.c
+++ b/source3/utils/net_domain.c
@@ -157,7 +157,7 @@ int netdom_store_machine_account( const char *domain, DOM_SID *sid, const char *
********************************************************************/
NTSTATUS netdom_get_domain_sid( TALLOC_CTX *mem_ctx, struct cli_state *cli,
- char **domain, DOM_SID **sid )
+ const char **domain, DOM_SID **sid )
{
struct rpc_pipe_client *pipe_hnd = NULL;
POLICY_HND lsa_pol;
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 2bd867fff3..677924649c 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -51,7 +51,8 @@ static bool sync_files(struct copy_clistate *cp_clistate, const char *mask);
**/
NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
- DOM_SID **domain_sid, char **domain_name)
+ DOM_SID **domain_sid,
+ const char **domain_name)
{
struct rpc_pipe_client *lsa_pipe;
POLICY_HND pol;
@@ -112,7 +113,7 @@ int run_rpc_command(struct cli_state *cli_arg,
TALLOC_CTX *mem_ctx;
NTSTATUS nt_status;
DOM_SID *domain_sid;
- char *domain_name;
+ const char *domain_name;
/* make use of cli_state handed over as an argument, if possible */
if (!cli_arg) {
@@ -5607,7 +5608,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
DOM_SID *domain_sid;
char* domain_name;
- char* domain_name_pol;
+ const char* domain_name_pol;
char* acct_name;
fstring pdc_name;
char *dc_name;
@@ -5917,7 +5918,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
DOM_SID *domain_sids;
char **trusted_dom_names;
fstring pdc_name;
- char *dummy;
+ const char *dummy;
/*
* Listing trusted domains (stored in secrets.tdb, if local)
@@ -6057,7 +6058,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
DOM_SID *domain_sids;
char **trusted_dom_names;
fstring pdc_name;
- char *dummy;
+ const char *dummy;
/* trusting domains listing variables */
POLICY_HND domain_hnd;
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index 0c25a53365..6e37f3c84c 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -155,7 +155,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
NTSTATUS result;
int retval = 1;
- char *domain = NULL;
+ const char *domain = NULL;
uint32 num_rids, *name_types, *user_rids;
uint32 flags = 0x3e8;
char *acct_name;
@@ -413,7 +413,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
/* Now store the secret in the secrets database */
- strupper_m(domain);
+ strupper_m(CONST_DISCARD(char *, domain));
if (!secrets_store_domain_sid(domain, domain_sid)) {
DEBUG(0, ("error storing domain sid for %s\n", domain));
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index a9155a5763..908228717e 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1799,9 +1799,9 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain )
struct rpc_pipe_client *cli;
POLICY_HND pol;
- char *domain_name = NULL;
- char *dns_name = NULL;
- char *forest_name = NULL;
+ const char *domain_name = NULL;
+ const char *dns_name = NULL;
+ const char *forest_name = NULL;
DOM_SID *dom_sid = NULL;
ZERO_STRUCT( ctr );