[PATCH] Fix the FreeBSD build

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Jun 2 11:42:08 UTC 2017


Hi!

Until Gary Lockyer finds time to fix the FreeBSD build the way he
intends to fulfill thread safety requirements to the ldb modules and
make ldb fully multi-threaded (which I will applause greatly when
done, thanks Gary for attacking this hard problem!!), this might be an
interesting patch for FreeBSD users.

Review appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 4066641f8ad9bf4bff5b2e337f64ba0d18c53a8f Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Fri, 2 Jun 2017 13:34:39 +0200
Subject: [PATCH] password_hash: Fix the build on FreeBSD

This ditches a particular aspect of thread safety, but I doubt that
ldb is really thread safe. So in practice, I think we should not
see harm from this.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source4/dsdb/samdb/ldb_modules/password_hash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 8e8dc2c3072..68028f0fce4 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1543,13 +1543,12 @@ static int setup_primary_userPassword_hash(
 	hash = crypt((char *)io->n.cleartext_utf8->data, cmd);
 #endif
 	if (hash == NULL) {
-		char buf[1024];
 		ldb_asprintf_errstring(
 			ldb,
 			"setup_primary_userPassword: generation of a %s "
 			"password hash failed: (%s)",
 			scheme,
-			strerror_r(errno, buf, sizeof(buf)));
+			strerror(errno));
 		TALLOC_FREE(frame);
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
-- 
2.12.1



More information about the samba-technical mailing list