Skip to content

Commit 5d032ca

Browse files
committed
Remove hard-coded defaults for LHS and RHS
Don't fall back to using a default LHS or RHS when the configuration file can't be read. Original report from https://bugzilla.redhat.com/show_bug.cgi?id=1332493
1 parent fc0e1d7 commit 5d032ca

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/lib/hesiod.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ static const char rcsid[] = "$Id: hesiod.c,v 1.30 2002-04-03 21:40:55 ghudson Ex
8181
#define T_TXT 16
8282
#endif
8383

84-
/* Defaults if the configuration file is not present. */
85-
#define DEF_RHS ".athena.mit.edu"
86-
#define DEF_LHS ".ns"
87-
8884
/* Maximum size of a Hesiod response from the DNS. */
8985
#define MAX_HESRESP 1024
9086

@@ -291,20 +287,7 @@ static int read_config_file(struct hesiod_p *ctx, const char *filename)
291287
fp = fopen(filename, "r");
292288
if (!fp)
293289
{
294-
/* Use compiled in default domain names. */
295-
ctx->lhs = malloc(strlen(DEF_LHS) + 1);
296-
ctx->rhs = malloc(strlen(DEF_RHS) + 1);
297-
if (ctx->lhs && ctx->rhs)
298-
{
299-
strcpy(ctx->lhs, DEF_LHS);
300-
strcpy(ctx->rhs, DEF_RHS);
301-
return 0;
302-
}
303-
else
304-
{
305-
errno = ENOMEM;
306-
return -1;
307-
}
290+
return -1;
308291
}
309292

310293
ctx->lhs = NULL;

0 commit comments

Comments
 (0)