Last modified: 2014-03-23 06:01:21 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 T56074, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54074 - Remove trailing slashes in LDAP's service user homedirs
Remove trailing slashes in LDAP's service user homedirs
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Unprioritized trivial
: ---
Assigned To: Marc A. Pelletier
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-12 12:41 UTC by Betacommand
Modified: 2014-03-23 06:01 UTC (History)
4 users (show)

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


Attachments

Description Betacommand 2013-09-12 12:41:35 UTC
local-betacommand-dev@tools-login:~$ cd svn_copy
local-betacommand-dev@tools-login:/data/project/betacommand-dev/svn_copy$

as soon as you leave the root of $HOME the full path is displayed. Traditionally /data/project/betacommand-dev (in my case) is just displayed as ~ while SSHing. Right now between the username/hostname/directory half my terminal is eaten
Comment 1 Tim Landscheidt 2013-10-22 19:09:45 UTC
This is confined to tool accounts and the first prompt after become'ing a tool account seems to work:

| local-wikilint@tools-login:~$ PS1='\w: '
| ~: cd cgi-bin
| /data/project/wikilint/cgi-bin: cd
| /data/project/wikilint:

Further digging indicates that the trailing slash in $HOME is the culprit:

| /data/project/wikilint: echo $HOME
| /data/project/wikilint/
| /data/project/wikilint: HOME=/data/project/wikilint
| ~: cd cgi-bin
| ~/cgi-bin:

I don't know if there is a deeper reasoning behind that slash or if that was just an oversight, but fixing this probably requires fiddling with the LDAP database.
Comment 2 Marc A. Pelletier 2013-11-06 18:18:40 UTC
Changing the homes in LDAP might be more involved than necessary (and may have side effect).

I did put a workaround in /etc/profile to strip the slash on login sessions.
Comment 3 Tim Landscheidt 2013-12-28 18:39:11 UTC
Looking at <https://wikitech.wikimedia.org/w/index.php?title=Special:NovaProject&action=configureproject&projectname=tools>, the service user homedir pattern is set to "/data/project/%u", so no trailing slashes shouldn't have a side effect.

So we should just clean up the database once and remove the workaround then.

Andrew, Ryan, we need:

- For all service users in the Tools project,
- if the homedir has a trailing slash,
- remove it.

Actual output at the moment is:

| scfc@tools-login:~$ getent passwd local-wikilint
| local-wikilint:x:50420:50420:local-wikilint:/data/project/wikilint/:/bin/bash
| scfc@tools-login:~$

Expected output is:

| scfc@tools-login:~$ getent passwd local-ggu
| local-ggu:x:50961:50961:local-ggu:/data/project/ggu:/bin/bash
| scfc@tools-login:~$
Comment 4 Tim Landscheidt 2014-03-23 06:01:21 UTC
The move to eqiad has solved this:

| scfc@tools-login:~$ getent passwd | grep '^tools\.' | cut -d : -f 6 | grep '/$'
| scfc@tools-login:~$

The workaround is also gone, thus closing the bug.

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


Navigation
Links