Bug 1421207

Summary: radiusd does not work with log file specified by -l option
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Aster <jaster>
Component: freeradiusAssignee: Nikolai Kondrashov <nikolai.kondrashov>
Status: CLOSED ERRATA QA Contact: Jaroslav Aster <jaster>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: dpal, pkis
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 20:38:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Aster 2017-02-10 15:38:19 UTC
Description of problem:

radiusd does not work with log file specified by -l option. It is a regression, older version works fine.


Version-Release number of selected component (if applicable):

freeradius-3.0.12-1.el7_3


How reproducible:

100%


Steps to Reproduce:

# ls -l /tmp/radius.log
ls: cannot access /tmp/radius.log: No such file or directory
# radiusd -X -l /tmp/radius.log
radiusd: Cannot change ownership of log file /tmp/radius.log: Operation not permitted
# ls -l /tmp/radius.log
-rw-r-----. 1 root root 3665 Feb 10 10:21 /tmp/radius.log

Workaround is create log file first and then change its ownership to radiusd:radiusd.

# touch /tmp/radius.log
# chown radiusd:radiusd /tmp/radius.log
# radiusd -X -l /tmp/radius.log
^C

It appears that radiusd first creates log file as user who run it, write some messages into the log file, then switch to user and group radiusd and then, tries to change ownership of the log file.

strace output:

...
...
setgroups(1, [95])                      = 0
setgid(95)                              = 0
mkdir("/var/log/radius", 0700)          = -1 EEXIST (File exists)
geteuid()                               = 0
setresuid(4294967295, 95, 0)            = 0
geteuid()                               = 95
setrlimit(RLIMIT_CORE, {rlim_cur=0, rlim_max=0}) = 0
fchown(3, 95, 95)                       = -1 EPERM (Operation not permitted)


Actual results:

radiusd does not work with given log file.


Expected results:

radius works with given log file.

Comment 3 Nikolai Kondrashov 2017-02-16 14:05:06 UTC
Issue reported upstream:
https://github.com/FreeRADIUS/freeradius-server/issues/1914

Comment 4 Nikolai Kondrashov 2017-02-16 18:18:19 UTC
Upstream has fixed the issue.

Comment 5 Jaroslav Aster 2017-02-17 13:13:30 UTC
It was fast. Thanks.

Comment 8 errata-xmlrpc 2017-08-01 20:38:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1954