diff options
Diffstat (limited to 'netfs/lib/entCache.impl.h')
-rw-r--r-- | netfs/lib/entCache.impl.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/netfs/lib/entCache.impl.h b/netfs/lib/entCache.impl.h index 1d7bbc7..5e6289e 100644 --- a/netfs/lib/entCache.impl.h +++ b/netfs/lib/entCache.impl.h @@ -51,46 +51,4 @@ EntCache<entry_t>::getEntryNoFill(const key_t & key) const noexcept return nullptr; } -const int BUFLEN = 8196; - -void -UserEntCache::fillCache() const noexcept -{ - Lock(lock); - setpwent(); - idcache->clear(); - std::array<char, BUFLEN> buf {}; - struct passwd pwbuf { - }, *pwp; - while (getpwent_r(&pwbuf, buf.data(), buf.size(), &pwp) == 0) { - idcache->insert(std::make_shared<User>(pwp->pw_uid, pwp->pw_name, pwp->pw_gid)); - } - endpwent(); - time(&fillTime); -} - -GroupEntCache::GroupEntCache(EntryResolverPtr<User> u) : users(std::move(u)) { } - -void -GroupEntCache::fillCache() const noexcept -{ - Lock(lock); - setgrent(); - std::array<char, BUFLEN> buf {}; - idcache->clear(); - struct group grpbuf { - }, *grp; - while (getgrent_r(&grpbuf, buf.data(), buf.size(), &grp) == 0) { - auto g = std::make_shared<Group>(grp->gr_gid, grp->gr_name); - for (auto member = grp->gr_mem; *member; member++) { - if (auto ent = users->getEntry(*member)) { - g->members.insert(ent->id); - } - } - idcache->insert(std::move(g)); - } - endgrent(); - time(&fillTime); -} - #endif |