Re: openvpn-client@nbecker8 won't start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Neal Becker wrote:
> Well as to how the file had the wrong context, after re-installing F35
> on the new SSD, I copied the /etc/openvpn directory from my borg
> backup of the old one.  On the old machine I was running with selinux
> disabled, so maybe it was wrong there also.
> 
> /etc/openvpn/client/nbecker8.conf is a hand-edited file.  When first
> created with e.g., emacs, is there a mechanism to ensure it got the
> correct context?

There is.  SELinux policy defines the defaults for paths.
The `semanage fcontext --list` command will output all of
them (this is from an f34 host, in case it differs):

  $ sudo semanage fcontext --list | grep /etc/openvpn
  /etc/openvpn(/.*)?          all files       system_u:object_r:openvpn_etc_t:s0 
  /etc/openvpn/ipp\.txt       regular file    system_u:object_r:openvpn_etc_rw_t:s0 
  /etc/openvpn/scripts(/.*)?  all files       system_u:object_r:openvpn_unconfined_script_exec_t:s0 

If I create a file in the openvpn client directory, it gets
the desired labeling:

  $ sudo ls -Z /etc/openvpn/client/
  $ sudo touch /etc/openvpn/client/test
  $ sudo ls -Z /etc/openvpn/client/test
  unconfined_u:object_r:openvpn_etc_t:s0 test

If I create a file elsewhere and move or copy into the
location, it's label is not changed (I'd need to use
restorecon or another tool to change it):

  $ touch /tmp/test
  $ sudo mv /tmp/test /etc/openvpn/client/
  $ sudo ls -Z /etc/openvpn/client/test
  unconfined_u:object_r:user_tmp_t:s0 test

In the process of debugging this, did you perhaps recreate
the file?  Editing it could potentially do that, if your
editor overwrites the existing file on save -- vim does not
do that and I don't know that emacs would differ, but I
didn't test with emacs.

It's fixed now, so that's just a curiosity.  But obviously,
many of us here are very curious by nature. :)

-- 
Todd

Attachment: signature.asc
Description: PGP signature

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux