summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-27 17:45:20 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-11-27 17:45:20 +0100
commit663a1f599aa163ebb5c81c02988c07cb1f0e3e6c (patch)
treea85e8d201463d259d12f16fa4fb6e2ca7c1cf2af
parent33188999b5a346ed2a7114f678bfb3c2d5e7ca34 (diff)
downloadsamba-663a1f599aa163ebb5c81c02988c07cb1f0e3e6c.tar.gz
samba-663a1f599aa163ebb5c81c02988c07cb1f0e3e6c.tar.bz2
samba-663a1f599aa163ebb5c81c02988c07cb1f0e3e6c.zip
s4:winbind - Fix it another time up
The first fix attempt did break some configurations (incl. "make test"). This now is the right fix with the right comment.
-rw-r--r--source4/winbind/wb_setup_domains.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source4/winbind/wb_setup_domains.c b/source4/winbind/wb_setup_domains.c
index 6b4fd891c5..5ce6500d4d 100644
--- a/source4/winbind/wb_setup_domains.c
+++ b/source4/winbind/wb_setup_domains.c
@@ -27,11 +27,23 @@ NTSTATUS wbsrv_setup_domains(struct wbsrv_service *service)
{
const struct dom_sid *primary_sid;
+ /*
+ * This is a bit more difficult here: when we are a domain controller
+ * or a joined domain member the first call will work. But if we are
+ * a standalone server or unjoined member then the second is the right
+ * one.
+ */
primary_sid = secrets_get_domain_sid(service,
service->task->event_ctx,
service->task->lp_ctx,
- lp_sam_name(service->task->lp_ctx));
- if (!primary_sid) {
+ lp_workgroup(service->task->lp_ctx));
+ if (primary_sid == NULL) {
+ primary_sid = secrets_get_domain_sid(service,
+ service->task->event_ctx,
+ service->task->lp_ctx,
+ lp_netbios_name(service->task->lp_ctx));
+ }
+ if (primary_sid == NULL) {
return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
}