From fcc05e9d7f49237a4f1251fcbc0d9c88270e53ff Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Wed, 28 Mar 2012 11:46:44 -0400
Subject: [PATCH 2/6] Add terminator for dp_option

---
 src/providers/data_provider.h  |    2 ++
 src/providers/ipa/ipa_opts.h   |    9 ++++++---
 src/providers/krb5/krb5_opts.h |    3 ++-
 src/providers/ldap/ldap_opts.h |    3 ++-
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/providers/data_provider.h b/src/providers/data_provider.h
index f70d556a74d18e695b601ffccf54179f0d697dab..d119c2b58d94ffcb801e3e0506f369e7f6eea3ce 100644
--- a/src/providers/data_provider.h
+++ b/src/providers/data_provider.h
@@ -257,6 +257,8 @@ struct dp_option {
     union dp_opt_value val;
 };
 
+#define DP_OPTION_TERMINATOR { NULL, 0, NULL_STRING, NULL_STRING }
+
 int dp_get_options(TALLOC_CTX *memctx,
                    struct confdb_ctx *cdb,
                    const char *conf_path,
diff --git a/src/providers/ipa/ipa_opts.h b/src/providers/ipa/ipa_opts.h
index 0b6cce1f2c08584b17a022eb01719a26742650d5..7f858e2f51971e46a6c90dc16ffd7a6ac4f6a583 100644
--- a/src/providers/ipa/ipa_opts.h
+++ b/src/providers/ipa/ipa_opts.h
@@ -42,7 +42,8 @@ struct dp_option ipa_basic_opts[] = {
     { "ipa_hbac_refresh", DP_OPT_NUMBER, { .number = 5 }, NULL_NUMBER },
     { "ipa_hbac_treat_deny_as", DP_OPT_STRING, { "DENY_ALL" }, NULL_STRING },
     { "ipa_hbac_support_srchost", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
-    { "ipa_automount_location", DP_OPT_STRING, { "default" }, NULL_STRING }
+    { "ipa_automount_location", DP_OPT_STRING, { "default" }, NULL_STRING },
+    DP_OPTION_TERMINATOR
 };
 
 struct dp_option ipa_def_ldap_opts[] = {
@@ -110,7 +111,8 @@ struct dp_option ipa_def_ldap_opts[] = {
     { "ldap_deref_threshold", DP_OPT_NUMBER, { .number = 10 }, NULL_NUMBER },
     { "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
     { "ldap_connection_expire_timeout", DP_OPT_NUMBER, { .number = 900 }, NULL_NUMBER },
-    { "ldap_disable_paging", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }
+    { "ldap_disable_paging", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
+    DP_OPTION_TERMINATOR
 };
 
 struct sdap_attr_map ipa_attr_map[] = {
@@ -223,7 +225,8 @@ struct dp_option ipa_def_krb5_opts[] = {
     { "krb5_renew_interval", DP_OPT_NUMBER, NULL_NUMBER, NULL_NUMBER },
     { "krb5_use_fast", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "krb5_fast_principal", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_canonicalize", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE }
+    { "krb5_canonicalize", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE },
+    DP_OPTION_TERMINATOR
 };
 
 struct sdap_attr_map ipa_service_map[] = {
diff --git a/src/providers/krb5/krb5_opts.h b/src/providers/krb5/krb5_opts.h
index 9c3292fef687aedcf930617b47b0ae6d8579c649..7f47290c961ce6455e0d123e9ec14c7add39d28d 100644
--- a/src/providers/krb5/krb5_opts.h
+++ b/src/providers/krb5/krb5_opts.h
@@ -40,7 +40,8 @@ struct dp_option default_krb5_opts[] = {
     { "krb5_renew_interval", DP_OPT_NUMBER, NULL_NUMBER, NULL_NUMBER },
     { "krb5_use_fast", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "krb5_fast_principal", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }
+    { "krb5_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
+    DP_OPTION_TERMINATOR
 };
 
 #endif /* KRB5_OPTS_H_ */
diff --git a/src/providers/ldap/ldap_opts.h b/src/providers/ldap/ldap_opts.h
index f6208a3dab5d6e3064583ed4c7d445167861a8f9..b10155346fe9f356b24ca900bf7356e2553df843 100644
--- a/src/providers/ldap/ldap_opts.h
+++ b/src/providers/ldap/ldap_opts.h
@@ -94,7 +94,8 @@ struct dp_option default_basic_opts[] = {
     { "ldap_deref_threshold", DP_OPT_NUMBER, { .number = 10 }, NULL_NUMBER },
     { "ldap_sasl_canonicalize", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
     { "ldap_connection_expire_timeout", DP_OPT_NUMBER, { .number = 900 }, NULL_NUMBER },
-    { "ldap_disable_paging", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE }
+    { "ldap_disable_paging", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
+    DP_OPTION_TERMINATOR
 };
 
 struct sdap_attr_map generic_attr_map[] = {
-- 
1.7.7.6

