resolves: bug#1029941

PW_TYPE_BOOLEAN config item should be declared int, not bool
This commit is contained in:
John Dennis 2013-11-13 18:59:04 -05:00
parent e79fcfae3e
commit 5a03d53029
2 changed files with 85 additions and 4 deletions

View File

@ -0,0 +1,73 @@
From 3e038dd2b6ddc77eb27205d04252378f6038abcb Mon Sep 17 00:00:00 2001
From: John Dennis <jdennis@redhat.com>
Date: Wed, 13 Nov 2013 18:23:43 -0500
Subject: [PATCH] PW_TYPE_BOOLEAN config item should be declared int, not bool
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
PW_TYPE_BOOLEAN config items are treated as int by the config
parser in conffile.c. bools and ints are not the same size,
on many architectures sizeof(bool) == 1 and sizeof(int) == 4
Manifestation of the problem
# Loaded module rlm_exec
# Instantiating module "echo" from file /etc/raddb/mods-enabled/echo
exec echo {
wait = yes
program = "/bin/echo %{User-Name}"
input_pairs = "request"
output_pairs = "reply"
shell_escape = yes
}
Error: /etc/raddb/mods-enabled/echo[34]: Cannot read output pairs if wait = no
Error: /etc/raddb/mods-enabled/echo[34]: Instantiation failed for module "echo"
In rlm_exec.c:
if (!inst->wait &&
(inst->output != NULL)) {
cf_log_err_cs(conf, "Cannot read output pairs if wait = no");
return -1;
}
wait = yes in the config file and is parsed as TRUE which writes a 1
into an integer but inst->wait is read as a byte so the test is not
performed correctly.
---
src/modules/rlm_exec/rlm_exec.c | 2 +-
src/modules/rlm_pap/rlm_pap.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/modules/rlm_exec/rlm_exec.c b/src/modules/rlm_exec/rlm_exec.c
index 0d8149d..4770359 100644
--- a/src/modules/rlm_exec/rlm_exec.c
+++ b/src/modules/rlm_exec/rlm_exec.c
@@ -33,7 +33,7 @@ RCSID("$Id$")
typedef struct rlm_exec_t {
char const *xlat_name;
int bare;
- bool wait;
+ int wait;
char *program;
char *input;
char *output;
diff --git a/src/modules/rlm_pap/rlm_pap.c b/src/modules/rlm_pap/rlm_pap.c
index 7ebcedf..8ec63dc 100644
--- a/src/modules/rlm_pap/rlm_pap.c
+++ b/src/modules/rlm_pap/rlm_pap.c
@@ -42,9 +42,9 @@ RCSID("$Id$")
*/
typedef struct rlm_pap_t {
char const *name; /* CONF_SECTION->name, not strdup'd */
- bool auto_header;
+ int auto_header;
int auth_type;
- bool normify;
+ int normify;
} rlm_pap_t;
/*
--
1.8.1.4

View File

@ -1,7 +1,7 @@
Summary: High-performance and highly configurable free RADIUS server
Name: freeradius
Version: 3.0.0
Release: 1%{?dist}
Release: 3%{?dist}
License: GPLv2+ and LGPLv2+
Group: System Environment/Daemons
URL: http://www.freeradius.org/
@ -22,6 +22,7 @@ Source103: freeradius-pam-conf
Source104: freeradius-tmpfiles.conf
Patch1: freeradius-redhat-config.patch
Patch2: freeradius-bool-config.patch
%global docdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
@ -38,9 +39,9 @@ BuildRequires: libpcap-devel
BuildRequires: systemd-units
BuildRequires: libtalloc-devel
BuildRequires: pcre-devel
BuildRequires: tncfhh-devel
%if ! 0%{?rhel}
BuildRequires: tncfhh-devel
BuildRequires: libyubikey-devel
BuildRequires: ykclient-devel
%endif
@ -177,6 +178,7 @@ This plugin provides the unixODBC support for the FreeRADIUS server project.
%prep
%setup -q -n %{dist_base}
%patch1 -p1 -b .redhat-config
%patch2 -p1 -b .bool-config
%build
# Force compile/link options, extra security for network facing daemon
@ -539,9 +541,7 @@ exit 0
%endif
%{_libdir}/freeradius/rlm_eap_sim.so
%{_libdir}/freeradius/rlm_eap_tls.so
%if ! 0%{?rhel}
%{_libdir}/freeradius/rlm_eap_tnc.so
%endif
%{_libdir}/freeradius/rlm_eap_ttls.so
%{_libdir}/freeradius/rlm_exec.so
%{_libdir}/freeradius/rlm_expiration.so
@ -722,6 +722,14 @@ exit 0
%{_libdir}/freeradius/rlm_sql_unixodbc.so
%changelog
* Wed Nov 13 2013 John Dennis <jdennis@redhat.com> - 3.0.0-3
- resolves: bug#1029941
PW_TYPE_BOOLEAN config item should be declared int, not bool
* Mon Oct 28 2013 John Dennis <jdennis@redhat.com> - 3.0.0-2
- resolves: bug#1024119
tncfhh-devel is now available in RHEL-7, remove conditional BuildRequires
* Sun Oct 13 2013 John Dennis <jdennis@redhat.com> - 3.0.0-1
- Offical 3.0 gold release from upstream
- resolves: bug#1016873