diff --git a/check-users.c b/check-users.c index 2dfeed7..4ded587 100644 --- a/check-users.c +++ b/check-users.c @@ -30,11 +30,11 @@ void check_users() { res_err_txt = strerror(res_errno); char *notification_payload; int notification_payload_len; - const char *notification_payload_fmt = "samuel doesn't exist, LDAP is probably broken somehow. (getpwnam returned %s)"; + const char *notification_payload_fmt = "samuel doesn't exist, LDAP is probably broken somehow. (getpwnam returned errno %s/%d)"; /* TODO: set a realistic payload length */ notification_payload_len = strlen(notification_payload_fmt) + strlen(res_err_txt) + 1; notification_payload = malloc(notification_payload_len+1); - snprintf(notification_payload, notification_payload_len, notification_payload_fmt, res_err_txt); + snprintf(notification_payload, notification_payload_len, notification_payload_fmt, res_err_txt, res_errno); int send_alarm_result; send_alarm_result = send_alarm(notification_payload); /* We only set this to 1 if we successfully reported the issue. */