diff options
author | Günther Deschner <gd@samba.org> | 2009-05-12 22:15:04 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-05-12 22:49:05 +0200 |
commit | 3e2975b3bdd247d1e3e7c74bada2f85a1936acaf (patch) | |
tree | 8aa0bf23af5d7516b737348d7986b0b7afaa8e7b /source3/lib/netapi/examples/netdomjoin-gui | |
parent | 20b5fc02d2e97dbd51d84cc05ac887e274b14866 (diff) | |
download | samba-3e2975b3bdd247d1e3e7c74bada2f85a1936acaf.tar.gz samba-3e2975b3bdd247d1e3e7c74bada2f85a1936acaf.tar.bz2 samba-3e2975b3bdd247d1e3e7c74bada2f85a1936acaf.zip |
s3-netdomjoin-gui: use NetServerGetInfo() level 101 to get hostname.
Guenther
Diffstat (limited to 'source3/lib/netapi/examples/netdomjoin-gui')
-rw-r--r-- | source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c index fd487480d3..2af4eddaa3 100644 --- a/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c +++ b/source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c @@ -1623,7 +1623,7 @@ static int init_join_state(struct join_state **state) return 0; } -static NET_API_STATUS get_server_comment(struct join_state *state) +static NET_API_STATUS get_server_properties(struct join_state *state) { struct SERVER_INFO_101 *info101 = NULL; struct SERVER_INFO_1005 *info1005 = NULL; @@ -1637,6 +1637,11 @@ static NET_API_STATUS get_server_comment(struct join_state *state) if (!state->comment) { return -1; } + SAFE_FREE(state->my_hostname); + state->my_hostname = strdup(info101->sv101_name); + if (!state->my_hostname) { + return -1; + } NetApiBufferFree(info101); return NET_API_STATUS_SUCCESS; } @@ -1772,7 +1777,7 @@ static int initialize_join_state(struct join_state *state, NetApiBufferFree((void *)buffer); } - status = get_server_comment(state); + status = get_server_properties(state); if (status != 0) { return -1; } |