Commit 9a2f9db5 authored by Thomas Markwalder's avatar Thomas Markwalder

[master] Implement and use new option format type 'k'

    Merges in #68.
parent 79cfe1ac
......@@ -225,6 +225,13 @@ by Eric Young (eay@cryptsoft.com).
values (e.g. next-server).
[Gitlab #28]
- The option format for the server option omapi-key was changed to a
format type 'k' (key name); while server options ldap-port and
ldap-init-retry were changed to 'L' (unsigned 32-bit integer). These
three options were inadvertantly broken when the 'd' format content
was changed to comply with RFC 1035 wire format (see Gitlab #2).
[Gitlab #68]
Changes since 4.4.0 (New Features)
- none
Changes since 4.4.0 (Bug Fixes)
......
......@@ -1631,6 +1631,7 @@ format_has_text(format)
while (*p != '\0') {
switch (*p++) {
case 't':
case 'k':
return 1;
/* These symbols are arbitrary, not fixed or
......@@ -1762,6 +1763,7 @@ format_min_length(format, oc)
case 'A': /* Array of all that precedes. */
case 'a': /* Array of preceding symbol. */
case 'Z': /* nothing. */
case 'k': /* key name */
return min_len;
case 'c': /* Compress flag for D atom. */
......@@ -1903,7 +1905,9 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
}
hunksize += k;
break;
case 't':
case 'k':
fmtbuf[l + 1] = 0;
numhunk = -2;
break;
......@@ -2047,6 +2051,7 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
for (; j < numelem; j++) {
switch (fmtbuf [j]) {
case 't':
case 'k':
/* endbuf-1 leaves room for NULL. */
k = pretty_text(&op, endbuf - 1, &dp,
data + len, emit_quotes);
......
......@@ -5058,7 +5058,33 @@ int parse_option_token (rv, cfile, fmt, expr, uniform, lookups)
POST(freeval);
}
break;
case 'k': /* key name */
token = peek_token (&val, &len, cfile);
if (token == STRING) {
token = next_token (&val, &len, cfile);
} else {
val = parse_host_name(cfile);
if (!val) {
parse_warn(cfile, "not a valid key name.");
skip_to_semi(cfile);
return 0;
}
freeval = ISC_TRUE;
}
if (!make_const_data (&t, (const unsigned char *)val,
strlen(val), 1, 1, MDL)) {
log_fatal ("No memory key name");
}
if (freeval == ISC_TRUE) {
dfree((char *)val, MDL);
freeval = ISC_FALSE;
}
break;
case 'N':
f = (*fmt) + 1;
g = strchr (*fmt, '.');
......
......@@ -84,10 +84,14 @@ HASH_FUNCTIONS (option_code, const unsigned *, struct option,
the name of the set of enumeration values to parse or emit,
followed by a '.'. The width of the data is specified in the
named enumeration. Named enumerations are tracked in parse.c.
d - Domain name (i.e., FOO or FOO.BAR).
D - Domain list (i.e., example.com eng.example.com)
d - Domain name (e.g., FOO or FOO.BAR) no quotes,
on-wire format is RFC 1035.
D - Domain list (e.g., "example.com eng.example.com") quoted,
on-wire format is RFC 1035.
c - When following a 'D' atom, enables compression pointers.
Z - Zero-length option
k - Key name, unquoted string (e.g. mykey.com or some-text or abc123)
parsed with parse_host_name().
*/
struct universe dhcp_universe;
......
......@@ -5591,7 +5591,7 @@ fi
# Testing section
# Bind Makefile needs to know ATF is not included.
if 0; then
if test "foo" = "barr"; then
BIND_ATF_TRUE=
BIND_ATF_FALSE='#'
else
......
......@@ -250,7 +250,7 @@ fi
# Testing section
# Bind Makefile needs to know ATF is not included.
AM_CONDITIONAL(BIND_ATF, 0)
AM_CONDITIONAL(BIND_ATF, test "foo" = "barr")
DISTCHECK_ATF_CONFIGURE_FLAG=
atf_path="no"
......
......@@ -251,7 +251,7 @@ fi
# Testing section
# Bind Makefile needs to know ATF is not included.
AM_CONDITIONAL(BIND_ATF, 0)
AM_CONDITIONAL(BIND_ATF, test "foo" = "barr")
DISTCHECK_ATF_CONFIGURE_FLAG=
atf_path="no"
......
......@@ -256,7 +256,7 @@ fi
# Testing section
# Bind Makefile needs to know ATF is not included.
AM_CONDITIONAL(BIND_ATF, 0)
AM_CONDITIONAL(BIND_ATF, test "foo" = "barr")
DISTCHECK_ATF_CONFIGURE_FLAG=
atf_path="no"
......
......@@ -250,7 +250,7 @@ fi
# Testing section
# Bind Makefile needs to know ATF is not included.
AM_CONDITIONAL(BIND_ATF, 0)
AM_CONDITIONAL(BIND_ATF, test "foo" = "barr")
DISTCHECK_ATF_CONFIGURE_FLAG=
atf_path="no"
......
......@@ -1137,7 +1137,7 @@ _do_lookup_dhcp_int_option (struct option_state *options, int option_name)
{
struct option_cache *oc;
struct data_string db;
int ret;
int ret = 0;
memset (&db, 0, sizeof (db));
oc = lookup_option (&server_universe, options, option_name);
......@@ -1147,13 +1147,14 @@ _do_lookup_dhcp_int_option (struct option_state *options, int option_name)
(struct client_state *) NULL, options,
(struct option_state *) NULL,
&global_scope, oc, MDL) &&
db.data != NULL && *db.data != '\0')
db.data != NULL)
{
ret = strtol ((const char *) db.data, NULL, 10);
if (db.len == 4) {
ret = getULong(db.data);
}
data_string_forget (&db, MDL);
}
else
ret = 0;
return (ret);
}
......
......@@ -211,7 +211,7 @@ static struct option server_options[] = {
{ "limited-broadcast-address", "I", &server_universe, 33, 1 },
{ "remote-port", "S", &server_universe, 34, 1 },
{ "local-address", "I", &server_universe, 35, 1 },
{ "omapi-key", "d", &server_universe, 36, 1 },
{ "omapi-key", "k", &server_universe, 36, 1 },
{ "stash-agent-options", "f", &server_universe, 37, 1 },
{ "ddns-ttl", "T", &server_universe, 38, 1 },
{ "ddns-update-style", "Nddns-styles.", &server_universe, 39, 1 },
......@@ -241,7 +241,7 @@ static struct option server_options[] = {
#endif
#if defined(LDAP_CONFIGURATION)
{ "ldap-server", "t", &server_universe, 60, 1 },
{ "ldap-port", "d", &server_universe, 61, 1 },
{ "ldap-port", "L", &server_universe, 61, 1 },
{ "ldap-username", "t", &server_universe, 62, 1 },
{ "ldap-password", "t", &server_universe, 63, 1 },
{ "ldap-base-dn", "t", &server_universe, 64, 1 },
......@@ -259,7 +259,7 @@ static struct option server_options[] = {
{ "ldap-tls-crlcheck", "Nldap-tls-crlcheck.", &server_universe, 75, 1 },
{ "ldap-tls-ciphers", "t", &server_universe, 76, 1 },
{ "ldap-tls-randfile", "t", &server_universe, 77, 1 },
{ "ldap-init-retry", "d", &server_universe, SV_LDAP_INIT_RETRY, 1 },
{ "ldap-init-retry", "L", &server_universe, SV_LDAP_INIT_RETRY, 1 },
#endif /* LDAP_USE_SSL */
#if defined(LDAP_USE_GSSAPI)
{ "ldap-gssapi-keytab", "t", &server_universe, SV_LDAP_GSSAPI_KEYTAB, 1},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment