Make notification message a bit less confusing

This commit is contained in:
9pfs 2024-04-24 02:05:20 +00:00
parent b43122a80f
commit 139cee97e5
Signed by: 9pfs
SSH key fingerprint: SHA256:TOcGxMQCfy4VvRM8AzgXErKXdkAtaTcpGXgYMpyoJoY

View file

@ -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. */