1
Fork 0

Implementation status for each section

This commit is contained in:
Motiejus Jakštys 2022-02-23 06:19:40 +02:00 committed by Motiejus Jakštys
parent bb4b5eba03
commit b58063ef63
3 changed files with 21 additions and 20 deletions

View File

@ -328,13 +328,13 @@ const PackedList = struct {
members: [length]varint, members: [length]varint,
} }
const Groupmembers = PackedList; const Groupmembers = PackedList;
const AdditionalGids = PackedList; const Username2gids = PackedList;
``` ```
A packed list is a list of varints. A packed list is a list of varints.
Section `AdditionalGidsIndex` stores an index from `hash(username)` to `offset` Section `Username2gidsIndex` stores an index from `hash(username)` to `offset`
in AdditionalGids. in Username2gids.
Complete file structure Complete file structure
----------------------- -----------------------
@ -348,23 +348,23 @@ storing plain `u32` for easier inspection.
Each section is padded to 64 bytes. Each section is padded to 64 bytes.
``` ```
SECTION SIZE DESCRIPTION STATUS SECTION SIZE DESCRIPTION
Header 48 see "Turbonss header" section Header 48 see "Turbonss header" section
bdz_gid2group ? gid->group bdz bdz_gid2group ? gid->group bdz
bdz_uid2user ? uid->user bdz bdz_uid2user ? uid->user bdz
bdz_groupname2group ? groupname->group bdz bdz_groupname2group ? groupname->group bdz
bdz_name2user ? username->user bdz bdz_name2user ? username->user bdz
idx_gid2group len(group)*32 bdz->offset gid2group idx_gid2group len(group)*29/8 bdz->offset Groups
idx_groupname2group len(group)*32 bdz->offset groupname2group idx_groupname2group len(group)*29/8 bdz->offset Groups
idx_uid2user len(user)*32 bdz->offset uid2user idx_uid2user len(user)*29/8 bdz->offset Users
idx_name2user len(user)*32 bdz->offset name2user idx_name2user len(user)*29/8 bdz->offset Users
idx_username2gids len(user)*32 Per-user gidlist index idx_username2gids len(user)*29/8 bdz->offset Username2gids
ShellIndex len(shells)*2 Shell index array ShellIndex len(shells)*2 Shell index array
ShellBlob <= 4032 Shell data blob (max 63*64 bytes) ShellBlob <= 4032 Shell data blob (max 63*64 bytes)
Groups ? packed Group entries (8b padding) Groups ? packed Group entries (8b padding)
Users ? packed User entries (8b padding) Users ? packed User entries (8b padding)
Groupmembers ? per-group memberlist (32b padding) Groupmembers ? per-group memberlist (32b padding)
AdditionalGids ? Per-user gidlist entries Username2gids ? Per-user gidlist entries (8b padding)
``` ```
[git-subtrac]: https://apenwarr.ca/log/20191109 [git-subtrac]: https://apenwarr.ca/log/20191109

View File

@ -3,5 +3,6 @@ test "turbonss test suite" {
_ = @import("shell.zig"); _ = @import("shell.zig");
_ = @import("header.zig"); _ = @import("header.zig");
_ = @import("user.zig"); _ = @import("user.zig");
_ = @import("group.zig");
_ = @import("padding.zig"); _ = @import("padding.zig");
} }