1 --- cyrus-sasl-2.1.28/saslauthd/Makefile.am.orig 2022-02-18 22:50:42.000000000 +0100
2 +++ cyrus-sasl-2.1.28/saslauthd/Makefile.am 2022-05-23 18:49:42.340529846 +0200
5 sbin_PROGRAMS = saslauthd testsaslauthd
6 +nagios_PROGRAMS = check_saslauthd
7 +nagiosdir = @libdir@/nagios/plugins
8 EXTRA_PROGRAMS = saslcache
10 LTLIBOBJS = @LTLIBOBJS@
11 @@ -30,6 +32,10 @@ saslauthd_LDADD = @SASL_KRB_LIB@ \
12 testsaslauthd_SOURCES = testsaslauthd.c utils.c
13 testsaslauthd_LDADD = @LIB_SOCKET@
15 +check_saslauthd_SOURCES = testsaslauthd.c utils.c
16 +check_saslauthd_LDADD = @LIB_SOCKET@
17 +check_saslauthd_CFLAGS = -DNAGIOS_PLUGIN
19 saslcache_SOURCES = saslcache.c
21 EXTRA_DIST = testsaslauthd.8 saslauthd.mdoc include \
22 diff -urNp -x '*.orig' cyrus-sasl-2.1.27.org/saslauthd/testsaslauthd.c cyrus-sasl-2.1.27/saslauthd/testsaslauthd.c
23 --- cyrus-sasl-2.1.27.org/saslauthd/testsaslauthd.c 2018-11-08 18:29:57.000000000 +0100
24 +++ cyrus-sasl-2.1.27/saslauthd/testsaslauthd.c 2021-09-28 23:58:31.072659837 +0200
31 +#define STATE_WARNING 1
32 +#define STATE_CRITICAL 2
33 +#define STATE_UNKNOWN 3
39 @@ -244,7 +251,11 @@ static int saslauthd_verify_password(con
42 printf("NO \"authentication failed\"\n");
51 @@ -291,7 +302,11 @@ main(int argc, char *argv[])
52 " [-r realm] [-s servicename]\n"
53 " [-f socket path] [-R repeatnum]\n",
56 + exit(STATE_UNKNOWN);
62 if (!repeat) repeat = 1;
63 @@ -300,7 +315,23 @@ main(int argc, char *argv[])
65 result = saslauthd_verify_password(path, user, password, service, realm);
70 + return STATE_CRITICAL;
75 + case 1: // auth fail
76 + return STATE_WARNING;
79 + return STATE_UNKNOWN;