Skip to content

Commit

Permalink
Login preferences: check for "adm" group if "wheel" group doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
trunkmaster committed Apr 23, 2024
1 parent 7bd54a8 commit 92f10ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Applications/Login/Preferences/Login.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@ - (BOOL)_isAdminUser
struct group *grp;
int i = 0;
BOOL isAdmin = NO;

grp = getgrnam("wheel");
while (grp->gr_mem[i] != NULL) {
if (grp == NULL) {
grp = getgrnam("adm");
}
while (grp && grp->gr_mem[i] != NULL) {
printf("[Login] wheel member: %s\n", grp->gr_mem[i]);
if (!strcmp(grp->gr_mem[i], [NSUserName() cString])) {
isAdmin = YES;
Expand Down

0 comments on commit 92f10ae

Please sign in to comment.