[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-2529-g6f12d0c
Günther Deschner
gd at samba.org
Mon Jun 9 08:24:08 GMT 2008
The branch, v3-2-test has been updated
via 6f12d0c150c4b8ed0730e994545b2a4db7de6d2f (commit)
via c40db0443f4e88facfe24c665148bb76f971b8da (commit)
from 8d4ce48377df7be336d520de9b108f45489c9766 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 6f12d0c150c4b8ed0730e994545b2a4db7de6d2f
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
(cherry picked from commit 2870fe50af5163e30330f5a3ef21d0b7eea85ee5)
commit c40db0443f4e88facfe24c665148bb76f971b8da
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
(cherry picked from commit b3d47f099286778252c6df6bf2c1fee0c4e26560)
-----------------------------------------------------------------------
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 a69ccea..b19d90b 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -1332,6 +1332,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;
@@ -1358,6 +1360,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;
@@ -1728,6 +1732,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)
{
@@ -1747,17 +1780,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