Puzzling permission issue


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Puzzling permission issue
# 8  
Old 11-23-2011
Quote:
1)the question is why the networked file system behave differently, 2)and is the behavior normal?
1) It is not ! You prove me it is then...
Copying to /tmp ...
Most systems have /tmp permissions set like:
Code:
drwxrwxrwx  95 bin        bin           5120 Nov 23 16:16 /tmp
drwxrwxrwt 9 root root 4096 Nov 23 14:32 /tmp
etc...

Which is not the case of your home directory...
# 9  
Old 11-23-2011
Quote:
Originally Posted by vbe
1) It is not ! You prove me it is then...
Unless I missed something, this trace of his:
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

shows him creating a file owned by root in his home directory by cp -p when not logged in as root, which seems at least a little weird.
# 10  
Old 11-23-2011
But what does this mean then?
Code:
cp: preserving permissions for `./hosts': Operation not permitted

I am finding it not clear, He should have shown us his UID to undestand if any issues... (I don't see...) because nowhere does he say under which account he is looking or trying things...
# 11  
Old 11-23-2011
When he created a file with cat /etc/hosts > ~/localfile instead, it did this:

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

So he isn't logged in as root.

So cp -p is allowing him to create root-owned files even though he's not root, and even though it causes an error message. Very odd! Smilie

---------- Post updated at 10:07 AM ---------- Previous update was at 09:59 AM ----------

If it somehow allows him to change the ownership but still enforces file permissions, then cp might be locking itself out of the file by doing so. If it changed the ownership first, it'd no longer have permissions to change the permissions, causing the error.
# 12  
Old 11-23-2011
The normal situations is seen when I copy the file to /tmp --- the ownership is changed from root to that of the copier, and the permission is preserved. Need to find a way to correct the network file system (mount point /home/jhzhang) behavior.

The wrongful network file system behavior includes the ability to delete the root owned file with permission 600 by the copier -- my regular user.
# 13  
Old 11-23-2011
Code:
ant:/home/vbe $ chmod 600 0000
ant:/home/vbe $ ll 0000
-rw-------   1 vbe        bin             12 Nov 23 17:43 0000
ant:/home/vbe $ chown root:root 0000
ant:/home/vbe $ r ll
ll 0000
-rw-------   1 root       root            12 Nov 23 17:43 0000
ant:/home/vbe $ rm 0000
0000: 600  mode ? (y/n) y
ant:/home/vbe $ r ll
ll 0000
0000 not found
ant:/home/vbe $

# 14  
Old 11-23-2011
By using cp -p, you're telling it to preserve the original owner. It shouldn't let you do that unless you're root. I don't know why it does.
Quote:
Originally Posted by nugulus
The wrongful network file system behavior includes the ability to delete the root owned file with permission 600 by the copier -- my regular user.
That's normal. You don't need access or ownership of a file to delete a file owned by root, all you need is write permissions to the directory containing it.

/tmp/ is different because /tmp/ usually has the sticky bit set on it. Only the file's owner is allowed to delete a file in /tmp/.
 
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