Skip to content

Fails to set UID for user if their username is a prefix of another user. #163

@James22231

Description

@James22231

If i have two users, say, 'bob' and 'bobby', and configure:

UID_bob: 1005
...
UID_bobby: 1006
...

Then the UID for 'bob' will fail to be applied.

This line:

ACCOUNT_UID=$(env | grep '^UID_'"$ACCOUNT_NAME" | sed 's/^[^=]*=//g')

will end up grep'ing for '^UID_bob', which will match BOTH users. It should instead be:

ACCOUNT_UID=$(env | grep '^UID_'"$ACCOUNT_NAME"'=' | sed 's/^[^=]*=//g')

So it will also ensure there is an '=' at the end of the user name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions