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

Fixes #16620: Add a command to generate user accounts after installation #293

Conversation

amousset
Copy link
Member

@amousset amousset requested a review from peckpeck April 10, 2020 14:30
@amousset
Copy link
Member Author

WIP

@amousset amousset force-pushed the bug_16620/generate_a_random_password_during_installation_for_admin_account branch from 99c5103 to 3ed4cb5 Compare April 10, 2020 14:39
@amousset
Copy link
Member Author

Commit modified

# check hash
if ! grep -qE "^[[:space:]]*<authentication[[:space:]]+hash=\"bcrypt\"[[:space:]]*>" "${USERFILE}"
then
echo "This command can only create users with the 'bcrypt' hash method"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a link to some doc or an explanation f what the problem is ?

# check if user is already there
if grep -qE "name[[:space:]]*=[[:space:]]*\"${USER}\"" "${USERFILE}"
then
echo "User '${USER}' already exists, aborting."
Copy link
Member

Choose a reason for hiding this comment

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

cnat' we replace it if it exists ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to avoid messing with xml using sed as much as I can

@amousset
Copy link
Member Author

PR updated with a new commit

@Normation-Quality-Assistant

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder-agent/pull/293
-- Your faithful QA
Kant merge: "In law a man is guilty when he violates the rights of others. In ethics he is guilty if he only thinks of doing so."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/22811/console)

@amousset
Copy link
Member Author

OK, squash merging this PR

@amousset amousset force-pushed the bug_16620/generate_a_random_password_during_installation_for_admin_account branch from cf88c98 to c0ef3fb Compare April 10, 2020 15:54
@amousset amousset merged commit c0ef3fb into Normation:master Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants