Bug 237633

Summary: /usr/sbin/rndc has bad default context
Product: [Fedora] Fedora Reporter: Adam Tkac <atkac>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-24 14:46:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Tkac 2007-04-24 10:20:23 UTC
Description of problem:
by default context (system_u:object_r:ndc_exec_t) rndc is not able to connect to
named (system_u:object_r:named_exec_t). I set contexts by restorecon utility.
When I tried set rndc's context with "chcon --reference /usr/sbin/named" all
works fine. 

Version-Release number of selected component (if applicable):
rpm -q selinux-policy
selinux-policy-2.5.12-5.fc7

How reproducible:
always

Steps to Reproduce:
1. restorecon /usr/sbin/rndc
2. restorecon /usr/sbin/named
3. try run "rndc status" to get status of named

Actual results:
see nice output: "rndc: bind socket: permission denied"

Expected results:
controling server through rndc (server control utility)

Additional info:
as I wrote upper, after "chcon --reference /usr/sbin/named /usr/sbin/rndc" all
works fine.

Comment 1 Daniel Walsh 2007-04-24 14:07:00 UTC
What avc's were you seeing before the chcon?

Comment 2 Adam Tkac 2007-04-24 14:29:05 UTC
This is in log. I'm not selinux expert so problem could be in bind package or my
configuration :)

type=AVC msg=audit(1177424519.822:42): avc:  denied  { node_bind } for  pid=3864
comm="rndc" scontext=user_u:system_r:ndc_t:s0
tcontext=system_u:object_r:inaddr_any_node_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1177424519.822:42): arch=c000003e syscall=49 success=no
exit=-13 a0=14 a1=55555575ba00 a2=10 a3=0 items=0 ppid=3579 pid=3864
auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0
comm="rndc" exe="/usr/sbin/rndc" subj=user_u:system_r:ndc_t:s0 key=(null)

-A-

Comment 3 Daniel Walsh 2007-04-24 14:33:51 UTC
Latest policy should have this fixed.

selinux-policy-2.6.1-1.fc7

Comment 4 Adam Tkac 2007-04-24 14:46:28 UTC
(In reply to comment #3)
> Latest policy should have this fixed.
> 
> selinux-policy-2.6.1-1.fc7

Yeah. I've compiled latest selinux-policy from CVS and all works fine. Closing