From 814b2c730b2f38767712a005bf328a4a04478f63 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
Date: Fri, 17 May 2013 15:14:35 +0200
Subject: [PATCH 1/2] s3-libads: Fail
 create_local_private_krb5_conf_for_domain() if parameters missing.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 6dc7c63efa95d0c04b542667d9b6a6621c8139bf)
---
 source3/libads/kerberos.c | 4 ++++
 1 file changed, 4 insertions(+)

Index: samba-3.6.22/source3/libads/kerberos.c
===================================================================
--- samba-3.6.22.orig/source3/libads/kerberos.c
+++ samba-3.6.22/source3/libads/kerberos.c
@@ -866,6 +866,16 @@ bool create_local_private_krb5_conf_for_
 		return false;
 	}
 
+	if (realm == NULL) {
+		DEBUG(0, ("No realm has been specified! Do you really want to "
+			  "join an Active Directory server?\n"));
+		return false;
+	}
+
+	if (domain == NULL || pss == NULL || kdc_name == NULL) {
+		return false;
+	}
+
 	dname = lock_path("smb_krb5");
 	if (!dname) {
 		return false;
