summaryrefslogtreecommitdiff
path: root/server/db
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-11-11 21:52:09 -0500
committerStephen Gallagher <sgallagh@redhat.com>2009-11-18 17:35:07 -0500
commitb6dd30c7f8cce8800ef4c35f13d6574e796ffca2 (patch)
treeefc2aeda57f7216325780bc0ecfabb38769f65b9 /server/db
parent39462f9afb7512d3d8109e17b78a303b20c557ab (diff)
downloadsssd-b6dd30c7f8cce8800ef4c35f13d6574e796ffca2.tar.gz
sssd-b6dd30c7f8cce8800ef4c35f13d6574e796ffca2.tar.bz2
sssd-b6dd30c7f8cce8800ef4c35f13d6574e796ffca2.zip
Change initgroups code to use and check the cache
We were previously always ending up contacting the backend because we had no way to know if an initgroups call for the same user had ever been called. Add attribute to hold this information and rely on backends to update it. If they don't we fallback to the previous behvior of asking the backend.
Diffstat (limited to 'server/db')
-rw-r--r--server/db/sysdb.h33
1 files changed, 11 insertions, 22 deletions
diff --git a/server/db/sysdb.h b/server/db/sysdb.h
index 4c92c377..a3299859 100644
--- a/server/db/sysdb.h
+++ b/server/db/sysdb.h
@@ -66,6 +66,7 @@
#define SYSDB_LAST_UPDATE "lastUpdate"
#define SYSDB_CACHE_EXPIRE "dataExpireTimestamp"
+#define SYSDB_INITGR_EXPIRE "initgrExpireTimestamp"
#define SYSDB_CACHEDPWD "cachedPassword"
@@ -101,41 +102,29 @@
#define SYSDB_GETCACHED_FILTER "(&"SYSDB_UC")("SYSDB_LAST_LOGIN">=%lu))"
+#define SYSDB_DEFAULT_ATTRS SYSDB_LAST_UPDATE, \
+ SYSDB_CACHE_EXPIRE, \
+ SYSDB_INITGR_EXPIRE, \
+ "objectClass"
+
#define SYSDB_PW_ATTRS {SYSDB_NAME, SYSDB_UIDNUM, \
SYSDB_GIDNUM, SYSDB_GECOS, \
SYSDB_HOMEDIR, SYSDB_SHELL, \
- SYSDB_LAST_UPDATE, SYSDB_CACHE_EXPIRE, \
- "objectClass", \
+ SYSDB_DEFAULT_ATTRS, \
NULL}
-#define SYSDB_USER_ATTRS {SYSDB_DEFAULTGROUP, \
- SYSDB_GECOS, \
- SYSDB_HOMEDIR, \
- SYSDB_SHELL, \
- SYSDB_FULLNAME, \
- SYSDB_LOCALE, \
- SYSDB_KEYBOARD, \
- SYSDB_SESSION, \
- SYSDB_LAST_LOGIN, \
- SYSDB_USERPIC, \
- SYSDB_LAST_UPDATE, SYSDB_CACHE_EXPIRE, \
- NULL}
#define SYSDB_GRSRC_ATTRS {SYSDB_NAME, SYSDB_GIDNUM, \
- SYSDB_LAST_UPDATE, SYSDB_CACHE_EXPIRE, \
- "objectClass", \
+ SYSDB_DEFAULT_ATTRS, \
NULL}
#define SYSDB_GRPW_ATTRS {SYSDB_NAME, SYSDB_UIDNUM, \
- SYSDB_LAST_UPDATE, SYSDB_CACHE_EXPIRE, \
- "objectClass", \
+ SYSDB_DEFAULT_ATTRS, \
NULL}
#define SYSDB_GRENT_ATTRS {SYSDB_NAME, SYSDB_UIDNUM, SYSDB_MEMBEROF, \
- SYSDB_LAST_UPDATE, SYSDB_CACHE_EXPIRE, \
- "objectClass", \
+ SYSDB_DEFAULT_ATTRS, \
NULL}
#define SYSDB_INITGR_ATTR SYSDB_MEMBEROF
#define SYSDB_INITGR_ATTRS {SYSDB_GIDNUM, \
- SYSDB_LAST_UPDATE, SYSDB_CACHE_EXPIRE, \
- "objectClass", \
+ SYSDB_DEFAULT_ATTRS, \
NULL}
#define SYSDB_TMPL_USER SYSDB_NAME"=%s,"SYSDB_TMPL_USER_BASE