chcon: can't apply partial context to unlabeled file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I get the following when trying to allow httpd to write to application specific directories. Can anyone help me resolve this?



[xxx MISP]# chcon -t httpd_sys_rw_content_t /var/www/MISP/app/files
chcon: can't apply partial context to unlabeled file ‘/var/www/MISP/app/files’






share|improve this question





















  • What does ls -lZ var/www/MISP/app/files return?
    – Raman Sailopal
    Apr 18 at 14:00










  • -rw-r----- root apache ? empty drwxr-x--- root apache ? feed-metadata drwxr-x--- root apache ? misp-galaxy drwxr-x--- root apache ? misp-objects drwxr-x--- root apache ? scripts drwxr-x--- root apache ? taxonomies drwxr-x--- apache apache ? terms drwxr-x--- root apache ? warninglists
    – user286785
    Apr 18 at 14:10










  • Yes, but what are the selinux contexts associated with the listing (hence the -Z flag)
    – Raman Sailopal
    Apr 18 at 14:14










  • I used the Z flag, but it didn't pull back anything additional.
    – user286785
    Apr 18 at 14:35






  • 1




    Do you actually have selinux enabled and running on the system?
    – Raman Sailopal
    Apr 18 at 15:00














up vote
0
down vote

favorite












I get the following when trying to allow httpd to write to application specific directories. Can anyone help me resolve this?



[xxx MISP]# chcon -t httpd_sys_rw_content_t /var/www/MISP/app/files
chcon: can't apply partial context to unlabeled file ‘/var/www/MISP/app/files’






share|improve this question





















  • What does ls -lZ var/www/MISP/app/files return?
    – Raman Sailopal
    Apr 18 at 14:00










  • -rw-r----- root apache ? empty drwxr-x--- root apache ? feed-metadata drwxr-x--- root apache ? misp-galaxy drwxr-x--- root apache ? misp-objects drwxr-x--- root apache ? scripts drwxr-x--- root apache ? taxonomies drwxr-x--- apache apache ? terms drwxr-x--- root apache ? warninglists
    – user286785
    Apr 18 at 14:10










  • Yes, but what are the selinux contexts associated with the listing (hence the -Z flag)
    – Raman Sailopal
    Apr 18 at 14:14










  • I used the Z flag, but it didn't pull back anything additional.
    – user286785
    Apr 18 at 14:35






  • 1




    Do you actually have selinux enabled and running on the system?
    – Raman Sailopal
    Apr 18 at 15:00












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I get the following when trying to allow httpd to write to application specific directories. Can anyone help me resolve this?



[xxx MISP]# chcon -t httpd_sys_rw_content_t /var/www/MISP/app/files
chcon: can't apply partial context to unlabeled file ‘/var/www/MISP/app/files’






share|improve this question













I get the following when trying to allow httpd to write to application specific directories. Can anyone help me resolve this?



[xxx MISP]# chcon -t httpd_sys_rw_content_t /var/www/MISP/app/files
chcon: can't apply partial context to unlabeled file ‘/var/www/MISP/app/files’








share|improve this question












share|improve this question




share|improve this question








edited Jun 15 at 8:28









U880D

399314




399314









asked Apr 18 at 13:51









user286785

1




1











  • What does ls -lZ var/www/MISP/app/files return?
    – Raman Sailopal
    Apr 18 at 14:00










  • -rw-r----- root apache ? empty drwxr-x--- root apache ? feed-metadata drwxr-x--- root apache ? misp-galaxy drwxr-x--- root apache ? misp-objects drwxr-x--- root apache ? scripts drwxr-x--- root apache ? taxonomies drwxr-x--- apache apache ? terms drwxr-x--- root apache ? warninglists
    – user286785
    Apr 18 at 14:10










  • Yes, but what are the selinux contexts associated with the listing (hence the -Z flag)
    – Raman Sailopal
    Apr 18 at 14:14










  • I used the Z flag, but it didn't pull back anything additional.
    – user286785
    Apr 18 at 14:35






  • 1




    Do you actually have selinux enabled and running on the system?
    – Raman Sailopal
    Apr 18 at 15:00
















  • What does ls -lZ var/www/MISP/app/files return?
    – Raman Sailopal
    Apr 18 at 14:00










  • -rw-r----- root apache ? empty drwxr-x--- root apache ? feed-metadata drwxr-x--- root apache ? misp-galaxy drwxr-x--- root apache ? misp-objects drwxr-x--- root apache ? scripts drwxr-x--- root apache ? taxonomies drwxr-x--- apache apache ? terms drwxr-x--- root apache ? warninglists
    – user286785
    Apr 18 at 14:10










  • Yes, but what are the selinux contexts associated with the listing (hence the -Z flag)
    – Raman Sailopal
    Apr 18 at 14:14










  • I used the Z flag, but it didn't pull back anything additional.
    – user286785
    Apr 18 at 14:35






  • 1




    Do you actually have selinux enabled and running on the system?
    – Raman Sailopal
    Apr 18 at 15:00















What does ls -lZ var/www/MISP/app/files return?
– Raman Sailopal
Apr 18 at 14:00




What does ls -lZ var/www/MISP/app/files return?
– Raman Sailopal
Apr 18 at 14:00












-rw-r----- root apache ? empty drwxr-x--- root apache ? feed-metadata drwxr-x--- root apache ? misp-galaxy drwxr-x--- root apache ? misp-objects drwxr-x--- root apache ? scripts drwxr-x--- root apache ? taxonomies drwxr-x--- apache apache ? terms drwxr-x--- root apache ? warninglists
– user286785
Apr 18 at 14:10




-rw-r----- root apache ? empty drwxr-x--- root apache ? feed-metadata drwxr-x--- root apache ? misp-galaxy drwxr-x--- root apache ? misp-objects drwxr-x--- root apache ? scripts drwxr-x--- root apache ? taxonomies drwxr-x--- apache apache ? terms drwxr-x--- root apache ? warninglists
– user286785
Apr 18 at 14:10












Yes, but what are the selinux contexts associated with the listing (hence the -Z flag)
– Raman Sailopal
Apr 18 at 14:14




Yes, but what are the selinux contexts associated with the listing (hence the -Z flag)
– Raman Sailopal
Apr 18 at 14:14












I used the Z flag, but it didn't pull back anything additional.
– user286785
Apr 18 at 14:35




I used the Z flag, but it didn't pull back anything additional.
– user286785
Apr 18 at 14:35




1




1




Do you actually have selinux enabled and running on the system?
– Raman Sailopal
Apr 18 at 15:00




Do you actually have selinux enabled and running on the system?
– Raman Sailopal
Apr 18 at 15:00










2 Answers
2






active

oldest

votes

















up vote
1
down vote













You need to add some rule with semanage for your app/files directory, and then apply with restorecon -Rv.



See detailed explanations in this article (especially section about using httpd_sys_rw_content_t): Configuring SELinux Policies for Apache Web Servers






share|improve this answer






























    up vote
    0
    down vote













    According other threads here on Unix Stackexchange: "chcon: can't apply partial context to unlabeled file '/usr/sbin/xrdp'" or "chcon: can't apply partial context to unlabeled file while installing nagios with SELinux", it seems that it is necessary to label the files using semanage and if there is SELinux in enforcing mode.






    share|improve this answer





















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438509%2fchcon-cant-apply-partial-context-to-unlabeled-file%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      You need to add some rule with semanage for your app/files directory, and then apply with restorecon -Rv.



      See detailed explanations in this article (especially section about using httpd_sys_rw_content_t): Configuring SELinux Policies for Apache Web Servers






      share|improve this answer



























        up vote
        1
        down vote













        You need to add some rule with semanage for your app/files directory, and then apply with restorecon -Rv.



        See detailed explanations in this article (especially section about using httpd_sys_rw_content_t): Configuring SELinux Policies for Apache Web Servers






        share|improve this answer

























          up vote
          1
          down vote










          up vote
          1
          down vote









          You need to add some rule with semanage for your app/files directory, and then apply with restorecon -Rv.



          See detailed explanations in this article (especially section about using httpd_sys_rw_content_t): Configuring SELinux Policies for Apache Web Servers






          share|improve this answer















          You need to add some rule with semanage for your app/files directory, and then apply with restorecon -Rv.



          See detailed explanations in this article (especially section about using httpd_sys_rw_content_t): Configuring SELinux Policies for Apache Web Servers







          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Jun 21 at 8:58









          U880D

          399314




          399314











          answered Jun 15 at 16:45









          tonioc

          1,11457




          1,11457






















              up vote
              0
              down vote













              According other threads here on Unix Stackexchange: "chcon: can't apply partial context to unlabeled file '/usr/sbin/xrdp'" or "chcon: can't apply partial context to unlabeled file while installing nagios with SELinux", it seems that it is necessary to label the files using semanage and if there is SELinux in enforcing mode.






              share|improve this answer

























                up vote
                0
                down vote













                According other threads here on Unix Stackexchange: "chcon: can't apply partial context to unlabeled file '/usr/sbin/xrdp'" or "chcon: can't apply partial context to unlabeled file while installing nagios with SELinux", it seems that it is necessary to label the files using semanage and if there is SELinux in enforcing mode.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  According other threads here on Unix Stackexchange: "chcon: can't apply partial context to unlabeled file '/usr/sbin/xrdp'" or "chcon: can't apply partial context to unlabeled file while installing nagios with SELinux", it seems that it is necessary to label the files using semanage and if there is SELinux in enforcing mode.






                  share|improve this answer













                  According other threads here on Unix Stackexchange: "chcon: can't apply partial context to unlabeled file '/usr/sbin/xrdp'" or "chcon: can't apply partial context to unlabeled file while installing nagios with SELinux", it seems that it is necessary to label the files using semanage and if there is SELinux in enforcing mode.







                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered Jun 15 at 7:24









                  U880D

                  399314




                  399314






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438509%2fchcon-cant-apply-partial-context-to-unlabeled-file%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay