LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-11-2005, 02:33 PM   #1
DevNRG
LQ Newbie
 
Registered: Sep 2005
Posts: 6

Rep: Reputation: 0
chcon: can't apply partial context to unlabeled file...


Im on FC3 and I got this message when trying to fix context for /htdocs/ and Im stumped. So thanks for any help in advance.
 
Old 10-11-2005, 03:16 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Umm, what command did you issue? I suspect you only supplied a partial context. Duh.
 
Old 10-11-2005, 04:43 PM   #3
DevNRG
LQ Newbie
 
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
chcon -R -h -t httpd_sys_content_t /usr/local/apache2/htdocs
 
Old 10-11-2005, 05:19 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Yup, that's a partial context. You want:

chcon -h system_u:object_r:httpd_sys_content_t /usr/local/apache2/htdocs

chcon -R -h root:object_r:httpd_sys_content_t /usr/local/apache2/htdocs/*

You were setting only the type (not the user or role) of the files, which is OK if the already have those fields assigned. With them not assigned, you must fully specify the context.
 
Old 10-11-2005, 11:02 PM   #5
DevNRG
LQ Newbie
 
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Didn't get any negative error messages but it didnt fix my problem I was hoping to solve. I can't list any directories outside of /htdocs ; ie /htdocs/utstats/ . I still get access forbidden. I even did a touch test and echo thisisatest >> test. That all works fine. So Im still in a hole. Thanks for putting forth the effort though.
 
Old 10-11-2005, 11:15 PM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Check /var/log/messages for AVC access denied messages when you try to access the files. If there are none, then the issue is the http.conf. You should see something in /var/log/httpd/error_log.
 
Old 10-12-2005, 12:17 AM   #7
DevNRG
LQ Newbie
 
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
[Wed Oct 12 00:15:14 2005] [error] [client 71.242.11.243] Directory index forbidden by rule: /usr/local/apache2/htdocs/utstat$


Got to check the conf.Hmm
 
Old 10-12-2005, 05:01 PM   #8
DevNRG
LQ Newbie
 
Registered: Sep 2005
Posts: 6

Original Poster
Rep: Reputation: 0
Its fixed, thanks for the help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Partial Internet jrcreasy Linux - Networking 5 08-20-2005 01:07 PM
SELinux: How can I clear the context when I copy a file? walkinmud Linux - Enterprise 3 08-10-2005 12:23 AM
SELinux: How can I clear the context when I copy a file? walkinmud Linux - Security 1 08-09-2005 01:37 AM
Partial file download verification Jack Taylor Linux - Networking 1 02-15-2005 01:39 PM
create file from context menu RHL 9.0 mizuki Linux - Newbie 1 05-25-2003 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration