diff mbox series

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

Message ID 20200911142202.84696-1-srikrishanmalik@gmail.com
State New
Headers show
Series nfsidmap:umich_ldap return success only if attributes are found in ldap resp. | expand

Commit Message

Srikrishan Malik Sept. 11, 2020, 2:22 p.m. UTC
Return ENOENT if the UID/GID attributes are not found in ldap response.

Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
---
 support/nfsidmap/umich_ldap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Steve Dickson Sept. 18, 2020, 6:31 p.m. UTC | #1
On 9/11/20 10:22 AM, Srikrishan Malik wrote:
> Return ENOENT if the UID/GID attributes are not found in ldap response.
> 
> Signed-off-by: Srikrishan Malik <srikrishanmalik@gmail.com>
Committed... (tag nfs-utils-2-5-2-rc5)

steved.

> ---
>  support/nfsidmap/umich_ldap.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/support/nfsidmap/umich_ldap.c b/support/nfsidmap/umich_ldap.c
> index c475d379..1aa2af49 100644
> --- a/support/nfsidmap/umich_ldap.c
> +++ b/support/nfsidmap/umich_ldap.c
> @@ -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:
>
diff mbox series

Patch

diff --git a/support/nfsidmap/umich_ldap.c b/support/nfsidmap/umich_ldap.c
index c475d379..1aa2af49 100644
--- a/support/nfsidmap/umich_ldap.c
+++ b/support/nfsidmap/umich_ldap.c
@@ -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: