From c55b894f90c0ff8db9ba2f0b5376a78d6436c913 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Mon, 14 Dec 2015 11:17:37 +0100
Subject: [PATCH 04/16] KRB5: Mark globals in krb5_opts.h as extern

To avoid collisions when we want to work with them elsewhere in the code.
---
 Makefile.am                                     |  5 +++++
 src/providers/krb5/{krb5_opts.h => krb5_opts.c} |  5 -----
 src/providers/krb5/krb5_opts.h                  | 24 +-----------------------
 3 files changed, 6 insertions(+), 28 deletions(-)
 copy src/providers/krb5/{krb5_opts.h => krb5_opts.c} (97%)

diff --git a/Makefile.am b/Makefile.am
index 78a6de7de68c9f836981d1dfb8790870739888f4..a9d3f25d3775f6ac824b9f9b85dd0412417c33d3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1518,6 +1518,7 @@ krb5_utils_tests_SOURCES = \
     src/providers/krb5/krb5_utils.c \
     src/providers/krb5/krb5_ccache.c \
     src/providers/krb5/krb5_common.c \
+    src/providers/krb5/krb5_opts.c \
     src/util/sss_krb5.c \
     src/providers/data_provider_fo.c \
     src/providers/data_provider_opts.c \
@@ -1655,6 +1656,7 @@ ipa_ldap_opt_tests_SOURCES = \
     src/providers/ldap/ldap_opts.c \
     src/providers/ad/ad_opts.c \
     src/providers/ipa/ipa_opts.c \
+    src/providers/krb5/krb5_opts.c \
     src/util/sss_ldap.c \
     src/tests/ipa_ldap_opt-tests.c
 ipa_ldap_opt_tests_CFLAGS = \
@@ -1671,6 +1673,7 @@ ipa_ldap_opt_tests_LDADD = \
 ad_ldap_opt_tests_SOURCES = \
     src/providers/ldap/ldap_opts.c \
     src/providers/ad/ad_opts.c \
+    src/providers/krb5/krb5_opts.c \
     src/tests/ad_ldap_opt-tests.c
 ad_ldap_opt_tests_CFLAGS = \
     $(AM_CFLAGS) \
@@ -1792,6 +1795,7 @@ krb5_child_test_SOURCES = \
     src/providers/krb5/krb5_ccache.c \
     src/providers/krb5/krb5_child_handler.c \
     src/providers/krb5/krb5_common.c \
+    src/providers/krb5/krb5_opts.c \
     src/util/sss_krb5.c \
     src/providers/data_provider_fo.c \
     src/providers/data_provider_opts.c \
@@ -2869,6 +2873,7 @@ libsss_krb5_common_la_SOURCES = \
     src/providers/krb5/krb5_renew_tgt.c \
     src/providers/krb5/krb5_wait_queue.c \
     src/providers/krb5/krb5_common.c \
+    src/providers/krb5/krb5_opts.c \
     src/providers/krb5/krb5_auth.c \
     src/providers/krb5/krb5_access.c \
     src/providers/krb5/krb5_child_handler.c \
diff --git a/src/providers/krb5/krb5_opts.h b/src/providers/krb5/krb5_opts.c
similarity index 97%
copy from src/providers/krb5/krb5_opts.h
copy to src/providers/krb5/krb5_opts.c
index 50d701b8ba431719dbf67799230ec345cdee30a9..6bec52767897ba946cf492f9a2e6e4b91a55fba1 100644
--- a/src/providers/krb5/krb5_opts.h
+++ b/src/providers/krb5/krb5_opts.c
@@ -20,9 +20,6 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#ifndef KRB5_OPTS_H_
-#define KRB5_OPTS_H_
-
 #include "src/providers/data_provider.h"
 
 struct dp_option default_krb5_opts[] = {
@@ -48,5 +45,3 @@ struct dp_option default_krb5_opts[] = {
     { "krb5_map_user", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     DP_OPTION_TERMINATOR
 };
-
-#endif /* KRB5_OPTS_H_ */
diff --git a/src/providers/krb5/krb5_opts.h b/src/providers/krb5/krb5_opts.h
index 50d701b8ba431719dbf67799230ec345cdee30a9..798008dc376c7fca89761258e3bdff2a683420bb 100644
--- a/src/providers/krb5/krb5_opts.h
+++ b/src/providers/krb5/krb5_opts.h
@@ -25,28 +25,6 @@
 
 #include "src/providers/data_provider.h"
 
-struct dp_option default_krb5_opts[] = {
-    { "krb5_server", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_backup_server", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_realm", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_ccachedir", DP_OPT_STRING, { DEFAULT_CCACHE_DIR }, NULL_STRING },
-    { "krb5_ccname_template", DP_OPT_STRING, NULL_STRING, NULL_STRING},
-    { "krb5_auth_timeout", DP_OPT_NUMBER, { .number = 6 }, NULL_NUMBER },
-    { "krb5_keytab", DP_OPT_STRING, { "/etc/krb5.keytab" }, NULL_STRING },
-    { "krb5_validate", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
-    { "krb5_kpasswd", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_backup_kpasswd", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_store_password_if_offline", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
-    { "krb5_renewable_lifetime", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_lifetime", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "krb5_renew_interval", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    { "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_use_enterprise_principal", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
-    { "krb5_use_kdcinfo", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE },
-    { "krb5_map_user", DP_OPT_STRING, NULL_STRING, NULL_STRING },
-    DP_OPTION_TERMINATOR
-};
+extern struct dp_option default_krb5_opts[];
 
 #endif /* KRB5_OPTS_H_ */
-- 
2.1.0

