[SCM] NSS Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Tue Oct 30 19:50:04 UTC 2018


The branch, master has been updated
       via  70fb58a nwrap: Don't do a deep bind if we run with libasan
       via  4e67f44 tests: Check pointers of get(pw|gr)(nam|uid|gid)_r functions
       via  e171db5 nwrap: fix nwrap_module_getgrent_r
       via  c1bd13a nwrap: fix nwrap_module_getgrgid_r
       via  6bde6d5 nwrap: fix nwrap_module_getgrnam_r
       via  d3ad297 nwrap: fix nwrap_module_getpwent_r
       via  9e0b9d6 nwrap: fix nwrap_module_getpwuid_r
       via  433ab5e nwrap: fix nwrap_module_getpwnam_r
      from  2d57b2a ctest: Move to new dashboard

https://git.samba.org/?p=nss_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 70fb58a114e07a5a9766ad0efefb7aaa6b0e4cb8
Author: Andreas Schneider <asn at samba.org>
Date:   Sat Sep 1 19:41:46 2018 +0200

    nwrap: Don't do a deep bind if we run with libasan
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 4e67f442f5b2b8fd67e40bc27afefb73f41f7345
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Oct 30 11:04:22 2018 +0100

    tests: Check pointers of get(pw|gr)(nam|uid|gid)_r functions
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit e171db5578ecc25eec8979e20924a5eabcb9ea85
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Fri Oct 19 15:24:21 2018 +0200

    nwrap: fix nwrap_module_getgrent_r
    
    On success *grdstp must point to grdst, on error return NULL instead.
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit c1bd13a582fb885ea2e8385fec5b5eea94a7e2fc
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Fri Oct 19 15:22:23 2018 +0200

    nwrap: fix nwrap_module_getgrgid_r
    
    On success *grdstp must point to grdst, on error return NULL instead.
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6bde6d573508d11ecdeb549fb70e0f07beeb4027
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Fri Oct 19 15:19:28 2018 +0200

    nwrap: fix nwrap_module_getgrnam_r
    
    On success *grdstp must point to grdst, on error return NULL instead.
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d3ad297a9420c7a752d7262a9870e16a29ab0a82
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Fri Oct 19 12:19:17 2018 +0200

    nwrap: fix nwrap_module_getpwent_r
    
    On success *pwdstp must point to pwdst, on error return NULL instead.
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 9e0b9d6d4872db507b65989f975b8e145cf81e8b
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Fri Oct 19 12:15:53 2018 +0200

    nwrap: fix nwrap_module_getpwuid_r
    
    On success *pwdstp must point to pwdst, on error return NULL instead.
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 433ab5ed5766150bf0786ba6c48e701205cd1a1c
Author: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date:   Fri Oct 19 11:27:04 2018 +0200

    nwrap: fix nwrap_module_getpwnam_r
    
    On success *pwdstp must point to pwdst, on error return NULL instead.
    
    Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 src/nss_wrapper.c | 30 +++++++++++++++++++++---------
 tests/testsuite.c |  4 ++++
 2 files changed, 25 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index dd0848a..dd16fe6 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -846,7 +846,15 @@ static void *nwrap_load_lib_handle(enum nwrap_lib lib)
 	int i;
 
 #ifdef RTLD_DEEPBIND
-	flags |= RTLD_DEEPBIND;
+	const char *env = getenv("LD_PRELOAD");
+
+	/* Don't do a deepbind if we run with libasan */
+	if (env != NULL && strlen(env) < 1024) {
+		const char *p = strstr(env, "libasan.so");
+		if (p == NULL) {
+			flags |= RTLD_DEEPBIND;
+		}
+	}
 #endif
 
 	switch (lib) {
@@ -3846,9 +3854,7 @@ static int nwrap_module_getpwnam_r(struct nwrap_backend *b,
 {
 	int ret;
 
-	(void) b; /* unused */
-	(void) pwdst; /* unused */
-	(void) pwdstp; /* unused */
+	*pwdstp = NULL;
 
 	if (!b->fns->_nss_getpwnam_r) {
 		return NSS_STATUS_NOTFOUND;
@@ -3857,6 +3863,7 @@ static int nwrap_module_getpwnam_r(struct nwrap_backend *b,
 	ret = b->fns->_nss_getpwnam_r(name, pwdst, buf, buflen, &errno);
 	switch (ret) {
 	case NSS_STATUS_SUCCESS:
+		*pwdstp = pwdst;
 		return 0;
 	case NSS_STATUS_NOTFOUND:
 		if (errno != 0) {
@@ -3903,7 +3910,7 @@ static int nwrap_module_getpwuid_r(struct nwrap_backend *b,
 {
 	int ret;
 
-	(void) pwdstp; /* unused */
+	*pwdstp = NULL;
 
 	if (!b->fns->_nss_getpwuid_r) {
 		return ENOENT;
@@ -3912,6 +3919,7 @@ static int nwrap_module_getpwuid_r(struct nwrap_backend *b,
 	ret = b->fns->_nss_getpwuid_r(uid, pwdst, buf, buflen, &errno);
 	switch (ret) {
 	case NSS_STATUS_SUCCESS:
+		*pwdstp = pwdst;
 		return 0;
 	case NSS_STATUS_NOTFOUND:
 		if (errno != 0) {
@@ -3966,7 +3974,7 @@ static int nwrap_module_getpwent_r(struct nwrap_backend *b,
 {
 	int ret;
 
-	(void) pwdstp; /* unused */
+	*pwdstp = NULL;
 
 	if (!b->fns->_nss_getpwent_r) {
 		return ENOENT;
@@ -3975,6 +3983,7 @@ static int nwrap_module_getpwent_r(struct nwrap_backend *b,
 	ret = b->fns->_nss_getpwent_r(pwdst, buf, buflen, &errno);
 	switch (ret) {
 	case NSS_STATUS_SUCCESS:
+		*pwdstp = pwdst;
 		return 0;
 	case NSS_STATUS_NOTFOUND:
 		if (errno != 0) {
@@ -4059,7 +4068,7 @@ static int nwrap_module_getgrnam_r(struct nwrap_backend *b,
 {
 	int ret;
 
-	(void) grdstp; /* unused */
+	*grdstp = NULL;
 
 	if (!b->fns->_nss_getgrnam_r) {
 		return ENOENT;
@@ -4068,6 +4077,7 @@ static int nwrap_module_getgrnam_r(struct nwrap_backend *b,
 	ret = b->fns->_nss_getgrnam_r(name, grdst, buf, buflen, &errno);
 	switch (ret) {
 	case NSS_STATUS_SUCCESS:
+		*grdstp = grdst;
 		return 0;
 	case NSS_STATUS_NOTFOUND:
 		if (errno != 0) {
@@ -4130,7 +4140,7 @@ static int nwrap_module_getgrgid_r(struct nwrap_backend *b,
 {
 	int ret;
 
-	(void) grdstp; /* unused */
+	*grdstp = NULL;
 
 	if (!b->fns->_nss_getgrgid_r) {
 		return ENOENT;
@@ -4139,6 +4149,7 @@ static int nwrap_module_getgrgid_r(struct nwrap_backend *b,
 	ret = b->fns->_nss_getgrgid_r(gid, grdst, buf, buflen, &errno);
 	switch (ret) {
 	case NSS_STATUS_SUCCESS:
+		*grdstp = grdst;
 		return 0;
 	case NSS_STATUS_NOTFOUND:
 		if (errno != 0) {
@@ -4209,7 +4220,7 @@ static int nwrap_module_getgrent_r(struct nwrap_backend *b,
 {
 	int ret;
 
-	(void) grdstp; /* unused */
+	*grdstp = NULL;
 
 	if (!b->fns->_nss_getgrent_r) {
 		return ENOENT;
@@ -4218,6 +4229,7 @@ static int nwrap_module_getgrent_r(struct nwrap_backend *b,
 	ret = b->fns->_nss_getgrent_r(grdst, buf, buflen, &errno);
 	switch (ret) {
 	case NSS_STATUS_SUCCESS:
+		*grdstp = grdst;
 		return 0;
 	case NSS_STATUS_NOTFOUND:
 		if (errno != 0) {
diff --git a/tests/testsuite.c b/tests/testsuite.c
index 6a9f4d1..a423c55 100644
--- a/tests/testsuite.c
+++ b/tests/testsuite.c
@@ -166,6 +166,7 @@ static void test_nwrap_getpwnam_r(const char *name,
 		}
 		assert_true(ret);
 	}
+	assert_ptr_equal(&pwd, pwdp);
 
 	print_passwd(&pwd);
 
@@ -214,6 +215,7 @@ static bool test_nwrap_getpwuid_r(uid_t uid,
 		}
 		assert_true(ret);
 	}
+	assert_ptr_equal(&pwd, pwdp);
 
 	print_passwd(&pwd);
 
@@ -334,6 +336,7 @@ static bool test_nwrap_getgrnam_r(const char *name,
 		}
 		assert_true(ret);
 	}
+	assert_ptr_equal(&grp, grpp);
 
 	print_group(&grp);
 
@@ -384,6 +387,7 @@ static bool test_nwrap_getgrgid_r(gid_t gid,
 		}
 		assert_true(ret);
 	}
+	assert_ptr_equal(&grp, grpp);
 
 	print_group(&grp);
 


-- 
NSS Wrapper Repository



More information about the samba-cvs mailing list