diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-11-11 21:52:09 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-11-18 17:35:07 -0500 |
commit | b6dd30c7f8cce8800ef4c35f13d6574e796ffca2 (patch) | |
tree | efc2aeda57f7216325780bc0ecfabb38769f65b9 /server/db/sysdb.h | |
parent | 39462f9afb7512d3d8109e17b78a303b20c557ab (diff) | |
download | sssd-b6dd30c7f8cce8800ef4c35f13d6574e796ffca2.tar.gz sssd-b6dd30c7f8cce8800ef4c35f13d6574e796ffca2.tar.xz 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/sysdb.h')
-rw-r--r-- | server/db/sysdb.h | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/server/db/sysdb.h b/server/db/sysdb.h index 4c92c3777..a32998590 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 |