[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-2735-g2870fe5
Günther Deschner
gd at samba.org
Thu Jun 5 17:38:29 GMT 2008
The branch, v3-3-test has been updated
via 2870fe50af5163e30330f5a3ef21d0b7eea85ee5 (commit)
via b3d47f099286778252c6df6bf2c1fee0c4e26560 (commit)
from 1ce726b951621cb4b34069c31d1318fc04ad2389 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit 2870fe50af5163e30330f5a3ef21d0b7eea85ee5
Author: Günther Deschner <gd at samba.org>
Date: Thu Jun 5 19:00:05 2008 +0200
libnetjoin: add libnet_join_rollback().
This is required now if the join verify failed and we already
modified the local configuration.
Guenther
commit b3d47f099286778252c6df6bf2c1fee0c4e26560
Author: Günther Deschner <gd at samba.org>
Date: Thu Jun 5 18:58:27 2008 +0200
libnetjoin: First store configuration and then verify the join.
Jerry, this fixes the issues while joining with "config backend = registry".
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/libnet/libnet_join.c | 46 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 41 insertions(+), 5 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 3b2bce9..3678ff9 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -1333,6 +1333,8 @@ static WERROR do_JoinConfig(struct libnet_JoinCtx *r)
return werr;
}
+ lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
+
r->out.modified_config = true;
r->out.result = werr;
@@ -1359,6 +1361,8 @@ static WERROR libnet_unjoin_config(struct libnet_UnjoinCtx *r)
return werr;
}
+ lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
+
r->out.modified_config = true;
r->out.result = werr;
@@ -1729,6 +1733,35 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
/****************************************************************
****************************************************************/
+WERROR libnet_join_rollback(TALLOC_CTX *mem_ctx,
+ struct libnet_JoinCtx *r)
+{
+ WERROR werr;
+ struct libnet_UnjoinCtx *u = NULL;
+
+ werr = libnet_init_UnjoinCtx(mem_ctx, &u);
+ if (!W_ERROR_IS_OK(werr)) {
+ return werr;
+ }
+
+ u->in.debug = r->in.debug;
+ u->in.dc_name = r->in.dc_name;
+ u->in.domain_name = r->in.domain_name;
+ u->in.admin_account = r->in.admin_account;
+ u->in.admin_password = r->in.admin_password;
+ u->in.modify_config = r->in.modify_config;
+ u->in.unjoin_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE |
+ WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE;
+
+ werr = libnet_Unjoin(mem_ctx, u);
+ TALLOC_FREE(u);
+
+ return werr;
+}
+
+/****************************************************************
+****************************************************************/
+
WERROR libnet_Join(TALLOC_CTX *mem_ctx,
struct libnet_JoinCtx *r)
{
@@ -1748,17 +1781,20 @@ WERROR libnet_Join(TALLOC_CTX *mem_ctx,
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
-
- werr = libnet_join_post_verify(mem_ctx, r);
- if (!W_ERROR_IS_OK(werr)) {
- goto done;
- }
}
werr = libnet_join_post_processing(mem_ctx, r);
if (!W_ERROR_IS_OK(werr)) {
goto done;
}
+
+ if (r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) {
+ werr = libnet_join_post_verify(mem_ctx, r);
+ if (!W_ERROR_IS_OK(werr)) {
+ libnet_join_rollback(mem_ctx, r);
+ }
+ }
+
done:
r->out.result = werr;
--
Samba Shared Repository
More information about the samba-cvs
mailing list