summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-09-09 15:29:06 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-09-15 11:46:33 -0400
commite44e99804519b37852ee9ea24d18d2d2710110ce (patch)
treec04a7d42f3ebee250d20c73db0da086299491944
parentb0f08fe9d94f5bc6ec0c749f2b78d3f0d95cf5af (diff)
downloadsssd-e44e99804519b37852ee9ea24d18d2d2710110ce.tar.gz
sssd-e44e99804519b37852ee9ea24d18d2d2710110ce.tar.xz
sssd-e44e99804519b37852ee9ea24d18d2d2710110ce.zip
Use a different min_id for local domain
When we changed the default min_id to be 1, we forgot about the local domain. It makes sense to keep the minimum id larger there.
-rw-r--r--src/confdb/confdb.c17
-rw-r--r--src/confdb/confdb.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index eebc2cd3d..1277e99c5 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -640,6 +640,20 @@ static errno_t get_entry_as_bool(struct ldb_message *msg,
return EOK;
}
+
+/* The default UID/GID for domains is 1. This wouldn't work well with
+ * the local provider */
+static uint32_t confdb_get_min_id(struct sss_domain_info *domain)
+{
+ uint32_t defval = SSSD_MIN_ID;
+
+ if (domain && strcasecmp(domain->provider, "local") == 0) {
+ defval = SSSD_LOCAL_MINID;
+ }
+
+ return defval;
+}
+
static int confdb_get_domain_internal(struct confdb_ctx *cdb,
TALLOC_CTX *mem_ctx,
const char *name,
@@ -784,7 +798,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
}
ret = get_entry_as_uint32(res->msgs[0], &domain->id_min,
- CONFDB_DOMAIN_MINID, SSSD_MIN_ID);
+ CONFDB_DOMAIN_MINID,
+ confdb_get_min_id(domain));
if (ret != EOK) {
DEBUG(0, ("Invalid value for minId\n"));
ret = EINVAL;
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 24b565d29..d553beb28 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -40,6 +40,7 @@
#define CONFDB_FILE "config.ldb"
#define CONFDB_DEFAULT_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
#define SSSD_MIN_ID 1
+#define SSSD_LOCAL_MINID 1000
/* Configuration options */