-
Notifications
You must be signed in to change notification settings - Fork 19
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
Try harder to get existing user ID #180
Conversation
Signed-off-by: Itxaka <itxaka@kairos.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So no more explicit uid right? We should update the documentation to explain how it works.
Co-authored-by: Dimitris Karakasilis <jimmykarily@gmail.com>
yes indeed, uid/guid via the User plugin is not supported anymore as it can cause issues. There is alternatives like using the Entitites plugin directly or using the Commands and call useradd EDIT: Actually the User plugin docs in yip already does not mention the UID/GUID field.... |
Cross referencing: kairos-io/kairos#2949 |
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Itxaka <itxaka@kairos.io>
uid := -1 | ||
|
||
// If UID is specified just put it there. No matter whats in the system or the collisions. Good luck. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
uid, err = list.GenerateUIDInRange(entities.HumanIDMin, entities.HumanIDMax) | ||
if err != nil { | ||
return errors.Wrap(err, "no available uid") | ||
// Try to see if the user was created previously with a given UID by checking for an existing home dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this be problematic since you can define a user like:
stages:
default:
- name: "Setup users"
users:
bastion:
passwd: "strongpassword"
homedir: "/home/foo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything is problematic in here, thats what happens when you give users too much choice. They dont know whats better for them.
We are just trying harder to get it if its there, unfortunately we cannot cover all angles. What happens if during one boot the user has the default dir and the next one he modified to now set the homedir specifically in the config? All their files are gone? On a different dir? What if he also changes the uid? Now they are gone and also he cant access them anymore?
Too many different paths and scenarios due to the broad config spectrum of the user.
No description provided.