1885. [func] andrei
kea-admin is now able to interactively ask for a password if no
parameter follows the -p or the --password parameters. This
- requires the user to give it as the last parameter. If another
- option starting with dash follows, that would be taken as the
- actual password, would not be processed as it should have been
- and all your parameters will be offset by one. Checking if the
- word that follows starts with dash is also not possible because
- that would not allow for passwords starting with dash. Feedback
- of the password to the terminal is cut off to prevent
- over-the-shoulder snooping and other social engineering
- techniques.
+ requires the user to give it as the last parameter. The entered
+ password is not echoed back to the terminal in order to prevent
+ over-the-shoulder snooping or other social engineering
+ techniques. Alternatively, you can set the password via the
+ KEA_ADMIN_DB_PASSWORD environment variable.
(Gitlab #1675)
1884. [doc] fdupont
``-p|--password password``
Specifies the password when connecting to a database.
If only ``-p`` or ``--password`` is given, the user is prompted for a password.
- If not specified at all, the default value of **keatest** is used.
+ If not specified at all, the **KEA_ADMIN_DB_PASSWORD** environment variable
+ is checked for a value and used if it exists.
+ Otherwise the default value of **keatest** is used.
``-n|--name database-name``
Specifies the name of the database to connect to. If not specified, the
;;
# Specify database password
-p|--password)
+ password_parameter_passed=true
# If there is at least one more parameter following...
if test "${#}" -gt 1; then
# Then take it as password.
shift
done
+# After all the parameters have been parsed, check environment variables.
+if test -z "${password_parameter_passed+x}"; then
+ if test -n "${KEA_ADMIN_DB_PASSWORD+x}"; then
+ printf 'Using the value of KEA_ADMIN_DB_PASSWORD for authentication...\n'
+ db_password="${KEA_ADMIN_DB_PASSWORD}"
+ fi
+fi
+
case ${command} in
# Initialize the database
db-init)