Skip to content

Commit

Permalink
add configure switch for radlast
Browse files Browse the repository at this point in the history
/usr/bin/last is unavailable on some systems due to 32bit utmp, which is what
radlast uses, so give the option to simply not include it when building
  • Loading branch information
mcnewton committed Jan 29, 2025
1 parent 104e06b commit fece06e
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 3 deletions.
1 change: 1 addition & 0 deletions Make.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
INSTALLSTRIP = @INSTALLSTRIP@
MANSKIP = @MANSKIP@

#
# Linker arguments for libraries searched for by the main
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ $(R)$(dictdir)/%: share/%
@echo INSTALL $(notdir $<)
${Q}$(INSTALL) -m 644 $< $@

MANFILES := $(wildcard man/man*/*.?)
MANFILES := $(filter-out $(MANSKIP),$(wildcard man/man*/*.?))
MANDIR := $(wildcard man/man*)
install.man: $(subst man/,$(R)$(mandir)/,$(MANFILES))

Expand Down
81 changes: 80 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ ac_header_c_list=
enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
MANSKIP
STATIC_MODULES
USE_STATIC_LIBS
USE_SHARED_LIBS
Expand All @@ -677,10 +678,12 @@ DIRNAME
AUTOHEADER
AUTOCONF
ACLOCAL
LAST
RUSERS
SNMPWALK
SNMPGET
openssl_version_check_config
WITH_RADLAST
WITH_DHCP
modconfdir
dictdir
Expand Down Expand Up @@ -785,6 +788,7 @@ with_threads
with_tcp
with_vmps
with_dhcp
with_radlast
with_static_modules
with_shared_libs
with_modules
Expand Down Expand Up @@ -1490,6 +1494,7 @@ Optional Packages:
--with-tcp compile in TCP support. (default=yes)
--with-vmps compile in VMPS support. (default=yes)
--with-dhcp compile in DHCP support. (default=yes)
--with-radlast install radlast
--with-static-modules=QUOTED-MODULE-LIST
--with-shared-libs build dynamic libraries and link against them.
(default=yes)
Expand Down Expand Up @@ -6796,6 +6801,26 @@ printf "%s\n" "#define WITH_DHCP 1" >>confdefs.h
fi



MANSKIP=
WITH_RADLAST=

# Check whether --with-radlast was given.
if test ${with_radlast+y}
then :
withval=$with_radlast; case "$withval" in
yes)
WITH_RADLAST=yes
;;
*)
WITH_RADLAST=no
esac

fi




STATIC_MODULES=

# Check whether --with-static_modules was given.
Expand Down Expand Up @@ -7261,6 +7286,58 @@ fi




if test "x$WITH_RADLAST" = "x"; then
# Extract the first word of "last", so it can be a program name with args.
set dummy last; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_LAST+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$LAST"; then
ac_cv_prog_LAST="$LAST" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_LAST="yes"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

test -z "$ac_cv_prog_LAST" && ac_cv_prog_LAST="no"
fi
fi
LAST=$ac_cv_prog_LAST
if test -n "$LAST"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LAST" >&5
printf "%s\n" "$LAST" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi


WITH_RADLAST="$LAST"
fi
if test "x$WITH_RADLAST" != "xyes"; then
MANSKIP="$MANSKIP man/man1/radlast.1"
fi


missing_dir=`cd $ac_aux_dir && pwd`

# Expand $ac_aux_dir to an absolute path.
Expand Down Expand Up @@ -14670,7 +14747,8 @@ USE_STATIC_LIBS="yes"



ac_config_files="$ac_config_files ./Make.inc ./src/include/build-radpaths-h ./src/main/radsniff.mk ./src/main/checkrad ./src/main/radlast ./src/main/radtest ./scripts/rc.radiusd ./scripts/cron/radiusd.cron.daily ./scripts/cron/radiusd.cron.monthly ./scripts/cryptpasswd ./raddb/radrelay.conf ./raddb/radiusd.conf"

ac_config_files="$ac_config_files ./Make.inc ./src/include/build-radpaths-h ./src/main/radsniff.mk ./src/main/radlast.mk ./src/main/checkrad ./src/main/radlast ./src/main/radtest ./scripts/rc.radiusd ./scripts/cron/radiusd.cron.daily ./scripts/cron/radiusd.cron.monthly ./scripts/cryptpasswd ./raddb/radrelay.conf ./raddb/radiusd.conf"

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
Expand Down Expand Up @@ -15370,6 +15448,7 @@ do
"./Make.inc") CONFIG_FILES="$CONFIG_FILES ./Make.inc" ;;
"./src/include/build-radpaths-h") CONFIG_FILES="$CONFIG_FILES ./src/include/build-radpaths-h" ;;
"./src/main/radsniff.mk") CONFIG_FILES="$CONFIG_FILES ./src/main/radsniff.mk" ;;
"./src/main/radlast.mk") CONFIG_FILES="$CONFIG_FILES ./src/main/radlast.mk" ;;
"./src/main/checkrad") CONFIG_FILES="$CONFIG_FILES ./src/main/checkrad" ;;
"./src/main/radlast") CONFIG_FILES="$CONFIG_FILES ./src/main/radlast" ;;
"./src/main/radtest") CONFIG_FILES="$CONFIG_FILES ./src/main/radtest" ;;
Expand Down
34 changes: 34 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,25 @@ if test "x$WITH_DHCP" = "xyes"; then
fi
AC_SUBST(WITH_DHCP)


dnl #
dnl # extra argument: --with-radlast
dnl #
MANSKIP=
WITH_RADLAST=
AC_ARG_WITH(radlast,
[ --with-radlast install radlast],
[ case "$withval" in
yes)
WITH_RADLAST=yes
;;
*)
WITH_RADLAST=no
esac ]
)
AC_SUBST(WITH_RADLAST)


dnl #
dnl # Allow the user to specify a list of modules to be linked
dnl # statically to the server.
Expand Down Expand Up @@ -858,6 +877,19 @@ fi

AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)


dnl #
dnl # radlast depends on last
dnl #
if test "x$WITH_RADLAST" = "x"; then
AC_CHECK_PROG(LAST, last, yes, no)
WITH_RADLAST="$LAST"
fi
if test "x$WITH_RADLAST" != "xyes"; then
MANSKIP="$MANSKIP man/man1/radlast.1"
fi


dnl #
dnl # FIXME This is truly gross.
dnl #
Expand Down Expand Up @@ -2625,11 +2657,13 @@ AC_SUBST(USE_SHARED_LIBS)
USE_STATIC_LIBS="yes"
AC_SUBST(USE_STATIC_LIBS)
AC_SUBST(STATIC_MODULES)
AC_SUBST(MANSKIP)

AC_CONFIG_FILES([\
./Make.inc \
./src/include/build-radpaths-h \
./src/main/radsniff.mk \
./src/main/radlast.mk \
./src/main/checkrad \
./src/main/radlast \
./src/main/radtest \
Expand Down
1 change: 0 additions & 1 deletion debian/freeradius-utils.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ usr/bin/radeapclient
usr/bin/radwho
usr/bin/radsecret
usr/bin/radsniff
usr/bin/radlast
usr/bin/radtest
usr/bin/radzap
usr/bin/radsqlrelay
Expand Down
2 changes: 2 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ install-arch: build-arch-stamp
rm -f $(freeradius_dir)/usr/lib/freeradius/rlm_cache_memcached.so

dh_install --sourcedir=$(freeradius_dir) -p freeradius-utils
[ ! -e $(freeradius_dir)/usr/bin/radlast ] || \
install -m 0755 $(freeradius_dir)/usr/bin/radlast $(CURDIR)/debian/freeradius-utils/usr/bin/radlast
dh_install --sourcedir=$(freeradius_dir) -p freeradius

dh_strip -a --dbg-package=freeradius-dbg
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ FreeRADIUS 3.2.7 Sat 24 Aug 2024 12:00:00 UTC urgency=low
* Better handler single-character expansions. Fixes #2216.
* Correct calculation of EAP length in pre-proxy. Fixes #5486.
* Don't segfault when using detail listeners. Fixes #5485
* radlast is no longer installed if "last" is not present.

FreeRADIUS 3.2.6 Sat 24 Aug 2024 12:00:00 UTC urgency=low
Configuration changes
Expand Down
8 changes: 8 additions & 0 deletions redhat/freeradius.spec
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
%bcond_with rlm_yubikey
%bcond_without ldap
%bcond_with radlast
# %%bcond_with experimental_modules

%{!?_with_rlm_cache_memcached: %global _without_rlm_cache_memcached --without-rlm_cache_memcached}
%{!?_with_rlm_eap_pwd: %global _without_rlm_eap_pwd --without-rlm_eap_pwd}
%{!?_with_rlm_eap_tnc: %global _without_rlm_eap_tnc --without-rlm_eap_tnc}
%{!?_with_rlm_yubikey: %global _without_rlm_yubikey --without-rlm_yubikey}
%{!?_with_radlast: %global _without_radlast --without-radlast}
%{?_without_ldap: %global _without_libfreeradius_ldap --without-libfreeradius-ldap}
%{?el7: %global _without_rlm_eap_teap --without-rlm_eap_teap}

Expand Down Expand Up @@ -428,6 +430,8 @@ export LDFLAGS="-Wl,--build-id"
%{?_without_rlm_cache_memcached} \
%{?_without_libwbclient} \
%{?_without_libfreeradius_ldap} \
%{?_with_radlast} \
%{?_without_radlast} \
# --with-modules="rlm_wimax" \

make %_smp_mflags
Expand Down Expand Up @@ -844,7 +848,9 @@ fi
/usr/bin/radclient
/usr/bin/radcrypt
/usr/bin/radeapclient
%if %{?_with_radlast:1}%{!?_with_radlast:0}
/usr/bin/radlast
%endif
/usr/bin/radtest
/usr/bin/radsecret
/usr/bin/radsniff
Expand All @@ -859,7 +865,9 @@ fi
%doc %{_mandir}/man1/rad_counter.1.gz
%doc %{_mandir}/man1/radclient.1.gz
%doc %{_mandir}/man1/radeapclient.1.gz
%if %{?_with_radlast:1}%{!?_with_radlast:0}
%doc %{_mandir}/man1/radlast.1.gz
%endif
%doc %{_mandir}/man8/radsqlrelay.8.gz
%doc %{_mandir}/man1/radtest.1.gz
%doc %{_mandir}/man1/radwho.1.gz
Expand Down
1 change: 1 addition & 0 deletions src/main/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Makefile
radsniff.mk
radlast.mk
checkrad
radclient
radiusd
Expand Down
2 changes: 2 additions & 0 deletions src/main/radlast.mk → src/main/radlast.mk.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ifeq (@WITH_RADLAST@,yes)
install: $(R)$(bindir)/radlast

$(R)$(bindir)/radlast: src/main/radlast | $(R)$(bindir)
@echo INSTALL $(notdir $<)
@$(INSTALL) -m 755 $< $(R)$(bindir)
endif

0 comments on commit fece06e

Please sign in to comment.