From 4bd9dcd15391b527b8648639186ed57ed0423f1a Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Wed, 11 Apr 2012 21:06:36 -0400
Subject: [PATCH 02/20] LDAP: Add id-mapping option

---
 src/config/SSSDConfig.py                 |    1 +
 src/config/etc/sssd.api.d/sssd-ipa.conf  |    1 +
 src/config/etc/sssd.api.d/sssd-ldap.conf |    1 +
 src/providers/ipa/ipa_opts.h             |    1 +
 src/providers/ldap/ldap_opts.h           |    1 +
 src/providers/ldap/sdap.h                |    1 +
 6 files changed, 6 insertions(+)

diff --git a/src/config/SSSDConfig.py b/src/config/SSSDConfig.py
index 16ce550529eec702ae9c1efa2d1f2ed713b587a8..3433cb62f8ab0eaa0626532d2061b6a298e0a7b7 100644
--- a/src/config/SSSDConfig.py
+++ b/src/config/SSSDConfig.py
@@ -193,6 +193,7 @@ option_strings = {
     'ldap_enumeration_refresh_timeout' : _('Length of time between enumeration updates'),
     'ldap_purge_cache_timeout' : _('Length of time between cache cleanups'),
     'ldap_id_use_start_tls' : _('Require TLS for ID lookups'),
+    'ldap_id_mapping' : _('Use ID-mapping of objectSID instead of pre-set IDs'),
     'ldap_user_search_base' : _('Base DN for user lookups'),
     'ldap_user_search_scope' : _('Scope of user lookups'),
     'ldap_user_search_filter' : _('Filter for user lookups'),
diff --git a/src/config/etc/sssd.api.d/sssd-ipa.conf b/src/config/etc/sssd.api.d/sssd-ipa.conf
index 7e3d3ff7f036a04427ec50e3d11f4b986e8cc9a1..162dab579dece30e7e51191bebc6d71e17fc475a 100644
--- a/src/config/etc/sssd.api.d/sssd-ipa.conf
+++ b/src/config/etc/sssd.api.d/sssd-ipa.conf
@@ -49,6 +49,7 @@ ldap_search_timeout = int, None, false
 ldap_enumeration_refresh_timeout = int, None, false
 ldap_purge_cache_timeout = int, None, false
 ldap_id_use_start_tls = bool, None, false
+ldap_id_mapping = bool, None, false
 ldap_user_search_base = str, None, false
 ldap_user_search_scope = str, None, false
 ldap_user_search_filter = str, None, false
diff --git a/src/config/etc/sssd.api.d/sssd-ldap.conf b/src/config/etc/sssd.api.d/sssd-ldap.conf
index df602784b74fc62314d37eeb1a22b8fa7ff0827f..766216f64ebe964d6f29e84c14196cdaf3548d31 100644
--- a/src/config/etc/sssd.api.d/sssd-ldap.conf
+++ b/src/config/etc/sssd.api.d/sssd-ldap.conf
@@ -41,6 +41,7 @@ ldap_enumeration_search_timeout = int, None, false
 ldap_enumeration_refresh_timeout = int, None, false
 ldap_purge_cache_timeout = int, None, false
 ldap_id_use_start_tls = bool, None, false
+ldap_id_mapping = bool, None, false
 ldap_user_search_base = str, None, false
 ldap_user_search_scope = str, None, false
 ldap_user_search_filter = str, None, false
diff --git a/src/providers/ipa/ipa_opts.h b/src/providers/ipa/ipa_opts.h
index 48c839de7e854d45885defc50a7d24e747f24734..75ce632e09b62ad8331f78cb3f3e3f3b775aeeaf 100644
--- a/src/providers/ipa/ipa_opts.h
+++ b/src/providers/ipa/ipa_opts.h
@@ -79,6 +79,7 @@ struct dp_option ipa_def_ldap_opts[] = {
     { "ldap_tls_key", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_tls_cipher_suite", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_id_use_start_tls", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
+    { "ldap_id_mapping", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
     { "ldap_sasl_mech", DP_OPT_STRING, { "GSSAPI" } , NULL_STRING },
     { "ldap_sasl_authid", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_sasl_realm", DP_OPT_STRING, NULL_STRING, NULL_STRING },
diff --git a/src/providers/ldap/ldap_opts.h b/src/providers/ldap/ldap_opts.h
index a609aca9078d3be4627245d19eaf62fbf4f088c5..1f9ca57a892b90208eacfabb4ad13ce6aecc3ef3 100644
--- a/src/providers/ldap/ldap_opts.h
+++ b/src/providers/ldap/ldap_opts.h
@@ -61,6 +61,7 @@ struct dp_option default_basic_opts[] = {
     { "ldap_tls_key", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_tls_cipher_suite", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_id_use_start_tls", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
+    { "ldap_id_mapping", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
     { "ldap_sasl_mech", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_sasl_authid", DP_OPT_STRING, NULL_STRING, NULL_STRING },
     { "ldap_sasl_realm", DP_OPT_STRING, NULL_STRING, NULL_STRING },
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index 5109ea86ade7c41b986f0420ecf12a5e4615dbb5..9ef880042237bb2b85252667f67c24d31e0cd3d6 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -180,6 +180,7 @@ enum sdap_basic_opt {
     SDAP_TLS_KEY,
     SDAP_TLS_CIPHER_SUITE,
     SDAP_ID_TLS,
+    SDAP_ID_MAPPING,
     SDAP_SASL_MECH,
     SDAP_SASL_AUTHID,
     SDAP_SASL_REALM,
-- 
1.7.10

