Page MenuHomeFreeBSD

D48858.id150515.diff
No OneTemporary

D48858.id150515.diff

diff --git a/lib/libcrypt/crypt.3 b/lib/libcrypt/crypt.3
--- a/lib/libcrypt/crypt.3
+++ b/lib/libcrypt/crypt.3
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd May 26, 2019
+.Dd February 11, 2025
.Dt CRYPT 3
.Os
.Sh NAME
@@ -249,11 +249,15 @@
.Pp
The
.Fn crypt_r
-function behaves identically to
-.Fn crypt ,
-except that the resulting string is stored in
+function stores the resulting string in
.Fa data ,
-making it thread-safe.
+while
+.Fn crypt
+is a wrapper around
+.Fn crypt_r
+which passes a thread-local storage for
+.Fa data .
+Both functions are thread-safe.
.Sh RETURN VALUES
The
.Fn crypt
diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c
--- a/lib/libcrypt/crypt.c
+++ b/lib/libcrypt/crypt.c
@@ -132,7 +132,7 @@
char *
crypt(const char *passwd, const char *salt)
{
- static struct crypt_data data;
+ static __thread struct crypt_data data;
return (crypt_r(passwd, salt, &data));
}

File Metadata

Mime Type
text/plain
Expires
Thu, Feb 6, 7:48 AM (13 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16489180
Default Alt Text
D48858.id150515.diff (994 B)

Event Timeline