35 lines
632 B
Zig
35 lines
632 B
Zig
const std = @import("std");
|
|
|
|
const DB = struct {
|
|
users: std.StringHashMap(User),
|
|
groups: std.StringHashMap(Group),
|
|
};
|
|
|
|
const Group = struct {
|
|
gid: u32,
|
|
name: []const u8,
|
|
members: std.BufSet,
|
|
};
|
|
|
|
const User = struct {
|
|
uid: u32,
|
|
gid: u32,
|
|
name: []const u8,
|
|
gecos: []const u8,
|
|
home: []const u8,
|
|
shell: []const u8,
|
|
groups: std.BufSet,
|
|
};
|
|
|
|
const PackedUser = packed struct {
|
|
uid: u32,
|
|
gid: u32,
|
|
additional_gids_offset: u29,
|
|
shell_here: u1,
|
|
shell_len_or_place: u6,
|
|
homedir_len: u6,
|
|
username_is_a_suffix: u1,
|
|
username_offset_or_len: u5,
|
|
gecos_len: u8,
|
|
};
|