LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-08-2006, 11:01 AM   #1
Caesar Tjalbo
Member
 
Registered: Aug 2006
Location: Ņuņoa
Distribution: Aptosid
Posts: 93

Rep: Reputation: 16
Exclamation A copied file != a moved file


I run a LAMP setup on localhost. Using Drupal I've made a blog with pictures in each entry. When I move a file (.jpg) from my home directory to the relevant directory on my webserver, I get an 'Access Denied' message when I try to access it (through a browser). When I copy a picture, it shows up correctly in a browser.
Owner, group, permissions, etc. are all identical.
As far as I can determine, the only difference is how the file got into that directory. Does anyone have a clue as to why this phenomenon occurs?
 
Old 11-08-2006, 11:11 AM   #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
See this thread, comment #2.
 
Old 11-08-2006, 12:33 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Can you paste the output of "ls -liF --author" on an original in the home directory, the copied file, and then the moved file?
 
Old 11-08-2006, 01:22 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
I think what the original poster would want to see is the -Z option on ls:

ls -lZ /path/filename

The author will not restrict access, but the security context will.
 
Old 11-09-2006, 08:05 AM   #5
Caesar Tjalbo
Member
 
Registered: Aug 2006
Location: Ņuņoa
Distribution: Aptosid
Posts: 93

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by macemoneta
I apologize, I should've searched better.
Quote:
Originally Posted by macemoneta
I think what the original poster would want to see is the -Z option on ls:

ls -lZ /path/filename

The author will not restrict access, but the security context will.
The first file is a copied one, the second was moved.
Code:
-rw-rw-r--  userct userct user_u:object_r:httpd_sys_content_t Pizzicato5PlayboyPlaygirl.jpg
-rw-rw-r--  userct userct user_u:object_r:tmp_t            reparata.jpg
Quote:
Originally Posted by matthewg42
Can you paste the output of "ls -liF --author" on an original in the home directory, the copied file, and then the moved file?
Code:
  230603 -rw-rw-r--  1 userct userct userct  11409 Oct 14 16:04 Pizzicato5PlayboyPlaygirl.jpg
11387026 -rw-rw-r--  1 userct userct userct   5238 Oct 14 16:04 reparata.jpg
The context concept was unknown to me. The chcon command macemoneta gave in the other thread worked (checked in browser), ls -lZ now gives:
Code:
-rw-rw-r--  userct userct user_u:object_r:httpd_sys_content_t Pizzicato5PlayboyPlaygirl.jpg
-rw-rw-r--  userct userct system_u:object_r:httpd_sys_content_t reparata.jpg
I must admit to have enabled SELinux upon install but I've never looked into what it does.

Thanks!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copied xorg.conf file, now X won't load Shaw-n Linux - Newbie 6 04-19-2006 01:54 AM
mv is producing an warning for every moved file raees Linux - Software 2 05-10-2005 02:30 PM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 04:15 AM
file get renamed when copied to external hard drive pgajeski21 Linux - Hardware 11 04-15-2004 11:33 AM
How to play a media file/ video file/mp3 file recorded in harddisk/cd-rom arindam Linux - Newbie 2 09-05-2003 11:31 AM


All times are GMT -5. The time now is 04:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration