mirror of
https://github.com/rfc1036/whois.git
synced 2026-10-18 07:30:11 +00:00
mkpasswd: support raw $salt$ prefixes
If the salt provided to the program starts with '$' then it will be passed straight to crypt(3) without any checks.
This commit is contained in:
parent
38cab73d18
commit
aea6650cfc
@ -16,8 +16,11 @@ libc function, using the given salt.
|
||||
.BI \-\-salt= STRING
|
||||
Use the
|
||||
.I STRING
|
||||
as salt. It must not contain prefixes such as
|
||||
.IR $1$ .
|
||||
as salt. If it begins with
|
||||
.I $
|
||||
then it will be passed straight to
|
||||
.BR crypt (3)
|
||||
without any checks.
|
||||
.TP
|
||||
.BR \-R ", "\c
|
||||
.BI \-\-rounds= NUMBER
|
||||
|
||||
@ -282,7 +282,9 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
rounds_str[0] = '\0';
|
||||
|
||||
if (salt_arg && salt_arg[0] != '\0') {
|
||||
if (salt_arg && salt_arg[0] == '$')
|
||||
salt = NOFAIL(strdup(salt_arg));
|
||||
else if (salt_arg && salt_arg[0] != '\0') {
|
||||
unsigned int c = strlen(salt_arg);
|
||||
if (c < salt_minlen || c > salt_maxlen) {
|
||||
if (salt_minlen == salt_maxlen)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user