Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109456475
D48858.id150515.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
994 B
Referenced Files
None
Subscribers
None
D48858.id150515.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D48858: Make crypt(3) thread-safe by utilizing thread-local storage.
Attached
Detach File
Event Timeline
Log In to Comment