Puzzling permission issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Puzzling permission issue
# 1  
Old 11-16-2011
Puzzling permission issue

I have a file, the long listing output by 'ls -l' is
Code:
-rw-r--r--   1 usera  agroup     1246 Jul  7 14:44 temp.R

The file is under a Solaris ZFS file system. As a different user (userb), I did
Code:
cp temp.R /tmp
ls -l /tmp/temp.R
-rw-r--r--   1 userb  agroup     1246 Nov 16 14:45 /tmp/temp.R

The owner is changed. How can this happen?Smilie If I do a chown straight on the file, it will tell me that I'm not owner, chown fails. This is obviously a security hole, please help.


Moderator's Comments:
Mod Comment How to use code tags

Last edited by Franklin52; 11-17-2011 at 05:40 AM.. Reason: Code tags
# 2  
Old 11-16-2011
It is expected behavior. The file was written SOMEPLACE ELSE by you. Since anyone can read the file they can also copy it to another directory and become the owner. They just cannot mess with ownerhip of the original file at all. Only root or the owner can do that.
# 3  
Old 11-16-2011
Thank you for your quick reply. I was confused and forgot the actual issue is the following.
Code:
dqscs04:/home/jhzhang:64 % ls -l /etc/hosts
-rw-r--r-- 1 root root 179 Jun 28 15:27 /etc/hosts
dqscs04:/home/jhzhang:62 % cp -p /etc/hosts .
cp: preserving permissions for `./hosts': Operation not permitted
dqscs04:/home/jhzhang:60 % ls -l hosts
-rw------- 1 root root 179 Jun 28 15:27 hosts

The current directory in the above procedure is my home direcotry and is a networked file system. If I copy the file to /tmp, which is a local file system, my user becomes the owner -- the normal situation. So the question is why the networked file system behave differently, and is the behavior normal?

Last edited by Franklin52; 11-17-2011 at 05:40 AM.. Reason: Code tags
# 4  
Old 11-16-2011
This is odd. NFS can enforce policies as to who's allowed to create what files with what permissions, but usually they'd want to prevent you making files as root -- not force them to be root. You shouldn't have permissions to do that unless you're root, for that matter.

What are the permissions of your home directory? ls -ld ~/

What happens when you cat /etc/hosts > ~/localfile instead?

Last edited by Corona688; 11-16-2011 at 07:13 PM..
# 5  
Old 11-17-2011
Code:
dqscs04:/home/jhzhang:67 % ls -ld ~/
drwxr-xr-x 107 jhzhang adusers 20480 Nov 16 17:14 /home/jhzhang/

dqscs04:/home/jhzhang:69 % cat /etc/hosts > ~/localfile
dqscs04:/home/jhzhang:70 % ls -l localfile
-rw-r--r-- 1 jhzhang adusers 179 Nov 17 09:17 localfile

My home directory is a netapp file system, type of Unix, should be equivalent to NFS.

Moderator's Comments:
Mod Comment Please use code tags!
# 6  
Old 11-17-2011
The fact your home directoy is 755 will not let you copy with -p option of cp, for you are not hte owner of the file... No issues just correct behaviour. Why would you use cp -p for anyway ? Were you hoping to modify the file and then copy back? ( Very silly...)
# 7  
Old 11-21-2011
The -p was used by the reporting user, the warning showed normal behavior, which is not part of my question.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

AUTOFS/NIS permission issue

This is unfortunately for a Tru64 5.1 PK4 system. I have Autofs running and it seems to read and mount the NIS maps, however, on a couple of maps, eventhough is says (rw), the user home directory of /home is (ro). See cut and paste Below. This prevents the automounting of Users home... (4 Replies)
Discussion started by: mrmurdock
4 Replies

2. UNIX for Advanced & Expert Users

Automount permission issue

Hi all, I am running CentOS6.3 and NFS is giving me a real hard time here: on my server a folder called /networkh has created with 777 permissions. I have setup NFS server on this server and it is supposed to serve a network. On my client machine I configed my auto.master: /nethome... (1 Reply)
Discussion started by: bashily
1 Replies

3. AIX

Permission Issue

Hi Team, I am using AIX 6.1 version. I have two log id IDs say (user1 and user2) Both users primary group is same. ex (group1) I have created directory called /logs/app using user1 and permissions are like below /logs ------ drwxrwxr-x /logs/app ----- drwxrwxrwx But all the process... (3 Replies)
Discussion started by: balasubramani04
3 Replies

4. HP-UX

Permission Issue on HP-UX

Good day guys, I am very new in UNIX and am trying to install an application which uses an application ID that requires administrative privileges (Full control). In most cases, we use SUDO to grant access to this ID however the customer insisted NOT to use SUDO and Root ID is not to be used to... (1 Reply)
Discussion started by: mcdsweet98
1 Replies

5. OS X (Apple)

file permission issue

-rw-r--r-- 1 root wheel 1676 Jul 8 13:40 group -rw-r--r-- 1 root wheel 3669 Feb 25 2010 passwd -r--r----- 1 root wheel 1242 Jan 26 2010 sudoers I can read group and passwd, but i cant read sudoers.. why? I am curenttly a staff member. (1 Reply)
Discussion started by: linuxstuff101
1 Replies

6. Shell Programming and Scripting

permission denied issue

hello I m trying to enter in a folder through my script but getting permission denied error .. Is there any command or somthing else so that i can access these folder through my script. (3 Replies)
Discussion started by: urfrnddpk
3 Replies

7. Shell Programming and Scripting

permission issue to move file

We have a script which will move the files from the each user home directory to other location to process the file in the server. The users put files in their home directory using FTP and the user home dir have 775 permission so the the application user can move the files from the home path to... (11 Replies)
Discussion started by: GIC1986
11 Replies

8. UNIX for Dummies Questions & Answers

File permission issue

Hello All, I receive a file from another server with file permission rw-r--r-- and owner of the file is the sFTP login id and group is also different from my login id. Due to this I cannot move the file from and also cannot do anything on it. Can anyone help on how to change the file... (2 Replies)
Discussion started by: maddy911
2 Replies

9. UNIX for Dummies Questions & Answers

Sudo permission issue

folks; How can i give a group a sudo permission to execute only some command "like start/stop Apache", so every user in that group can sudo to use this as himself, i mean when he tries to sudo, he will be asked for a password (and make it so he must use his own NT password not a generic one) then... (6 Replies)
Discussion started by: Katkota
6 Replies

10. Shell Programming and Scripting

Setfacl permission issue

My Admin has written a shell script (Filepermission.ksh) with the following commands and provided me 'exeutive' privileges. However, when I try to run the script, I am getting the following error message. Can some one tell me what could be missing? Thank you for your continued support. Script: ... (0 Replies)
Discussion started by: MeganP
0 Replies
Login or Register to Ask a Question