Bug 237633 - /usr/sbin/rndc has bad default context
/usr/sbin/rndc has bad default context
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2007-04-24 06:20 EDT by Adam Tkac
Modified: 2013-04-30 19:35 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-24 10:46:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adam Tkac 2007-04-24 06:20:23 EDT
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

How reproducible:

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 10:07:00 EDT
What avc's were you seeing before the chcon?
Comment 2 Adam Tkac 2007-04-24 10:29:05 EDT
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)

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

Comment 4 Adam Tkac 2007-04-24 10:46:28 EDT
(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

Note You need to log in before you can comment on or make changes to this bug.