fixup! WIP: find libsystemd with autoconfig
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -37,6 +37,8 @@ asn1_*_asn1.c
|
|||||||
*.log
|
*.log
|
||||||
*.trs
|
*.trs
|
||||||
*.tmp
|
*.tmp
|
||||||
|
result
|
||||||
|
result-*
|
||||||
|
|
||||||
# Top-level files.
|
# Top-level files.
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ AC_ARG_WITH([systemd],
|
|||||||
[],
|
[],
|
||||||
[with_systemd=check])
|
[with_systemd=check])
|
||||||
if test "$with_systemd" != "no"; then
|
if test "$with_systemd" != "no"; then
|
||||||
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 257.0],
|
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 256.0],
|
||||||
[with_systemd=yes],[with_systemd=no])
|
[with_systemd=yes],[with_systemd=no])
|
||||||
fi
|
fi
|
||||||
if test "$with_systemd" = "yes"; then
|
if test "$with_systemd" = "yes"; then
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ kadmind_LDADD = $(top_builddir)/lib/kadm5/libkadm5srv.la \
|
|||||||
$(LIB_pidfile) \
|
$(LIB_pidfile) \
|
||||||
$(LIB_dlopen)
|
$(LIB_dlopen)
|
||||||
|
|
||||||
|
if HAVE_SYSTEMD
|
||||||
|
kadmind_LDADD += $(SYSTEMD_LIBS)
|
||||||
|
endif
|
||||||
|
|
||||||
kadmin_LDADD = \
|
kadmin_LDADD = \
|
||||||
$(top_builddir)/lib/kadm5/libkadm5clnt.la \
|
$(top_builddir)/lib/kadm5/libkadm5clnt.la \
|
||||||
$(top_builddir)/lib/kadm5/libkadm5srv.la \
|
$(top_builddir)/lib/kadm5/libkadm5srv.la \
|
||||||
|
|||||||
11
kadmin/rpc.c
11
kadmin/rpc.c
@@ -36,6 +36,9 @@
|
|||||||
#include <gssapi.h>
|
#include <gssapi.h>
|
||||||
#include <gssapi_krb5.h>
|
#include <gssapi_krb5.h>
|
||||||
#include <gssapi_spnego.h>
|
#include <gssapi_spnego.h>
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
#include <systemd/sd-daemon.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CHECK(x) \
|
#define CHECK(x) \
|
||||||
do { \
|
do { \
|
||||||
@@ -800,6 +803,10 @@ process_stream(krb5_context contextp,
|
|||||||
|
|
||||||
INSIST(ilen >= 4);
|
INSIST(ilen >= 4);
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
sd_notify(0, "READY=1");
|
||||||
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
struct call_header chdr;
|
struct call_header chdr;
|
||||||
struct gcred gcred;
|
struct gcred gcred;
|
||||||
@@ -1129,6 +1136,10 @@ process_stream(krb5_context contextp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
sd_notify(0, "STOPPING=1");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
|
|
||||||
#include "kadmin_locl.h"
|
#include "kadmin_locl.h"
|
||||||
#include <krb5-private.h>
|
#include <krb5-private.h>
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
#include <systemd/sd-daemon.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static kadm5_ret_t check_aliases(kadm5_server_context *,
|
static kadm5_ret_t check_aliases(kadm5_server_context *,
|
||||||
kadm5_principal_ent_rec *,
|
kadm5_principal_ent_rec *,
|
||||||
@@ -1131,7 +1134,16 @@ handle_v5(krb5_context contextp,
|
|||||||
krb5_err(contextp, 1, ret, "kadm5_init_with_password_ctx");
|
krb5_err(contextp, 1, ret, "kadm5_init_with_password_ctx");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
sd_notify(0, "READY=1");
|
||||||
|
#endif
|
||||||
|
|
||||||
v5_loop(contextp, ac, initial, kadm_handlep, fd, readonly);
|
v5_loop(contextp, ac, initial, kadm_handlep, fd, readonly);
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
sd_notify(0, "STOPPING=1");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_error_code
|
krb5_error_code
|
||||||
@@ -1171,4 +1183,3 @@ kadmind_loop(krb5_context contextp,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ kpasswdd_LDADD = \
|
|||||||
$(LIB_dlopen) \
|
$(LIB_dlopen) \
|
||||||
$(DB3LIB) $(DB1LIB) $(LMDBLIB) $(NDBMLIB)
|
$(DB3LIB) $(DB1LIB) $(LMDBLIB) $(NDBMLIB)
|
||||||
|
|
||||||
|
if HAVE_SYSTEMD
|
||||||
|
kpasswdd_LDADD += $(SYSTEMD_LIBS)
|
||||||
|
endif
|
||||||
|
|
||||||
LDADD = $(top_builddir)/lib/krb5/libkrb5.la \
|
LDADD = $(top_builddir)/lib/krb5/libkrb5.la \
|
||||||
$(LIB_hcrypto) \
|
$(LIB_hcrypto) \
|
||||||
$(top_builddir)/lib/asn1/libasn1.la \
|
$(top_builddir)/lib/asn1/libasn1.la \
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ RCSID("$Id$");
|
|||||||
#ifdef HAVE_SYS_UN_H
|
#ifdef HAVE_SYS_UN_H
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
#include <systemd/sd-daemon.h>
|
||||||
|
#endif
|
||||||
#include <hdb.h>
|
#include <hdb.h>
|
||||||
#include <kadm5/private.h>
|
#include <kadm5/private.h>
|
||||||
#include <kadm5/kadm5_err.h>
|
#include <kadm5/kadm5_err.h>
|
||||||
@@ -745,6 +748,10 @@ doit(krb5_keytab keytab, int port)
|
|||||||
|
|
||||||
roken_detach_finish(NULL, daemon_child);
|
roken_detach_finish(NULL, daemon_child);
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
sd_notify(0, "READY=1");
|
||||||
|
#endif
|
||||||
|
|
||||||
while (exit_flag == 0) {
|
while (exit_flag == 0) {
|
||||||
krb5_ssize_t retx;
|
krb5_ssize_t retx;
|
||||||
fd_set fdset = real_fdset;
|
fd_set fdset = real_fdset;
|
||||||
@@ -777,6 +784,10 @@ doit(krb5_keytab keytab, int port)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
sd_notify(0, "STOPPING=1");
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < n; ++i)
|
for (i = 0; i < n; ++i)
|
||||||
close(sockets[i]);
|
close(sockets[i]);
|
||||||
free(sockets);
|
free(sockets);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
pam,
|
pam,
|
||||||
libmicrohttpd,
|
libmicrohttpd,
|
||||||
cjson,
|
cjson,
|
||||||
|
systemdMinimal,
|
||||||
|
|
||||||
CoreFoundation,
|
CoreFoundation,
|
||||||
Security,
|
Security,
|
||||||
@@ -43,6 +44,7 @@
|
|||||||
withOpenLDAPAsHDBModule ? false,
|
withOpenLDAPAsHDBModule ? false,
|
||||||
withOpenSSL ? true,
|
withOpenSSL ? true,
|
||||||
withSQLite3 ? true,
|
withSQLite3 ? true,
|
||||||
|
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert lib.assertMsg (withOpenLDAPAsHDBModule -> withOpenLDAP) ''
|
assert lib.assertMsg (withOpenLDAPAsHDBModule -> withOpenLDAP) ''
|
||||||
@@ -89,7 +91,8 @@ stdenv.mkDerivation {
|
|||||||
++ lib.optionals (withMicroHTTPD) [ libmicrohttpd ]
|
++ lib.optionals (withMicroHTTPD) [ libmicrohttpd ]
|
||||||
++ lib.optionals (withOpenLDAP) [ openldap ]
|
++ lib.optionals (withOpenLDAP) [ openldap ]
|
||||||
++ lib.optionals (withOpenSSL) [ openssl ]
|
++ lib.optionals (withOpenSSL) [ openssl ]
|
||||||
++ lib.optionals (withSQLite3) [ sqlite ];
|
++ lib.optionals (withSQLite3) [ sqlite ]
|
||||||
|
++ lib.optionals (withSystemd) [ systemdMinimal ];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs = [
|
||||||
@@ -125,6 +128,9 @@ stdenv.mkDerivation {
|
|||||||
]
|
]
|
||||||
++ lib.optionals (withSQLite3) [
|
++ lib.optionals (withSQLite3) [
|
||||||
"--with-sqlite3=${sqlite.dev}"
|
"--with-sqlite3=${sqlite.dev}"
|
||||||
|
]
|
||||||
|
++ lib.optionals (withSystemd) [
|
||||||
|
"--with-systemd=yes"
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ in
|
|||||||
ExecStart = "${package}/libexec/kadmind --config-file=/etc/heimdal-kdc/kdc.conf";
|
ExecStart = "${package}/libexec/kadmind --config-file=/etc/heimdal-kdc/kdc.conf";
|
||||||
Slice = "system-kerberos-server.slice";
|
Slice = "system-kerberos-server.slice";
|
||||||
StateDirectory = "heimdal";
|
StateDirectory = "heimdal";
|
||||||
|
Type = "notify";
|
||||||
};
|
};
|
||||||
restartTriggers = [ kdcConfFile ];
|
restartTriggers = [ kdcConfFile ];
|
||||||
};
|
};
|
||||||
@@ -98,6 +99,7 @@ in
|
|||||||
ExecStart = "${package}/libexec/kpasswdd";
|
ExecStart = "${package}/libexec/kpasswdd";
|
||||||
Slice = "system-kerberos-server.slice";
|
Slice = "system-kerberos-server.slice";
|
||||||
StateDirectory = "heimdal";
|
StateDirectory = "heimdal";
|
||||||
|
Type = "notify";
|
||||||
};
|
};
|
||||||
restartTriggers = [ kdcConfFile ];
|
restartTriggers = [ kdcConfFile ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ pkgs.mkShell {
|
|||||||
openldap
|
openldap
|
||||||
openssl
|
openssl
|
||||||
sqlite
|
sqlite
|
||||||
|
systemdMinimal
|
||||||
];
|
];
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
|
|||||||
Reference in New Issue
Block a user