From 83d7dcc53f2a713fe5f10c43cda3ac2705421a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Hon=C4=9Bk?= Date: Mon, 26 Mar 2018 14:05:51 +0200 Subject: [PATCH] Ticket 49601 - Replace HAVE_SYSTEMD define with WITH_SYSTEMD in svrcore Bug Description: As former configure of svrcore is not used after the merge of svrcore, and the svrcore's --with-systemd configure flag handling seems to not have been merged to the 389-ds-core configure, and configuring svrcore --with-systemd defines HAVE_SYSTEMD which is different from define WITH_SYSTEMD used in 389-ds-base, the systemd support in svrcore is not effectively turned on when compiling 389-ds-base with --with-systemd. Fix Description: Use the very same define as 389-ds-base uses (WITH_SYSTEMD) instead of the former one of svrcore, which is obviously inheritted into the svrcore code as well, thus effectively selecting a code to be compiled based on the --with-systemd configure flag. https://pagure.io/389-ds-base/issue/49601 Author: mhonek Review by: ??? --- src/svrcore/m4/systemd.m4 | 2 +- src/svrcore/src/std-systemd.c | 8 ++++---- src/svrcore/src/systemd-ask-pass.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/svrcore/m4/systemd.m4 b/src/svrcore/m4/systemd.m4 index 6052acbda..3a22dd918 100644 --- a/src/svrcore/m4/systemd.m4 +++ b/src/svrcore/m4/systemd.m4 @@ -27,7 +27,7 @@ if test "$with_systemd" = yes; then if test -n "$PKG_CONFIG"; then if $PKG_CONFIG --exists systemd; then AC_MSG_CHECKING([systemd found, enabling.]) - SYSTEMD_CFLAGS="-DHAVE_SYSTEMD" + SYSTEMD_CFLAGS="-DWITH_SYSTEMD" else AC_MSG_CHECKING([systemd not found, disabling.]) SYSTEMD_CFLAGS="" diff --git a/src/svrcore/src/std-systemd.c b/src/svrcore/src/std-systemd.c index c1f8ba8dc..b4310dfef 100644 --- a/src/svrcore/src/std-systemd.c +++ b/src/svrcore/src/std-systemd.c @@ -48,7 +48,7 @@ SVRCORE_CreateStdSystemdPinObj( const char *filename, PRBool cachePINs, PRBool systemdPINs, uint64_t timeout) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD SVRCOREError err = SVRCORE_Success; SVRCOREStdSystemdPinObj *obj = 0; @@ -155,7 +155,7 @@ void SVRCORE_DestroyStdSystemdPinObj( SVRCOREStdSystemdPinObj *obj) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD if (!obj) return; if (obj->user) SVRCORE_DestroyUserPinObj(obj->user); @@ -174,7 +174,7 @@ SVRCORE_DestroyStdSystemdPinObj( void SVRCORE_SetStdSystemdPinInteractive(SVRCOREStdSystemdPinObj *obj, PRBool i) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD SVRCORE_SetUserPinInteractive(obj->user, i); #endif // Systemd } @@ -187,7 +187,7 @@ SVRCOREError SVRCORE_StdSystemdPinGetPin(char **pin, SVRCOREStdSystemdPinObj *obj, const char *tokenName) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD #ifdef DEBUG printf("std-systemd:stdsystem-getpin() -> starting \n"); #endif diff --git a/src/svrcore/src/systemd-ask-pass.c b/src/svrcore/src/systemd-ask-pass.c index ea598d72a..8d1c89616 100644 --- a/src/svrcore/src/systemd-ask-pass.c +++ b/src/svrcore/src/systemd-ask-pass.c @@ -49,7 +49,7 @@ static const struct SVRCOREPinMethods vtable; SVRCOREError SVRCORE_CreateSystemdPinObj(SVRCORESystemdPinObj **out, uint64_t timeout) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD SVRCOREError err = SVRCORE_Success; SVRCORESystemdPinObj *obj = NULL; @@ -83,7 +83,7 @@ SVRCORE_CreateSystemdPinObj(SVRCORESystemdPinObj **out, uint64_t timeout) #endif // Systemd } -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD SVRCOREError _create_socket(char **path, int *sfd) { @@ -162,7 +162,7 @@ out: static char * getPin(SVRCOREPinObj *obj, const char *tokenName, PRBool retry) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD SVRCORESystemdPinObj *sobj = (SVRCORESystemdPinObj *)obj; SVRCOREError err = SVRCORE_Success; char *tbuf = malloc(PASS_MAX); @@ -450,7 +450,7 @@ out: void SVRCORE_DestroySystemdPinObj(SVRCORESystemdPinObj *obj) { -#ifdef HAVE_SYSTEMD +#ifdef WITH_SYSTEMD if (obj) { free(obj); } -- 2.14.3