Page MenuHomePhabricator

Calculation of home directories is broken for users
Closed, ResolvedPublic

Description

I tested modules/labstore/files/create-dbusers's logic to find all users and servicegroups (print(all_users)), and a) it does not seem to include the user account fdamken or Fabian24d97 and b) the logic for calculating the home directory looks wrong:

def homedir(self):
    prefix = '/srv/project/%s' % self.project
    if self.kind == 'user':
        return os.path.join(prefix, 'home', self.name.lower())
    else:
        return os.path.join(
            prefix, 'project',
            re.sub(r'^%s\.' % self.project, '', self.name.lower())
        )

For tool accounts, self.name is for example tools.wikilint, but for user accounts, self.name is for example Tim Landscheidt, so the logic will only work for user accounts with the same shell user name as the wiki user name.

Event Timeline

scfc claimed this task.

Change 295029 had a related patch set uploaded (by Tim Landscheidt):
labstore: Fix home directory calculation for user accounts

https://gerrit.wikimedia.org/r/295029

Change 295029 merged by Yuvipanda:
labstore: Fix home directory calculation for user accounts

https://gerrit.wikimedia.org/r/295029