Skip to contentSkip to conversation

nfsidmap:umich_ldap return success only if attributes are found in ldap resp.

PATCH In review Srikrishan Malik 2 participants 2 messages Sep 11, 2020 – Sep 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsidmap:umich_ldap return success only if attributes are found in ldap resp.

Return ENOENT if the UID/GID attributes are not found in ldap response.

---
 support/nfsidmap/umich_ldap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
support/nfsidmap/umich_ldap.c +2 -1
index c475d379..1aa2af49 100644
@@ -643,6 +643,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
 				goto out_memfree;
 			}
 			*uid = tmp_uid;
+			err = 0;
 		} else if (strcasecmp(attr_res, ldap_map.NFSv4_gid_attr) == 0) {
 			tmp_g = strtoul(*idstr, (char **)NULL, 10);
 			tmp_gid = tmp_g;
@@ -656,6 +657,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
 				goto out_memfree;
 			}
 			*gid = tmp_gid;
+			err = 0;
 		} else {
 			IDMAP_LOG(0, ("umich_name_to_ids: received attr "
 				"'%s' ???", attr_res));
@@ -667,7 +669,6 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
 		ldap_value_free(idstr);
 	}
 
-	err = 0;
 out_memfree:
 	ber_free(ber, 0);
 out_unbind:
Signature · 1 line
2.26.2
#1 lore raw
Quoted 3 lines · Srikrishan Malik

Return ENOENT if the UID/GID attributes are not found in ldap response.

Committed... (tag nfs-utils-2-5-2-rc5)

steved.

Quoted 33 lines
---
 support/nfsidmap/umich_ldap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
support/nfsidmap/umich_ldap.c +2 -1
index c475d379..1aa2af49 100644
@@ -643,6 +643,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
 				goto out_memfree;
 			}
 			*uid = tmp_uid;
+			err = 0;
 		} else if (strcasecmp(attr_res, ldap_map.NFSv4_gid_attr) == 0) {
 			tmp_g = strtoul(*idstr, (char **)NULL, 10);
 			tmp_gid = tmp_g;
@@ -656,6 +657,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
 				goto out_memfree;
 			}
 			*gid = tmp_gid;
+			err = 0;
 		} else {
 			IDMAP_LOG(0, ("umich_name_to_ids: received attr "
 				"'%s' ???", attr_res));
@@ -667,7 +669,6 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
 		ldap_value_free(idstr);
 	}
 
-	err = 0;
 out_memfree:
 	ber_free(ber, 0);
 out_unbind: