diff options
author | James Knight <james.knight@rockwellcollins.com> | 2015-05-23 13:51:37 -0400 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-06-09 23:13:41 +0200 |
commit | 8d972df185de6e841a1752b67e466e8ffc95bfac (patch) | |
tree | 37f27ac6c2e79e56330709bab6e6e979b66c62a4 /support/scripts | |
parent | e6c57b580d1a15edb4066899639532f86059c432 (diff) | |
download | buildroot-8d972df185de6e841a1752b67e466e8ffc95bfac.tar.gz buildroot-8d972df185de6e841a1752b67e466e8ffc95bfac.zip |
scripts/mkusers: allow users with no password value set
The following allows a user definition to specify that a created user
entry should not have a password value set. Original implementation
allowed a user definition to provide a password value of "=" (no quotes)
to generate a crypt-encoded empty string value. In some cases, it may be
desired to have no value specified for a user's password. By using a
value "-" for a password, no value will be set in the shadow value.
An example when this can be used is when logging into a terminal.
Logging into a session with an encoded empty password will prompt a user
to enter a password since it does not know the password is empty. If the
password field blank, a login session will not prompt for a password.
Signed-off-by: James Knight <james.knight@rockwellcollins.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/scripts')
-rwxr-xr-x | support/scripts/mkusers | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/support/scripts/mkusers b/support/scripts/mkusers index 026519e4ee..9c5c4dcadb 100755 --- a/support/scripts/mkusers +++ b/support/scripts/mkusers @@ -318,6 +318,9 @@ add_one_user() { *) fail "home must be an absolute path\n";; esac case "${passwd}" in + -) + _passwd="" + ;; !=*) _passwd='!'"$( encode_password "${passwd#!=}" )" ;; |