]> granicus.if.org Git - sudo/commit
Instead of caching struct passwd and struct group in the red-black
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 Aug 2010 18:59:17 +0000 (14:59 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 3 Aug 2010 18:59:17 +0000 (14:59 -0400)
commit26067b32f6e9fc555d620f726682af98755c0b00
tree17c88fa7169215ae28061a5b4007da02cc778867
parentb8424430211070748e7de0900cd4cba76e0a47b3
Instead of caching struct passwd and struct group in the red-black
tree, store a struct cache_item which includes both the key and
datum.  This allows us to user the actual name that was looked up
as the key instead of the contents of struct passwd or struct group.
This matters because the name in the database may not match what
we looked up, due either to case folding or truncation (historically
at 8 characters).  Also mark the disabled calls to sudo_freepwcache()
and sudo_freegrcache() as broken since we use cached data for things
like set_perms() and the logging functions.  Fixing this would
require making a copy of the structs for user and runas or adding
a reference count (better).

--HG--
branch : 1.7
pwutil.c