Bug 207221

Summary: nm-applet does not appear, with SELinux error message
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: NetworkManagerAssignee: Christopher Aillon <caillon>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dwalsh, johnp, rousseau
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: 2006-09-21 23:12:12 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 Dave Malcolm 2006-09-20 00:08:44 UTC
Description of problem:
Getting an error message from nm-applet:
** (nm-applet:2542): WARNING **: <WARNING>       nma_dbus_init ():
org.freedesktop.DBus.Error.AccessDenied raised:
 An SELinux policy prevents this sender from sending this message to this
recipient (rejected message had interface "org.freedesktop.DBus" member "Hello"
error name "(unset)" destination "org.freedesktop.DBus")


Version-Release number of selected component (if applicable):
NetworkManager-gnome-0.6.4-5.fc6
dbus-0.92-1.fc6

How reproducible:
100%

Steps to Reproduce:
1. SELinux targetted policy, with enforcing on.
2. run nm-applet from terminal
  
Actual results:
Error message as above on startup and every few seconds subsequently.  Applet
does not appear on panel.

Expected results:
No error message; applet should appear on panel.

Additional info:
nm-applet process is running as "user_u:system_r:unconfined_t"; should it be? 
Should I be starting it a different way?

NetworkManager process is runnning as "system_u:system_r:initrc_t" (which seems
reasonable)

Comment 1 Dave Malcolm 2006-09-20 14:34:58 UTC
Looks similar to bug 207285

Comment 2 Dave Malcolm 2006-09-20 16:18:16 UTC
This is with selinux-policy-2.3.13-5


Comment 3 Suzanne Hillman 2006-09-20 16:27:46 UTC
This was working fine with selinux-policy-2.3.13-3 (on the laptop I'm testing
with at home), and the presumably relevant domain info is:

nm-applet is user_u:system_r:unconfined_t
NM is system_u:system_r:NetworkManager_t
dbus-daemon is system_u:system_r:system_dbusd_t

Comment 4 Dave Malcolm 2006-09-20 16:31:32 UTC
Failing for me with selinux-policy-2.3.13-5; the domains for me are:
nm-applet is also user_u:system_r:unconfined_t
NM is different for me: system_u:system_r:initrc_t
dbus-daemon --system is system_u:system_r:initrc_t
dbus-daemon --session is user_u:system_r:unconfined_t

So it looks like my NM and dbus might be in the wrong domains.

Comment 5 Daniel Walsh 2006-09-20 16:55:00 UTC
Does 
service NetworkManager restart

fix the problem?

how is the binary labeled?


Comment 6 Dave Malcolm 2006-09-20 17:11:14 UTC
No:

sudo /sbin/service NetworkManager restart
Stopping NetworkManager daemon:                            [  OK  ]
Setting network parameters... 
Starting NetworkManager daemon:                            [  OK  ]
[david@brick ~]$ ps axZ | grep Net
user_u:system_r:initrc_t        18752 ?        Ss     0:00 NetworkManager
--pid-file=/var/run/NetworkManager/NetworkManager.pid

ls -Z /usr/sbin/NetworkManager
-rwxr-xr-x  root root system_u:object_r:sbin_t         /usr/sbin/NetworkManager

[david@brick ~]$ /sbin/fixfiles check /usr/sbin/NetworkManager
[david@brick ~]$ echo $?
0

[david@brick ~]$ nm-applet 
GTK Accessibility Module initialized
Bonobo accessibility support initialized

** (nm-applet:19254): WARNING **: <WARNING>      nma_dbus_init ():
org.freedesktop.DBus.Error.AccessDenied raised:
 An SELinux policy prevents this sender from sending this message to this
recipient (rejected message had interface "org.freedesktop.DBus" member "Hello"
error name "(unset)" destination "org.freedesktop.DBus")


Comment 7 Daniel Walsh 2006-09-20 19:22:24 UTC
Wrong context 

ls -lZ /usr/sbin/NetworkManager
-rwxr-xr-x  root root system_u:object_r:NetworkManager_exec_t:s0
/usr/sbin/NetworkManager

Thy 
restorecon -v /usr/sbin/NetworkManager

Comment 8 Dave Malcolm 2006-09-20 19:43:04 UTC
For some reason it's not working:
[root@brick sbin]# /sbin/restorecon -v NetworkManager
[root@brick sbin]# echo $?
0
[root@brick sbin]# ls -alZ NetworkManager
-rwxr-xr-x  root root system_u:object_r:sbin_t         NetworkManager
[root@brick sbin]# rpm -qa | grep policy
policycoreutils-1.30.29-1
selinux-policy-2.3.13-5
[root@brick sbin]# uname -a
Linux brick 2.6.16-1.2252_FC6 #1 SMP Tue Jun 6 00:52:35 EDT 2006 i686 i686 i386
GNU/Linux

Any suggestions?  Am I missing something obvious here?

Comment 9 Dave Malcolm 2006-09-21 18:15:35 UTC
Yes: I didn't have selinux-policy-targeted installed.

Now installed, and fs relabelled.  
Will retry on next reboot