summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-12-13 16:21:27 +0100
committerGünther Deschner <gd@samba.org>2007-12-21 15:29:10 +0100
commit5b5f75d229978d5b9fe14dca768fd8b68d2ab319 (patch)
tree59119de62c093b2aa7cfd24f713cb97936030865 /source3/lib/netapi
parent7482a18c83d25b2d00e1086aafb33d9a0ff98309 (diff)
downloadsamba-5b5f75d229978d5b9fe14dca768fd8b68d2ab319.tar.gz
samba-5b5f75d229978d5b9fe14dca768fd8b68d2ab319.tar.bz2
samba-5b5f75d229978d5b9fe14dca768fd8b68d2ab319.zip
Fill in local branch of NetGetJoinInformation().
Guenther (This used to be commit 46db8754511f915c296771e08e822ba810f804d5)
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/joindomain.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 96983d43e3..bc26c22370 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -282,6 +282,32 @@ WERROR NetGetJoinInformation(const char *server_name,
goto done;
}
+ if (!server_name || is_myname_or_ipaddr(server_name)) {
+ if ((lp_security() == SEC_ADS) && lp_realm()) {
+ *name_buffer = SMB_STRDUP(lp_realm());
+ } else {
+ *name_buffer = SMB_STRDUP(lp_workgroup());
+ }
+ if (!*name_buffer) {
+ werr = WERR_NOMEM;
+ goto done;
+ }
+ switch (lp_server_role()) {
+ case ROLE_DOMAIN_MEMBER:
+ case ROLE_DOMAIN_PDC:
+ case ROLE_DOMAIN_BDC:
+ *name_type = NetSetupDomainName;
+ break;
+ case ROLE_STANDALONE:
+ default:
+ *name_type = NetSetupWorkgroupName;
+ break;
+ }
+
+ werr = WERR_OK;
+ goto done;
+ }
+
status = cli_full_connection(&cli, NULL, server_name,
NULL, 0,
"IPC$", "IPC",