mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-27 12:05:15 +00:00
Check that supplied query type is valid
This commit is contained in:
parent
4d7678dc5b
commit
1f4b9250cf
@ -167,7 +167,7 @@ client_set_password(const char *cp)
|
|||||||
password = cp;
|
password = cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
client_set_qtype(char *qtype)
|
client_set_qtype(char *qtype)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(qtype, "NULL"))
|
if (!strcasecmp(qtype, "NULL"))
|
||||||
@ -182,6 +182,7 @@ client_set_qtype(char *qtype)
|
|||||||
do_qtype = T_SRV;
|
do_qtype = T_SRV;
|
||||||
else if (!strcasecmp(qtype, "TXT"))
|
else if (!strcasecmp(qtype, "TXT"))
|
||||||
do_qtype = T_TXT;
|
do_qtype = T_TXT;
|
||||||
|
return (do_qtype == T_UNSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -27,7 +27,7 @@ const char *client_get_raw_addr();
|
|||||||
void client_set_nameserver(struct sockaddr_storage *, int);
|
void client_set_nameserver(struct sockaddr_storage *, int);
|
||||||
void client_set_topdomain(const char *cp);
|
void client_set_topdomain(const char *cp);
|
||||||
void client_set_password(const char *cp);
|
void client_set_password(const char *cp);
|
||||||
void client_set_qtype(char *qtype);
|
int client_set_qtype(char *qtype);
|
||||||
char *client_get_qtype();
|
char *client_get_qtype();
|
||||||
void client_set_downenc(char *encoding);
|
void client_set_downenc(char *encoding);
|
||||||
void client_set_selecttimeout(int select_timeout);
|
void client_set_selecttimeout(int select_timeout);
|
||||||
|
@ -249,7 +249,8 @@ main(int argc, char **argv)
|
|||||||
pidfile = optarg;
|
pidfile = optarg;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
client_set_qtype(optarg);
|
if (client_set_qtype(optarg))
|
||||||
|
errx(5, "Invalid query type '%s'", optarg);
|
||||||
break;
|
break;
|
||||||
case 'O': /* not -D, is Debug in server */
|
case 'O': /* not -D, is Debug in server */
|
||||||
client_set_downenc(optarg);
|
client_set_downenc(optarg);
|
||||||
|
Loading…
Reference in New Issue
Block a user