From 5f0d9bb17601a7f4052811a0bbbe9fc2f1d28684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 19 Feb 2022 16:09:46 +0200 Subject: [PATCH] rename username2user --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6a31cef..febe278 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ resolve a username to a `struct passwd*`: be done once, when the NSS library is loaded (or on the first call). - Hash the username using a perfect hash function. Perfect hash function returns a number `n ∈ [0,N-1]`, where N is the total number of users. -- Jump to the `n`'th location in the `idx_username2user` section (by pointer +- Jump to the `n`'th location in the `idx_name2user` section (by pointer arithmetic), which contains the index `i` to the user's information. - Jump to the location `i` of section `Users` (again, using pointer arithmetic) which stores the full user information. @@ -55,7 +55,7 @@ resolve a username to a `struct passwd*`: return it to the caller. In total, that's one hash for the username (~150ns), two pointer jumps within -the group file (to sections `idx_username2user` and `Users`), and, now that the +the group file (to sections `idx_name2user` and `Users`), and, now that the user record is found, `memcpy` for each field. The turbonss DB file is be `mmap`-ed, making it simple to implement pointer @@ -164,7 +164,7 @@ OFFSET TYPE NAME DESCRIPTION 12 u32 num_groups number of group entries 16 u32 offset_bdz_uid2user 20 u32 offset_bdz_groupname2group - 24 u32 offset_bdz_username2user + 24 u32 offset_bdz_name2user 28 u32 offset_idx offset to the first idx_ section 32 u32 offset_groups 36 u32 offset_users @@ -335,11 +335,11 @@ Header 48 see "Turbonss header" section bdz_gid2group ? gid->group bdz bdz_uid2user ? uid->user bdz bdz_groupname2group ? groupname->group bdz -bdz_username2user ? username->user bdz +bdz_name2user ? username->user bdz idx_gid2group len(group)*4*29/32 bdz->offset gid2group idx_groupname2group len(group)*4*29/32 bdz->offset groupname2group idx_uid2user len(user)*4*29/32 bdz->offset uid2user -idx_username2user len(user)*4*29/32 bdz->offset username2user +idx_name2user len(user)*4*29/32 bdz->offset name2user ShellIndex len(shells)*2 Shell index array ShellBlob <= 4032 Shell data blob (max 63*64 bytes) Groups ? packed Group entries (8b padding)