mirror of
https://github.com/fairyglade/ly.git
synced 2026-09-22 03:50:23 +00:00
auth: Simplify PAM appdata
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -421,8 +421,11 @@ pub fn getNextUsernameEntry() ?UsernameEntry {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn getUsernameEntry(username: [:0]const u8) ?UsernameEntry {
|
||||
const entry = pwd.getpwnam(username);
|
||||
pub fn getUsernameEntry(allocator: std.mem.Allocator, username: []const u8) ?UsernameEntry {
|
||||
const username_z = allocator.dupeZ(u8, username) catch return null;
|
||||
defer allocator.free(username_z);
|
||||
|
||||
const entry = pwd.getpwnam(username_z);
|
||||
if (entry == null) return null;
|
||||
|
||||
return .{
|
||||
|
||||
Reference in New Issue
Block a user