nwrap: Forward ERANGE error to caller in gethostbyname[2]_r
authorSamuel Cabrero <scabrero@suse.de>
Wed, 18 Mar 2020 12:18:49 +0000 (13:18 +0100)
committerAndreas Schneider <asn@samba.org>
Thu, 19 Mar 2020 09:03:10 +0000 (10:03 +0100)
Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
src/nss_wrapper.c

index b3d835b7e1d4233a76067fa278e3e93face6589a..45a94b7b8155b471aa3674eede8ff778418749b2 100644 (file)
@@ -3786,6 +3786,8 @@ static int nwrap_gethostbyname_r(const char *name,
                                                 buf, buflen, result);
                if (rc == 0) {
                        return 0;
+               } else if (rc == ERANGE) {
+                       return ERANGE;
                }
        }
        *h_errnop = h_errno;
@@ -3825,6 +3827,8 @@ static int nwrap_gethostbyname2_r(const char *name, int af,
                                                 buf, buflen, result);
                if (rc == 0) {
                        return 0;
+               } else if (rc == ERANGE) {
+                       return ERANGE;
                }
        }
        *h_errnop = h_errno;