ocpasswd: attempt to use sha2crypt only in glibc

uclibc's crypt(3) is so dumb it will not error if
$5$ is specified as salt, but not supported.
This commit is contained in:
Nikos Mavrogiannopoulos
2015-01-19 14:26:43 +01:00
parent 0ce83be801
commit ec1ee46250
2 changed files with 17 additions and 0 deletions

View File

@@ -69,7 +69,11 @@ crypt_int(const char *fpasswd, const char *username, const char *groupname,
exit(1);
}
#ifdef TRY_SHA2_CRYPT
strcpy(salt, "$5$");
#else
strcpy(salt, "$1$");
#endif
p = salt + 3;
for (i = 0; i < sizeof(_salt); i++) {