Page MenuHomePhabricator

The "take" util unable to take ownership of files
Closed, InvalidPublic

Description

I have a number of files that belong to my user account (running after become dibabel):

$ ls -alh /data/project/dibabel/www/static/dbg/i18n/
...
-rw-rw-r-- 1 yurik         wikidev        11K Sep 26 15:03 en.json

Running take en.json shows en.json: You need to share a group with the file

Running chown or chgrp results in Operation not permitted

Relevant code is here

Event Timeline

Yurik renamed this task from take util unable to take ownership of files to The "take" util unable to take ownership of files.Oct 5 2020, 5:24 AM
Yurik updated the task description. (Show Details)
Yurik updated the task description. (Show Details)
Yurik added a subscriber: coren.

@Yurik, your yurik shell user is a member of the tools.dibabel group. Typically you would be expected to chgrp tools.dibabel <filename> as yurik before you become dibabel and then you should be able to take <filename>. The take command is not designed or intended to allow a tool account to usurp ownership of any arbitrary file on the filesystem.

$ id yurik
uid=1011(yurik) gid=500(wikidev) groups=500(wikidev),50380(project-tools),50062(project-bastion),53347(tools.wiki-retweet-bot),54111(tools.dspull),54470(tools.dibabel)

@bd808 thanks for the explanation. This surfaced because i was doing an rsync directly from my laptop via ssh, and since i cannot login as dibabel directly, i will need to do some extra steps. Would it be possible for take to link to some documentation in its errors about this? Thx!

I added a bit of information to https://wikitech.wikimedia.org/wiki/Portal:Toolforge/Tool_Accounts#Manage_files_in_Toolforge, but more could probably be done to make this information easier to find.