This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [Bug 150350] libnss_hesiod doesn't honor classes=HS,IN in /etc/hesiod.conf
On Tue, Jun 14, 2005 at 09:11:57PM -0700, Ulrich Drepper wrote:
> I've applied a slightly changed version of the patch.
In that case the check for ctx->classes[0] is useless, as it is always
initialized. And for consistency, the both classes equal check could
move to the parsing routine as well.
2005-06-15 Jakub Jelinek <jakub@redhat.com>
* hesiod/hesiod.c (hesiod_init): Don't check for ctx->classes[0] == 0
or both classes equal here.
(parse_config_file): If both classes are equal, clear the second one.
--- libc/hesiod/hesiod.c.jj 2005-06-15 07:38:30.000000000 +0200
+++ libc/hesiod/hesiod.c 2005-06-15 07:41:11.000000000 +0200
@@ -126,7 +126,7 @@ hesiod_init(void **context) {
* If there is no default hesiod realm set, we return an
* error.
*/
- if (!ctx->RHS || ctx->classes[0] == 0 || ctx->classes[0] == ctx->classes[1]) {
+ if (!ctx->RHS) {
__set_errno(ENOEXEC);
goto cleanup;
}
@@ -327,7 +327,8 @@ parse_config_file(struct hesiod_p *ctx,
nother at all. */
ctx->classes[0] = C_IN;
ctx->classes[1] = C_HS;
- } else if (n == 1)
+ } else if (n == 1
+ || ctx->classes[0] == ctx->classes[1])
ctx->classes[1] = 0;
}
}
Jakub