Simple directory copy permissions issue

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Simple directory copy permissions issue

Postby aikiPupil » 25 Feb 2010, 07:38

I seem to be having some permissions issues that I am not sure I completely understand.

I am simply trying to copy a directory containing files from one place to another.


The user is a part of the following groups:
Code: Select all
$ pw usershow dom4in.ss4rv3r -P
Login Name: MYUSER    #1002         Group: wheel             #0
 Full Name: MY USER
      Home: /home/MYUSER            Class:
     Shell: /bin/sh                        Office: [None]
Work Phone: [None]                     Home Phone: [None]
Acc Expire: [None]                     Pwd Expire: [None]
    Groups: www


The destimation directory [FILE]/usr/local/www/apache22/data[/FILE] has the following permissions: (NOTE: I set it to everything trying to get it to work)
Code: Select all
drwxrwxrwx  2 www   www    -  512 Feb 25 00:23 data/

The source directory [FILE]/usr/home/MYUSER/www[/FILE] has the following permissions: (NOTE: I set it to everything trying to get it to work)
Code: Select all
drwxrwxrwx  2 MYUSER  wheel  512 Feb 24 01:47 www


The file has the following permissions: (NOTE: I set it to everything trying to get it to work)
Code: Select all
-rwxrwxrwx  1 MYUSER   wheel  -   450 Feb 25 00:53 template.html*


The following command is failing due to permissions:
Code: Select all
$ cp /usr/home/MYUSER/www/*  /usr/local/www/apache22/data
cp: /usr/local/www/apache22/data/template.html: Permission denied


I think I might be having a fundemental misunderstanding of how the permissins work in freebsd.
Should the above command have worked because all permissins were set on the destination directory?

Do I need to change permissions on every directory between the two? That does not seem right.
aikiPupil
Junior Member
 
Posts: 11
Joined: 27 Jan 2010, 04:57

Postby Speedy » 25 Feb 2010, 09:49

To my knowledge FreeBSD permissions are following the standard.

What are the permissions of [FILE]/usr/local/www/apache22/data/template.html[/FILE]
What are the permissions of [FILE]/usr/local/www/apache22/data[/FILE]
Speedy
Member
 
Posts: 195
Joined: 16 Nov 2008, 19:12
Location: Acadiana

Postby mamalos » 25 Feb 2010, 15:30

The permissions of the file [FILE]/usr/local/www/apache22/data/template.html[/FILE] are the ones you are stating in your post?

try [CMD=" "]ls -lao /usr/local/www/apache22/data/template.html[/CMD] to see if there are any flags on the file that should be handled with chflags.

Then if everything is normal, [CMD=" "]rm -f /usr/local/www/apache22/data/template.html[/CMD] should work (since the directory is writeable by your user), and you should be able to [CMD=" "]echo '' > /usr/local/www/apache22/data/template.html[/CMD] and erase it, if you wanted to.

Lastly, check if there you have enable acls on the partition, if it's mounted read only...and that's all I can come up with at the moment (there are also some stuff regarding MAC that could disallow you to write in the folder, but I don't suppose you have enabled something like that).
mamalos
Member
 
Posts: 427
Joined: 18 Mar 2009, 12:17
Location: Greece

Postby aikiPupil » 26 Feb 2010, 03:44

Ok, So I feel pretty awkward now that I realize the problem.

I opened up all the permissions on the file directories and files to copy neglecting to change permissions on the files that were to be copied over and thus the permissions issue.

Thanks everyone with your patience as I am new to unix/freeBSD.
aikiPupil
Junior Member
 
Posts: 11
Joined: 27 Jan 2010, 04:57


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests