Last modified: 2014-02-06 10:43:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50105, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48105 - "sudo chown ..." asks for password which doesn't exist
"sudo chown ..." asks for password which doesn't exist
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Low normal
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-05 15:19 UTC by Tim Landscheidt
Modified: 2014-02-06 10:43 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Landscheidt 2013-05-05 15:19:08 UTC
Tools accounts have a sudo rule to claim ownership of their entire directory structure:

| local-wikilint@tools-login:~$ sudo -l
| Matching Defaults entries for local-wikilint on this host:                                                                                                   
|     env_reset                                                                                                                                                
                                                                                                                                                             
| User local-wikilint may run the following commands on this host:                                                                                             
|     (local-wikilint) NOPASSWD: ALL                                                                                                                           
|     (root) NOPASSWD: chown -R local-wikilint:local-wikilint /data/project/wikilint/                                                                          
|     (local-wikilint) NOPASSWD: ALL
| local-wikilint@tools-login:~$

However, despite "NOPASSWD", it still asks for one:

| local-wikilint@tools-login:~$ sudo chown -R local-wikilint:local-wikilint /data/project/wikilint/
| [sudo] password for local-wikilint: [^C]
| local-wikilint@tools-login:~$ sudo -u root chown -R local-wikilint:local-wikilint /data/project/wikilint/
| [sudo] password for local-wikilint: [^C]
| local-wikilint@tools-login:~$

As tools accounts don't have passwords, that's kind of an impasse :-).
Comment 1 Peter Bena 2013-05-29 08:39:21 UTC
I think you should be able to do this using a take command, though this is weird indeed
Comment 2 Marc A. Pelletier 2013-05-30 16:05:40 UTC
This is a known issue.  In the meantime, the command

take <filenames>

Provides a working substitute; it takes ownership (recursively) of files and directories given on the command line provided that you are in the owning group and own the containing directory.
Comment 3 Marc A. Pelletier 2013-10-10 17:11:10 UTC
Over time, take was deemed to be the canonical way of doing this.
Comment 4 Gerrit Notification Bot 2014-02-06 10:28:59 UTC
Change 111755 had a related patch set uploaded by Tim Landscheidt:
Fix sudo chown rule for service groups

https://gerrit.wikimedia.org/r/111755
Comment 5 Gerrit Notification Bot 2014-02-06 10:36:49 UTC
Change 111755 merged by jenkins-bot:
Fix sudo chown rule for service groups

https://gerrit.wikimedia.org/r/111755
Comment 6 Tim Landscheidt 2014-02-06 10:43:09 UTC
Hmmm.  Old service groups still have the problem, the bug is fixed for new ones - let's consider the glass half full :-).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links