Fix output to log file specified with -l option

This commit is contained in:
Nikolai Kondrashov 2017-02-21 14:31:37 +01:00
parent 1a843f6fe3
commit a687c9a985
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,49 @@
From ea411c1bc571aae541e609d4501184f21c67c10f Mon Sep 17 00:00:00 2001
From: "Alan T. DeKok" <aland@freeradius.org>
Date: Thu, 16 Feb 2017 10:59:22 -0500
Subject: [PATCH] suid down after fchown. Fixes #1914
(cherry picked from commit a408998ab22c4e3e443e53bdf07eff4986f26132)
---
src/main/mainconfig.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/mainconfig.c b/src/main/mainconfig.c
index 43bc2b136..938a47ae2 100644
--- a/src/main/mainconfig.c
+++ b/src/main/mainconfig.c
@@ -643,15 +643,6 @@ static int switch_users(CONF_SECTION *cs)
}
/*
- * Once we're done with all of the privileged work,
- * permanently change the UID.
- */
- if (do_suid) {
- rad_suid_set_down_uid(server_uid);
- rad_suid_down();
- }
-
- /*
* If we don't already have a log file open, open one
* now. We may not have been logging anything yet. The
* server normally starts up fairly quietly.
@@ -685,6 +676,15 @@ static int switch_users(CONF_SECTION *cs)
}
/*
+ * Once we're done with all of the privileged work,
+ * permanently change the UID.
+ */
+ if (do_suid) {
+ rad_suid_set_down_uid(server_uid);
+ rad_suid_down();
+ }
+
+ /*
* This also clears the dumpable flag if core dumps
* aren't allowed.
*/
--
2.11.0

View File

@ -25,6 +25,7 @@ Patch1: freeradius-redhat-config.patch
Patch2: freeradius-Use-system-crypto-policy-by-default.patch
Patch3: freeradius-Fix-three-cases-of-comparing-pointer-to-zero-char.patch
Patch4: freeradius-Support-OpenSSL-v1.1.0.patch
Patch5: freeradius-suid-down-after-fchown.-Fixes-1914.patch
%global docdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
@ -194,6 +195,7 @@ This plugin provides the REST support for the FreeRADIUS server project.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
# Force compile/link options, extra security for network facing daemon
@ -797,6 +799,7 @@ exit 0
%changelog
* Tue Feb 21 2017 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> - 3.0.12-3
- Do not fail logrotate if radiusd is not running.
- Fix output to log file specified with -l option.
* Mon Feb 20 2017 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> - 3.0.12-2
- Fix three cases of comparing pointers to zero characters