diff options
author | Jeremy Allison <jra@samba.org> | 2008-08-29 09:29:21 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-08-29 09:29:21 -0700 |
commit | 8f525afbd2f2a849086c60ee890218a070cecd34 (patch) | |
tree | b4398adfa7e57dacf7f7d9b29b4a14f6596d6fe0 /source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c | |
parent | b12c7dbb53023d1ea9e7df20137c0ad6ba21b9f0 (diff) | |
parent | d2dc2e34be6f13956a91678bcb8dd098fb0e5c8b (diff) | |
download | samba-8f525afbd2f2a849086c60ee890218a070cecd34.tar.gz samba-8f525afbd2f2a849086c60ee890218a070cecd34.tar.bz2 samba-8f525afbd2f2a849086c60ee890218a070cecd34.zip |
Merge branch 'v3-devel' of ssh://jra@git.samba.org/data/git/samba into v3-devel
(This used to be commit 882297edc024c146f24fc9f847d2b0b813f93fc7)
Diffstat (limited to 'source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c')
-rw-r--r-- | source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c index 418b9c8b8e..4e0488ed59 100644 --- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c +++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c @@ -38,11 +38,6 @@ #define SAMBA_IMAGE_PATH "/usr/share/pixmaps/samba/logo.png" #define SAMBA_IMAGE_PATH_SMALL "/usr/share/pixmaps/samba/logo-small.png" -#define WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED ( 0x00000020 ) -#define WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE ( 0x00000004 ) -#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 ) -#define WKSSVC_JOIN_FLAGS_JOIN_TYPE ( 0x00000001 ) - #define NetSetupWorkgroupName ( 2 ) #define NetSetupDomainName ( 3 ) @@ -631,9 +626,9 @@ static void callback_do_join(GtkWidget *widget, if (state->name_type_new == NetSetupDomainName) { domain_join = TRUE; join_creds_required = TRUE; - join_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE | - WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE | - WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED; /* for testing */ + join_flags = NETSETUP_JOIN_DOMAIN | + NETSETUP_ACCT_CREATE | + NETSETUP_DOMAIN_JOIN_IF_JOINED; /* for testing */ } if ((state->name_type_initial == NetSetupDomainName) && @@ -641,8 +636,8 @@ static void callback_do_join(GtkWidget *widget, try_unjoin = TRUE; unjoin_creds_required = TRUE; join_creds_required = FALSE; - unjoin_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE | - WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE; + unjoin_flags = NETSETUP_JOIN_DOMAIN | + NETSETUP_ACCT_DELETE; } if (try_unjoin) { @@ -823,9 +818,13 @@ static void callback_enter_hostname_and_unlock(GtkWidget *widget, } state->hostname_changed = TRUE; if (state->name_type_initial == NetSetupDomainName) { - asprintf(&str, "%s.%s", entry_text, state->my_dnsdomain); + if (asprintf(&str, "%s.%s", entry_text, state->my_dnsdomain) == -1) { + return; + } } else { - asprintf(&str, "%s.", entry_text); + if (asprintf(&str, "%s.", entry_text) == -1) { + return; + } } gtk_label_set_text(GTK_LABEL(state->label_full_computer_name), str); free(str); @@ -1132,10 +1131,14 @@ static void callback_do_change(GtkWidget *widget, char *str = NULL; entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); if (state->name_type_initial == NetSetupDomainName) { - asprintf(&str, "%s.%s", entry_text, - state->my_dnsdomain); + if (asprintf(&str, "%s.%s", entry_text, + state->my_dnsdomain) == -1) { + return; + } } else { - asprintf(&str, "%s.", entry_text); + if (asprintf(&str, "%s.", entry_text) == -1) { + return; + } } gtk_label_set_text(GTK_LABEL(state->label_full_computer_name), str); @@ -1436,10 +1439,14 @@ static int draw_main_window(struct join_state *state) /* Label */ char *str = NULL; if (state->name_type_initial == NetSetupDomainName) { - asprintf(&str, "%s.%s", state->my_hostname, - state->my_dnsdomain); + if (asprintf(&str, "%s.%s", state->my_hostname, + state->my_dnsdomain) == -1) { + return -1; + } } else { - asprintf(&str, "%s.", state->my_hostname); + if (asprintf(&str, "%s.", state->my_hostname) == -1) { + return -1; + } } label = gtk_label_new(str); |