We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e8ec7b commit a405ea7Copy full SHA for a405ea7
os.c
@@ -204,7 +204,7 @@ void get_current_users(struct os_metrics *input_os_metrics) {
204
205
while ((input_utmpx = getutxent()) != NULL) {
206
/* check users who are established and authenticated */
207
- if (input_utmpx->ut_type == USER_PROCESS || input_utmpx->ut_type == LOGIN_PROCESS) {
+ if ((input_utmpx->ut_type == USER_PROCESS || input_utmpx->ut_type == LOGIN_PROCESS) && input_utmpx->ut_user[0] != '\0') {
208
++input_os_metrics->current_users;
209
}
210
0 commit comments