bugGNU Core Utilities - Bugs: bug #28341, chown does not support non-root...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28341: chown does not support non-root usage

Submitted by:  None
Submitted on:  Fri 18 Dec 2009 07:58:38 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: Bob Proulx <rwp>
Open/Closed: Closed

Fri 18 Dec 2009 08:19:54 PM UTC, comment #1:

Thanks for the report. But this is not a bug in chown but is a restriction of the operating system kernel.

The GNU chown program will change the ownership if the operating system it is running upon allows it. If you can't change file ownership then it is the operating system which is restricting you and not the chown program. And indeed the error message you reported "Operation not permitted" is the operating system kernel message saying that the operation is not permitted. This is a security restriction and is outside of the control of the chown program.

There is more information on this topic in the FAQ:

http://www.gnu.org/software/coreutils/faq/#Why-can-only-root-chown-files_003f

Since this bug report was submitted anonymously there is no way to send you information other than in this report. If you wish further discussion I suggest sending a message to the bug-coreutils mailing list.

Bob Proulx <rwp>
Project AdministratorIn charge of this item.
Fri 18 Dec 2009 07:58:38 PM UTC, original submission:

Any attempts to change a file from one owner to another fails, even if the owner is a member of the same group, and the directory is writable. For example:

> dir -a

drwxrwsr-x 7 www-data www 4.0K 2009-09-14 14:14 .
drwxrwsr-x 11 www-data www 4.0K 2009-11-05 16:16 ..
-rw-rw-r-- 1 www-data www 2.1K 2009-12-18 14:16 file.txt

> chown user file.txt

chown: changing ownership of `file.txt': Operation not permitted

Yet this works just file:

> cp file.txt file.txt.takeown
> rm file.txt
> mv file.txt.takeown
> touch -m -d 2009-12-18 14:16 file.txt
> chown 664 file.txt
> dir

-rw-rw-r-- 1 user www 2.1K 2009-12-18 14:16 file.txt

The chown command should detect conditions like this and allow for the user to take over ownership of a file without the need for unnecessary file access or adjustment commands.

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rwp (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 Dec 2009 08:19:54 PM UTCrwpOpen/ClosedOpen=>Closed
      Assigned toNone=>rwp

    Back to the top


    Powered by Savane 3.1-cleanup1