From 6b5a7efb4926678b1cc203e6b8a214f38bffd192 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 16 Nov 2025 13:08:34 +0900 Subject: [PATCH] wow --- src/users.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/users.c b/src/users.c index 8178e43..1f55740 100644 --- a/src/users.c +++ b/src/users.c @@ -9,16 +9,21 @@ void MDEListUsers(void(*call)(const char* name, void* user), void* user){ setpwent(); while((pwd = getpwent()) != NULL){ char* dir; + char* shell; /* this is BAD check. and i cannot do anything about it * * i appreciate the insanity */ - if(pwd->pw_dir == NULL) continue; + if(pwd->pw_dir == NULL || pwd->pw_shell == NULL) continue; if(pwd->pw_name[0] == '_') continue; - if(strlen(pwd->pw_dir) >= 5 && memcmp(pwd->pw_dir, "/var/", 5) == 0) continue; - if(strlen(pwd->pw_dir) >= 5 && memcmp(pwd->pw_dir, "/usr/", 5) == 0) continue; + + shell = strrchr(pwd->pw_shell, '/'); + if(shell == NULL) break; + shell++; + + if(strcmp(shell, "nologin") == 0) continue; dir = strrchr(pwd->pw_dir, '/'); if(dir == NULL) break;