The branch, master has been updated via 891258c s3:net registry check: replace rawmemchr by functionally equivalent portable strchr via 958e4f5 Revert "Remove rawmemchr calls - found by Ira Cooper. These are glibc-specific calls, makes us completely non-portable." via 2a69de6 s3:registry: replace use of rawmemchr by portable equivalent use of strchr. from 116a150 knownfail: Mark some ldap.acl search tests as no longer failing.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 891258cd7043fd9b4ae99324a541cffbce09e27a Author: Michael Adam <ob...@samba.org> Date: Tue Dec 6 01:17:02 2011 +0100 s3:net registry check: replace rawmemchr by functionally equivalent portable strchr rawmemchr is glibc only - not portable. Remarked by Ira Cooper. Autobuild-User: Michael Adam <ob...@samba.org> Autobuild-Date: Tue Dec 6 12:20:48 CET 2011 on sn-devel-104 commit 958e4f51d2857e1f84acf770ab0d9f2cee5d5d83 Author: Michael Adam <ob...@samba.org> Date: Tue Dec 6 01:05:39 2011 +0100 Revert "Remove rawmemchr calls - found by Ira Cooper. These are glibc-specific calls, makes us completely non-portable." This reverts commit 82b1702284ba2bb61b23e1f14ce9145d896c36c0. This is not functionally equivalent, needs to be done differently. commit 2a69de6fde68d6e865e901beb7c65e6f4f16f0f8 Author: Michael Adam <ob...@samba.org> Date: Tue Dec 6 00:58:24 2011 +0100 s3:registry: replace use of rawmemchr by portable equivalent use of strchr. ----------------------------------------------------------------------- Summary of changes: source3/registry/reg_backend_db.c | 2 +- source3/utils/net_registry_check.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 965d121..378b20f 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -545,7 +545,7 @@ static bool tdb_data_is_cstr(TDB_DATA d) { if (tdb_data_is_empty(d) || (d.dptr[d.dsize-1] != '\0')) { return false; } - return rawmemchr(d.dptr, '\0') == &d.dptr[d.dsize-1]; + return strchr((char *)d.dptr, '\0') == (char *)&d.dptr[d.dsize-1]; } static bool upgrade_v2_to_v3_check_subkeylist(struct db_context *db, diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c index 9dca219..201dc5e 100644 --- a/source3/utils/net_registry_check.c +++ b/source3/utils/net_registry_check.c @@ -208,10 +208,10 @@ static bool tdb_data_read_regval(TDB_DATA *buf, struct regval *result) } static bool tdb_data_is_cstr(TDB_DATA d) { - if (tdb_data_is_empty(d)) { + if (tdb_data_is_empty(d) || (d.dptr[d.dsize-1] != '\0')) { return false; } - return (d.dptr[d.dsize-1] == '\0'); + return strchr((char *)d.dptr, '\0') == (char *)&d.dptr[d.dsize-1]; } static char* tdb_data_print(TALLOC_CTX *mem_ctx, TDB_DATA d) @@ -664,8 +664,7 @@ static bool srprs_path(const char **ptr, const char* prefix, char sep, return false; } *ppath = path; - /* We know pos ends in '\0'. */ - *ptr = &pos[strlen(pos)]; + *ptr = strchr(pos, '\0'); return true; } -- Samba Shared Repository