[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-2391-g46985b3
Günther Deschner
gd at samba.org
Wed May 21 10:16:13 GMT 2008
The branch, v3-2-test has been updated
via 46985b309f9cf3261d34746294ac13e56ac283e4 (commit)
via ee196b77b1f8fa35c5127958962a7f1a68665c1e (commit)
from d923d3acdf2c47e8d1dff0951edabe37ba5078c0 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 46985b309f9cf3261d34746294ac13e56ac283e4
Author: Günther Deschner <gd at samba.org>
Date: Fri May 16 12:11:43 2008 +0200
netdomjoin-gui: before prompting for creds (for receiving joinable ous), find a dc.
Guenther
(cherry picked from commit ae60695a349bccd1128e6c439664b0607627ef23)
commit ee196b77b1f8fa35c5127958962a7f1a68665c1e
Author: Günther Deschner <gd at samba.org>
Date: Thu May 8 01:07:10 2008 +0200
netdomjoin-gui: before prompting for creds, ask dsgetdcname for a dc.
Guenther
(cherry picked from commit 47146effc1c2bca516d4fbccf221b5b0e02737bf)
-----------------------------------------------------------------------
Summary of changes:
.../examples/netdomjoin-gui/netdomjoin-gui.c | 67 +++++++++++++++++++-
1 files changed, 66 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
index 5ce4ca2..df81937 100644
--- a/source/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
+++ b/source/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
@@ -670,6 +670,41 @@ static void callback_do_join(GtkWidget *widget,
}
+ /* before prompting for creds, make sure we can find a dc */
+
+ if (domain_join) {
+
+ struct DOMAIN_CONTROLLER_INFO *dc_info = NULL;
+
+ status = DsGetDcName(NULL,
+ state->name_buffer_new,
+ NULL,
+ NULL,
+ 0,
+ &dc_info);
+ if (status != 0) {
+ err_str = libnetapi_get_error_string(state->ctx, status);
+ g_print("callback_do_join: failed find dc (%s)\n", err_str);
+
+ dialog = gtk_message_dialog_new(GTK_WINDOW(state->window_parent),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ "Failed to find a domain controller for domain: \"%s\": %s",
+ state->name_buffer_new,
+ err_str);
+
+ gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
+ g_signal_connect_swapped(dialog, "response",
+ G_CALLBACK(gtk_widget_destroy),
+ dialog);
+
+ gtk_widget_show(dialog);
+
+ return;
+ }
+ }
+
if (join_creds_required) {
if (!state->account || !state->password) {
debug("callback_do_join: no creds yet\n");
@@ -897,6 +932,9 @@ static void callback_do_getous(GtkWidget *widget,
const char **ous = NULL;
int i;
const char *domain = NULL;
+ struct DOMAIN_CONTROLLER_INFO *dc_info = NULL;
+ const char *err_str = NULL;
+ GtkWidget *dialog;
struct join_state *state = (struct join_state *)data;
@@ -904,6 +942,34 @@ static void callback_do_getous(GtkWidget *widget,
domain = state->name_buffer_new ? state->name_buffer_new : state->name_buffer_initial;
+ status = DsGetDcName(NULL,
+ domain,
+ NULL,
+ NULL,
+ 0,
+ &dc_info);
+ if (status != 0) {
+ err_str = libnetapi_get_error_string(state->ctx, status);
+ g_print("callback_do_getous: failed find dc (%s)\n", err_str);
+
+ dialog = gtk_message_dialog_new(GTK_WINDOW(state->window_parent),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ "Failed to find a domain controller for domain: \"%s\": %s",
+ domain,
+ err_str);
+
+ gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
+ g_signal_connect_swapped(dialog, "response",
+ G_CALLBACK(gtk_widget_destroy),
+ dialog);
+
+ gtk_widget_show(dialog);
+
+ return;
+ }
+
if (!state->account || !state->password) {
debug("callback_do_getous: no creds yet\n");
callback_creds_prompt(NULL, state,
@@ -921,7 +987,6 @@ static void callback_do_getous(GtkWidget *widget,
state->password,
&num_ous, &ous);
if (status != NET_API_STATUS_SUCCESS) {
- GtkWidget *dialog;
callback_do_freeauth(NULL, state);
debug("failed to call NetGetJoinableOUs: %s\n",
libnetapi_get_error_string(state->ctx, status));
--
Samba Shared Repository
More information about the samba-cvs
mailing list