LinuxQuestions.org
Visit Jeremy's Blog.
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, 01: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, 02: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: 344Reputation: 344Reputation: 344Reputation: 344
Umm, what command did you issue? I suspect you only supplied a partial context. Duh.
 
Old 10-11-2005, 03: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, 04: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: 344Reputation: 344Reputation: 344Reputation: 344
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, 10: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, 10: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: 344Reputation: 344Reputation: 344Reputation: 344
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-11-2005, 11:17 PM   #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, 04: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 12:07 PM
SELinux: How can I clear the context when I copy a file? walkinmud Linux - Enterprise 3 08-09-2005 11:23 PM
SELinux: How can I clear the context when I copy a file? walkinmud Linux - Security 1 08-09-2005 12:37 AM
Partial file download verification Jack Taylor Linux - Networking 1 02-15-2005 12:39 PM
create file from context menu RHL 9.0 mizuki Linux - Newbie 1 05-25-2003 06:47 AM

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

All times are GMT -5. The time now is 05:51 PM.

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
Open Source Consulting | Domain Registration