You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to create users and groups from rust. Rather than implementing this in a separate crate I'd like to extend this crate. However I just learned rust and I probably need some conceptual guidance.
As users can be created already I guess a save_user method could work. So the workflow to create a user would be:
letmut user = User::new(1001,"peter",1001);
user.save_to_passwd().expect("could not save the user");
The save method could also try to validate that the user does not exist yet.
There could also be the possibility to modify the entries of a user with set_param functions followed by a save_to_passwd. In this case I think it would be good to check that the user has not been changed while it was cached. If it was changed it should fail with an appropriate error.
Let me know what you think.
The text was updated successfully, but these errors were encountered:
I need to create users and groups from rust. Rather than implementing this in a separate crate I'd like to extend this crate. However I just learned rust and I probably need some conceptual guidance.
As users can be created already I guess a save_user method could work. So the workflow to create a user would be:
The save method could also try to validate that the user does not exist yet.
There could also be the possibility to modify the entries of a user with
set_param
functions followed by asave_to_passwd
. In this case I think it would be good to check that the user has not been changed while it was cached. If it was changed it should fail with an appropriate error.Let me know what you think.
The text was updated successfully, but these errors were encountered: