The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cant able to change permission in a DIR as root user vijayq8 SUN Solaris 5 06-01-2009 05:20 PM
granting permission to file/directory to a specific user run123 UNIX for Dummies Questions & Answers 2 05-26-2009 11:47 AM
How the /etc/passwd file is written when user does not have permission santosh149 UNIX for Dummies Questions & Answers 2 08-11-2008 05:25 AM
How to change the default permission of a file reachsamir UNIX for Dummies Questions & Answers 2 08-28-2007 06:57 PM
Timestamp of File permission change jyotipg UNIX for Advanced & Expert Users 1 02-19-2003 03:02 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-13-2009
ITHelper ITHelper is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 26
Change file permission by anothere user !

Guy's

we are in AIX 5.3

We have created two users user1 and user2 and they are under same group Staff Group

user1 will create file under /tmp/ and this is the permission of this file

-rw-r--r-- 1 user1 staff 1 Jun 13 09:47 file

user2 is under same group and when he try to change the permission of the same file he will get this message !

chmod 777 file
chmod: file: Operation not permitted.


I know the owner of the file is user1 but user1 and user2 are under same group so should have same permission

is there any clue to let the change of the permission be executed by user2 ?

Last edited by ITHelper; 06-13-2009 at 04:12 AM..
  #2 (permalink)  
Old 06-13-2009
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,641
Only the owner of a file and the user root (uid=0) are allowed to change the filemode of a file. It doesn't matter if you have write-access or not, execute-rights or not, etc..

If you have to change the filemode of a file owned by user1 via a command issued by user2 you might want to explore sudo and its possibilities.

Regarding your original question: works as designed.

I hope this helps.

bakunin
  #3 (permalink)  
Old 06-15-2009
ITHelper ITHelper is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 26
What about Umask option ?

I think this option will let the permission change of the file be allowed for everyone in the same group .

Do you have any idea about it and how it's work ?
  #4 (permalink)  
Old 06-15-2009
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,411
Try...
Code:
cp file file.tmp &&\
mv file file.old &&\
mv file.tmp file &&\
rm file.old &&\
chmod 777 file

  #5 (permalink)  
Old 06-15-2009
ITHelper ITHelper is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 26
Ygor thank you for your trying

User1 is under staff group we need any one under staff group change the permission of any one in the same group without do copying , I think there is solution by Umask

Do you have any idea about Umask Option ?
  #6 (permalink)  
Old 06-15-2009
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,641
"umask" will only change the filemode new files are being created with. I don't think there is a way without copying/modifying the file in Ygors way.

The alternative to copying would be to effectively become the user who owns the file, at least for the moment needed to change the filemode. This is what i had in mind when i suggested sudo. You could also use more extravagant (and surely far less reliable and less desirable) ways to achieve the same goal like suid-ed copies of shell executables and the like. I don't think these are of more than theoretical value.

I hope this helps.

bakunin
  #7 (permalink)  
Old 06-15-2009
garethr garethr is offline
Registered User
  
 

Join Date: May 2009
Location: England
Posts: 92
Why do you actually need to do? Would group-writeable permissions on the files and directories be sufficient?
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0