1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2025-01-03 14:56:43 -05:00

Autodetect HAVE_PASSWD support

Fixes #122
This commit is contained in:
Samuel Tyler 2024-12-29 11:35:19 +11:00
parent 1f2ca97c1d
commit 9538f73d65
3 changed files with 24 additions and 2 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ src/filetypes.h
src/bin2c
src/gophernicus
Makefile
config.h
README
README.options

21
configure vendored
View File

@ -64,6 +64,9 @@ done
: ${CFLAGS:=-O2}
: ${HOSTNAME:=autodetect}
rm -f config.h
touch config.h
# Check for a compiler that actually works
printf "checking for working compiler... "
cat > conftest.c <<EOF
@ -243,7 +246,8 @@ cat > conftest.c <<EOF
int main() {}
EOF
if ${CC} -o conftest -lwrap conftest.c 2>/dev/null; then
LIBWRAP="-DHAVE_LIBWRAP -lwrap"
LIBWRAP="-lwrap"
echo "#define HAVE_LIBWARP " >> config.h
printf "yes"
else
LIBWRAP=
@ -251,6 +255,21 @@ else
fi
printf "\\n"
# Checking for passwd support
printf "checking for passwd support... "
cat > conftest.c <<EOF
#include <pwd.h>
int main() {}
EOF
if ${CC} -o conftest conftest.c 2>/dev/null; then
echo "#define HAVE_PASSWD " >> config.h
printf "yes"
else
printf "no"
fi
printf "\\n"
# Check and use SHM if available
printf "checking for ipcrm (SHM management)... "
if ! IPCRM="$(command -v ipcrm)"; then

View File

@ -53,7 +53,7 @@
/* Defaults should fit standard POSIX systems */
#define HAVE_IPv4 /* IPv4 should work anywhere */
#define HAVE_IPv6 /* Requires modern POSIX */
#define HAVE_PASSWD /* For systems with passwd-like userdb */
/* #define HAVE_PASSWD autodetected, For systems with passwd-like userdb */
#define PASSWD_MIN_UID 100 /* Minimum allowed UID for ~userdirs */
#define HAVE_LOCALES /* setlocale() and friends */
#define HAVE_SHMEM /* Shared memory support */
@ -63,6 +63,8 @@
#undef HAVE_SENDFILE /* sendfile() in Linux & others */
/* #undef HAVE_LIBWRAP autodetected, don't enable here */
#include "config.h"
/* Linux */
#ifdef __linux
#undef PASSWD_MIN_UID