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

Submitter:  None
Submitted:  Fri 18 Dec 2009 07:58:38 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  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>
Group administrator
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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-12-18 rwp Open/ClosedOpen Closed
        Assigned toNone rwp

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code