• Comments
  • Network Manager Unlink Error

    Posted on

    Hello, I am getting the following error message. How can I overcome this problem? What exactly do I need to do step by step?

    I just installed the operating system. I don't understand what is causing this error.

    My Os : Redhat 7.9

    SELinux is preventing /usr/sbin/NetworkManager from unlink access on the file /etc/resolv.conf.

    ***** Plugin restorecon (94.8 confidence) suggests ************************

    If you want to fix the label.
    /etc/resolv.conf default label should be net_conf_t.
    Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
    Do

    /sbin/restorecon -v /etc/resolv.conf

    ***** Plugin catchall_labels (5.21 confidence) suggests *******************

    If you want to allow NetworkManager to have unlink access on the resolv.conf file
    Then you need to change the label on /etc/resolv.conf
    Do

    semanage fcontext -a -t FILE_TYPE '/etc/resolv.conf'

    where FILE_TYPE is one of the following: NetworkManager_etc_rw_t, NetworkManager_tmp_t, NetworkManager_var_lib_t, NetworkManager_var_run_t, dhcpc_state_t, dhcpc_var_run_t, dnsmasq_var_run_t, hostname_etc_t, named_cache_t, net_conf_t, pppd_var_run_t, systemd_passwd_var_run_t.
    Then execute:
    restorecon -v '/etc/resolv.conf'

    ***** Plugin catchall (1.44 confidence) suggests **************************

    If you believe that NetworkManager should be allowed unlink access on the resolv.conf file by default.
    Then you should report this as a bug.
    You can generate a local policy module to allow this access.
    Do
    allow this access for now by executing:

    ausearch -c 'NetworkManager' --raw | audit2allow -M my-NetworkManager

    semodule -i my-NetworkManager.pp

    Additional Information:
    Source Context system_u:system_r:NetworkManager_t:s0
    Target Context unconfined_u:object_r:etc_t:s0
    Target Objects /etc/resolv.conf [ file ]
    Source NetworkManager
    Source Path /usr/sbin/NetworkManager
    Port
    Host tutelgitlab
    Source RPM Packages NetworkManager-1.18.8-2.el7_9.x86_64
    Target RPM Packages

    Policy RPM selinux-policy-3.13.1-268.el7_9.2.noarch
    Selinux Enabled True
    Policy Type targeted
    Enforcing Mode Enforcing
    Host Name tutelgitlab
    Platform Linux tutelgitlab 3.10.0-1160.81.1.el7.x86_64 #1
    SMP Thu Nov 24 12:21:22 UTC 2022 x86_64 x86_64
    Alert Count 1
    First Seen 2023-01-10 08:32:17 +03
    Last Seen 2023-01-10 08:32:17 +03
    Local ID 0aa2c80a-52b1-46b3-898b-743313764b2f

    Raw Audit Messages
    type=AVC msg=audit(1673328737.996:110): avc: denied { unlink } for pid=1278 comm="NetworkManager" name="resolv.conf" dev="dm-0" ino=1074582740 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0

    type=SYSCALL msg=audit(1673328737.996:110): arch=x86_64 syscall=rename success=no exit=EACCES a0=5560e87fe510 a1=5560e883c000 a2=ffffffff a3=2 items=0 ppid=1 pid=1278 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=NetworkManager exe=/usr/sbin/NetworkManager subj=system_u:system_r:NetworkManager_t:s0 key=(null)

    Hash: NetworkManager,NetworkManager_t,etc_t,file,unlink

    by

    points

    Responses

    Red Hat
    © 2025 Red Hat, Inc.