2024-11-05 11:53:43 +00:00
|
|
|
diff --git a/libmisc/salt.c b/libmisc/salt.c
|
|
|
|
index efef4e59..823b093d 100644
|
|
|
|
--- a/libmisc/salt.c
|
|
|
|
+++ b/libmisc/salt.c
|
|
|
|
@@ -439,6 +439,19 @@ static /*@observer@*/const char *gensalt (size_t salt_size)
|
|
|
|
exit (1);
|
2024-11-04 09:51:06 +00:00
|
|
|
}
|
|
|
|
|
2024-11-05 11:53:43 +00:00
|
|
|
+ char *pos = strstr(retval, "$rounds=");
|
|
|
|
+ if (pos != NULL) {
|
|
|
|
+ char str[128];
|
|
|
|
+ int len;
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ ret = sprintf(str, "%lu", rounds);
|
|
|
|
+ if (ret > 0) {
|
|
|
|
+ len = strlen("$rounds=") + strlen(str);
|
|
|
|
+ memmove(pos, pos + len, strlen(pos + len) + 1);
|
|
|
|
+ }
|
2024-11-04 09:51:06 +00:00
|
|
|
+ }
|
|
|
|
+
|
2024-11-05 11:53:43 +00:00
|
|
|
return retval;
|
|
|
|
#else /* USE_XCRYPT_GENSALT */
|
|
|
|
/* Check if the result buffer is long enough. */
|