Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "lima" username if the local user is not a valid Linux name #214

Merged
merged 1 commit into from
Sep 6, 2021

Conversation

jandubois
Copy link
Member

At least some companies set local users via directory services and choose the email address as the user name. The '@' character is not valid in Linux usernames.

Fixes #191

@jandubois jandubois added the enhancement New feature or request label Sep 6, 2021
@jandubois jandubois added this to the v0.6.4 milestone Sep 6, 2021
At least some companies set local users via directory services and
choose the email address as the user name. The '@' character is not
valid in Linux usernames.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois
Copy link
Member Author

For testing I've forced the username to be an email address like this:

+                       cache.u.Username = "user@example.com"
+                       if err := identifiers.Validate(cache.u.Username); err != nil {

This is the output when starting an instance:

$ l start default
INFO[0000] Using the existing instance "default"
WARN[0000] local user "user@example.com" is not a valid Linux user name: identifier "user@example.com" must match ^[A-Za-z0-9]+(?:[._-](?:[A-Za-z0-9]+))*$: invalid argument; using "lima" username instead
[...]
INFO[0023] READY. Run `lima` to open the shell.

$ lima id
uid=501(lima) gid=1000(lima) groups=1000(lima)

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request impact/changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Username with '@' causes fatal error in limactl start
2 participants