mirror of
https://github.com/fairyglade/ly.git
synced 2026-06-22 07:22:00 +00:00
Fix user detection if /etc/login.defs does not contain both UID_MIN and UID_MAX (#1014)
## What are the changes about? I modified getUserIdRange(), so it checks if either of UID_MIN and UID_MAX is set in /etc/login.defs. If any, but not both, is not set, it uses fallback value. I don't know zig build system, so I added ugly fallback values passthrough. ## What existing issue does this resolve? #1013 ## Pre-requisites - [X] I have tested & confirmed the changes work locally - [X] I have read and fully adhere to the rules set in the contributing guidelines found in `CONTRIBUTING.md` Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/1014 Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
This commit is contained in:
@@ -11,6 +11,13 @@ pub fn build(b: *std.Build) void {
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const fallback_uid_min = b.option(std.posix.uid_t, "fallback_uid_min", "Set the fallback minimum UID (default is 1000). This value gets embedded into the binary").?;
|
||||
const fallback_uid_max = b.option(std.posix.uid_t, "fallback_uid_max", "Set the fallback maximum UID (default is 60000). This value gets embedded into the binary").?;
|
||||
const build_options = b.addOptions();
|
||||
build_options.addOption(std.posix.uid_t, "fallback_uid_min", fallback_uid_min);
|
||||
build_options.addOption(std.posix.uid_t, "fallback_uid_max", fallback_uid_max);
|
||||
mod.addOptions("build_options", build_options);
|
||||
|
||||
const zigini = b.dependency("zigini", .{ .target = target, .optimize = optimize });
|
||||
mod.addImport("zigini", zigini.module("zigini"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user