From 63a2bd3e571307e66aeef89f947fa460122dcda4 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 8 Jun 2010 08:14:35 -0400
Subject: [PATCH] Change default min_id to 1

Also update manpage for min_id/max_id to be more clear about how
it relates to primary GID.
---
 src/confdb/confdb.h          |    2 +-
 src/config/SSSDConfigTest.py |    7 +++----
 src/config/etc/sssd.api.conf |    2 +-
 src/man/sssd.conf.5.xml      |   14 +++++++++++---
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index be4dfb6f75ed8308402b42bf8bd1da863ed788c4..ae7502f8df6bb6c351a74d9b524a6b0f31c80496 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -39,7 +39,7 @@
 
 #define CONFDB_FILE "config.ldb"
 #define CONFDB_DEFAULT_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
-#define SSSD_MIN_ID 1000
+#define SSSD_MIN_ID 1
 
 
 /* Configuration options */
diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py
index 04d438e0681a594daa6fc7594fd6c76a806437d3..ea897d716d58634750f4b345929a4f849cafbcb1 100755
--- a/src/config/SSSDConfigTest.py
+++ b/src/config/SSSDConfigTest.py
@@ -595,7 +595,6 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
         options = domain.list_mandatory_options()
         control_list = [
             'cache_credentials',
-            'min_id',
             'id_provider',
             'auth_provider']
 
@@ -989,9 +988,9 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
         domain = SSSDConfig.SSSDDomain('sssd', self.schema)
 
         # Positive test - Remove existing option
-        self.assertTrue('min_id' in domain.get_all_options().keys())
-        domain.remove_option('min_id')
-        self.assertFalse('min_id' in domain.get_all_options().keys())
+        self.assertTrue('cache_credentials' in domain.get_all_options().keys())
+        domain.remove_option('cache_credentials')
+        self.assertFalse('cache_credentials' in domain.get_all_options().keys())
 
         # Positive test - Remove unset but valid option
         self.assertFalse('max_id' in domain.get_all_options().keys())
diff --git a/src/config/etc/sssd.api.conf b/src/config/etc/sssd.api.conf
index 7d0e20c7743642d19f98397a4512e6c02cae5fe3..f0ef41149a43f032870e61b8418262d473bd9b0c 100644
--- a/src/config/etc/sssd.api.conf
+++ b/src/config/etc/sssd.api.conf
@@ -46,7 +46,7 @@ chpass_provider = str, None, false
 debug_level = int, None, false, 0
 debug_timestamps = bool, None, false
 command = str, None, false
-min_id = int, None, true, 1000
+min_id = int, None, false
 max_id = int, None, false
 timeout = int, None, false
 enumerate = bool, None, false
diff --git a/src/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml
index bd2d3acd12df056f679b657a9c4851c9603fb536..497fae630429fd36b11382a8b5e054e3e5f87c0d 100644
--- a/src/man/sssd.conf.5.xml
+++ b/src/man/sssd.conf.5.xml
@@ -396,11 +396,19 @@
                     <term>min_id,max_id (integer)</term>
                     <listitem>
                         <para>
-                            UID limits for the domain. If a domain contains
-                            entry that is outside these limits, it is ignored
+                            UID and GID limits for the domain. If a domain
+                            contains an entry that is outside these limits, it
+                            is ignored.
                         </para>
                         <para>
-                            Default: 1000 for min_id, 0 (no limit) for max_id
+                            For users, this affects the primary GID limit. The
+                            user will not be returned to NSS if either the
+                            UID or the primary GID is outside the range. For
+                            non-primary group memberships, those that are in
+                            range will be reported as expected.
+                        </para>
+                        <para>
+                            Default: 1 for min_id, 0 (no limit) for max_id
                         </para>
                     </listitem>
                 </varlistentry>
-- 
1.7.0.1

