From: Alan T. DeKok Date: Thu, 15 May 2025 13:42:45 +0000 (-0400) Subject: move fr_skip* to their own C file and header X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f8911ed064bf84a3a4e0acaf371cb02520a2deb;p=thirdparty%2Ffreeradius-server.git move fr_skip* to their own C file and header as they are (and will be) used in many places --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index d3493bff53f..067f7640c64 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -50,7 +50,7 @@ typedef struct request_s request_t; #include #include #include -#include +#include #include #include #include diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index b3cc08f67fd..c0de76b7af4 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -40,6 +40,7 @@ RCSID("$Id$") #include #include #include +#include #include @@ -174,8 +175,6 @@ static inline CC_HINT(always_inline) int cf_tmpl_rules_verify(CONF_SECTION *cs, #define RULES_VERIFY(_cs, _rules) if (cf_tmpl_rules_verify(_cs, _rules) < 0) return NULL -static ssize_t fr_skip_xlat(char const *start, char const *end); - /* * Expand the variables in an input string. * @@ -1228,140 +1227,6 @@ static int process_template(cf_stack_t *stack) static int cf_file_fill(cf_stack_t *stack); -/** Skip an xlat expression. - * - * This is a simple "peek ahead" parser which tries to not be wrong. It may accept - * some things which will later parse as invalid (e.g. unknown attributes, etc.) - * But it also rejects all malformed expressions. - * - * It's used as a quick hack because the full parser isn't always available. - * - * @param[in] start start of the expression, MUST point to the "%{" or "%(" - * @param[in] end end of the string (or NULL for zero-terminated strings) - * @return - * >0 length of the string which was parsed - * <=0 on error - */ -static ssize_t fr_skip_xlat(char const *start, char const *end) -{ - int depth = 1; /* caller skips '{' */ - ssize_t slen; - char quote, end_quote; - char const *p = start; - - /* - * At least %{1} - */ - if (end && ((start + 4) > end)) { - fr_strerror_const("Invalid expansion"); - return 0; - } - - if ((*p != '%') && (*p != '$')) { - fr_strerror_const("Unexpected character in expansion"); - return -(p - start); - } - - p++; - if ((*p != '{') && (*p != '(')) { - char const *q = p; - - /* - * New xlat syntax: %foo(...) - */ - while (isalnum((int) *q) || (*q == '.') || (*q == '_') || (*q == '-')) { - q++; - } - if (*q == '(') { - p = q; - goto do_quote; - } - - fr_strerror_const("Invalid character after '%'"); - return -(p - start); - } - -do_quote: - quote = *(p++); - if (quote == '{') { - end_quote = '}'; - } else { - end_quote = ')'; - } - - while ((end && (p < end)) || (*p >= ' ')) { - if (*p == quote) { - p++; - depth++; - continue; - } - - if (*p == end_quote) { - p++; - depth--; - if (!depth) return p - start; - - continue; - } - - /* - * Nested expansion. - */ - if ((p[0] == '$') || (p[0] == '%')) { - if (end && (p + 2) >= end) break; - - if ((p[1] == '{') || ((p[0] == '$') && (p[1] == '('))) { - slen = fr_skip_xlat(p, end); - - check: - if (slen <= 0) return -(p - start) + slen; - - p += slen; - continue; - } - - /* - * Bare $ or %, just leave it alone. - */ - p++; - continue; - } - - /* - * A quoted string. - */ - if ((*p == '"') || (*p == '\'') || (*p == '`')) { - slen = fr_skip_string(p, end); - goto check; - } - - /* - * @todo - bare '(' is a condition or nested - * expression. The brackets need to balance - * here, too. - */ - - if (*p != '\\') { - p++; - continue; - } - - if (end && ((p + 2) >= end)) break; - - /* - * Escapes here are only one-character escapes. - */ - if (p[1] < ' ') break; - p += 2; - } - - /* - * Unexpected end of xlat - */ - fr_strerror_const("Unexpected end of expansion"); - return -(p - start); -} - static const bool terminal_end_section[UINT8_MAX + 1] = { ['{'] = true, }; @@ -1378,171 +1243,6 @@ static const bool terminal_end_line[UINT8_MAX + 1] = { ['}'] = true, }; -/** Skip a conditional expression. - * - * This is a simple "peek ahead" parser which tries to not be wrong. It may accept - * some things which will later parse as invalid (e.g. unknown attributes, etc.) - * But it also rejects all malformed expressions. - * - * It's used as a quick hack because the full parser isn't always available. - * - * @param[in] start start of the condition. - * @param[in] end end of the string (or NULL for zero-terminated strings) - * @param[in] terminal terminal character(s) - * @param[out] eol did the parse error happen at eol? - * @return - * >0 length of the string which was parsed. *eol is false. - * <=0 on error, *eol may be set. - */ -static ssize_t fr_skip_condition(char const *start, char const *end, bool const terminal[static UINT8_MAX + 1], bool *eol) -{ - char const *p = start; - bool was_regex = false; - int depth = 0; - ssize_t slen; - - if (eol) *eol = false; - - /* - * Keep parsing the condition until we hit EOS or EOL. - */ - while ((end && (p < end)) || *p) { - if (isspace((uint8_t) *p)) { - p++; - continue; - } - - /* - * In the configuration files, conditions end with ") {" or just "{" - */ - if ((depth == 0) && terminal[(uint8_t) *p]) { - return p - start; - } - - /* - * "recurse" to get more conditions. - */ - if (*p == '(') { - p++; - depth++; - was_regex = false; - continue; - } - - if (*p == ')') { - if (!depth) { - fr_strerror_const("Too many ')'"); - return -(p - start); - } - - p++; - depth--; - was_regex = false; - continue; - } - - /* - * Parse xlats. They cannot span EOL. - */ - if ((*p == '$') || (*p == '%')) { - if (end && ((p + 2) >= end)) { - fr_strerror_const("Expansions cannot extend across end of line"); - return -(p - start); - } - - if ((p[1] == '{') || ((p[0] == '$') && (p[1] == '('))) { - slen = fr_skip_xlat(p, end); - - check: - if (slen <= 0) return -(p - start) + slen; - - p += slen; - continue; - } - - /* - * Bare $ or %, just leave it alone. - */ - p++; - was_regex = false; - continue; - } - - /* - * Parse quoted strings. They cannot span EOL. - */ - if ((*p == '"') || (*p == '\'') || (*p == '`') || (was_regex && (*p == '/'))) { - was_regex = false; - - slen = fr_skip_string((char const *) p, end); - goto check; - } - - /* - * 192.168/16 is a netmask. So we only - * allow regex after a regex operator. - * - * This isn't perfect, but is good enough - * for most purposes. - */ - if ((p[0] == '=') || (p[0] == '!')) { - if (end && ((p + 2) >= end)) { - fr_strerror_const("Operators cannot extend across end of line"); - return -(p - start); - } - - if (p[1] == '~') { - was_regex = true; - p += 2; - continue; - } - - /* - * Some other '==' or '!=', just leave it alone. - */ - p++; - was_regex = false; - continue; - } - - /* - * Any control characters (other than \t) cause an error. - */ - if (*p < ' ') break; - - was_regex = false; - - /* - * Normal characters just get skipped. - */ - if (*p != '\\') { - p++; - continue; - } - - /* - * Backslashes at EOL are ignored. - */ - if (end && ((p + 2) >= end)) break; - - /* - * Escapes here are only one-character escapes. - */ - if (p[1] < ' ') break; - p += 2; - } - - /* - * We've fallen off of the end of a string. It may be OK? - */ - if (eol) *eol = (depth > 0); - - if (terminal[(uint8_t) *p]) return p - start; - - fr_strerror_const("Unexpected end of condition"); - return -(p - start); -} - static CONF_ITEM *process_if(cf_stack_t *stack) { ssize_t slen = 0; diff --git a/src/lib/server/command.c b/src/lib/server/command.c index 66b9b26cf82..b6a0c541f01 100644 --- a/src/lib/server/command.c +++ b/src/lib/server/command.c @@ -29,7 +29,7 @@ RCSID("$Id$") #include #include -#include +#include /* * Registration hooks for radmin. diff --git a/src/lib/server/util.c b/src/lib/server/util.c index 7f5c2d4a909..82a1aa7c136 100644 --- a/src/lib/server/util.c +++ b/src/lib/server/util.c @@ -25,6 +25,7 @@ RCSID("$Id$") #include #include +#include #include diff --git a/src/lib/tls/session.c b/src/lib/tls/session.c index 99fa5eb5c15..f6233b420ee 100644 --- a/src/lib/tls/session.c +++ b/src/lib/tls/session.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/src/lib/util/libfreeradius-util.mk b/src/lib/util/libfreeradius-util.mk index 86a88bf95d9..f9e21d14e95 100644 --- a/src/lib/util/libfreeradius-util.mk +++ b/src/lib/util/libfreeradius-util.mk @@ -80,6 +80,7 @@ SOURCES := \ sem.c \ sha1.c \ size.c \ + skip.c \ snprintf.c \ socket.c \ stats.c \ diff --git a/src/lib/util/misc.h b/src/lib/util/misc.h index de2598cee52..e7bacbc081e 100644 --- a/src/lib/util/misc.h +++ b/src/lib/util/misc.h @@ -52,25 +52,6 @@ void fr_talloc_verify_cb(const void *ptr, int depth, # define VERIFY_ALL_TALLOC #endif -/** Skip whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') - * - * @param[in,out] _p string to skip over. - */ -#define fr_skip_whitespace(_p) while(isspace((uint8_t)*(_p))) _p++ - -/** Skip whitespace, stopping at end ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') - * - * @param[in,out] _p string to skip over. - * @param[in] _e pointer to end of string. - */ -#define fr_bskip_whitespace(_p, _e) while((_p < _e) && isspace((uint8_t)*(_p))) _p++ - -/** Skip everything that's not whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') - * - * @param[in,out] _p string to skip over. - */ -#define fr_skip_not_whitespace(_p) while(*_p && !isspace((uint8_t)*(_p))) _p++ - /** Zero out any whitespace with nul bytes * * @param[in,out] _p string to process diff --git a/src/lib/util/pair_tokenize.c b/src/lib/util/pair_tokenize.c index 981bd93372c..b59f06805fb 100644 --- a/src/lib/util/pair_tokenize.c +++ b/src/lib/util/pair_tokenize.c @@ -22,7 +22,7 @@ */ RCSID("$Id$") -#include +#include #include #include #include diff --git a/src/lib/util/skip.c b/src/lib/util/skip.c new file mode 100644 index 00000000000..81d71294916 --- /dev/null +++ b/src/lib/util/skip.c @@ -0,0 +1,412 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** Preparse input by skipping known tokens + * + * @file src/lib/util/skip.c + * + * @copyright 2025 Network RADIUS SAS (legal@networkradius.com) + */ +RCSID("$Id$") + +#include +#include +#include + +/** Skip a quoted string. + * + * @param[in] start start of the string, pointing to the quotation character + * @param[in] end end of the string (or NULL for zero-terminated strings) + * @return + * >0 length of the string which was parsed + * <=0 on error + */ +ssize_t fr_skip_string(char const *start, char const *end) +{ + char const *p = start; + char quote; + + quote = *(p++); + + while ((end && (p < end)) || *p) { + /* + * Stop at the quotation character + */ + if (*p == quote) { + p++; + return p - start; + } + + /* + * Not an escape character: it's OK. + */ + if (*p != '\\') { + p++; + continue; + } + + if (end && ((p + 2) >= end)) { + fail: + fr_strerror_const("Unexpected escape at end of string"); + return -(p - start); + } + + /* + * Escape at EOL is not allowed. + */ + if (p[1] < ' ') goto fail; + + /* + * \r or \n, etc. + */ + if (!isdigit((uint8_t) p[1])) { + p += 2; + continue; + } + + /* + * Double-quoted strings use \000 + * Regexes use \0 + */ + if (quote == '/') { + p++; + continue; + } + + if (end && ((p + 4) >= end)) goto fail; + + /* + * Allow for \1f in single quoted strings + */ + if ((quote == '\'') && isxdigit((uint8_t) p[1]) && isxdigit((uint8_t) p[2])) { + p += 3; + continue; + } + + if (!isdigit((uint8_t) p[2]) || !isdigit((uint8_t) p[3])) { + fr_strerror_const("Invalid octal escape"); + return -(p - start); + } + + p += 4; + } + + /* + * Unexpected end of string. + */ + fr_strerror_const("Unexpected end of string"); + return -(p - start); +} + +/** Skip an xlat expression. + * + * This is a simple "peek ahead" parser which tries to not be wrong. It may accept + * some things which will later parse as invalid (e.g. unknown attributes, etc.) + * But it also rejects all malformed expressions. + * + * It's used as a quick hack because the full parser isn't always available. + * + * @param[in] start start of the expression, MUST point to the "%{" or "%(" + * @param[in] end end of the string (or NULL for zero-terminated strings) + * @return + * >0 length of the string which was parsed + * <=0 on error + */ +ssize_t fr_skip_xlat(char const *start, char const *end) +{ + int depth = 1; /* caller skips '{' */ + ssize_t slen; + char quote, end_quote; + char const *p = start; + + /* + * At least %{1} + */ + if (end && ((start + 4) > end)) { + fr_strerror_const("Invalid expansion"); + return 0; + } + + if ((*p != '%') && (*p != '$')) { + fr_strerror_const("Unexpected character in expansion"); + return -(p - start); + } + + p++; + if ((*p != '{') && (*p != '(')) { + char const *q = p; + + /* + * New xlat syntax: %foo(...) + */ + while (isalnum((int) *q) || (*q == '.') || (*q == '_') || (*q == '-')) { + q++; + } + if (*q == '(') { + p = q; + goto do_quote; + } + + fr_strerror_const("Invalid character after '%'"); + return -(p - start); + } + +do_quote: + quote = *(p++); + if (quote == '{') { + end_quote = '}'; + } else { + end_quote = ')'; + } + + while ((end && (p < end)) || (*p >= ' ')) { + if (*p == quote) { + p++; + depth++; + continue; + } + + if (*p == end_quote) { + p++; + depth--; + if (!depth) return p - start; + + continue; + } + + /* + * Nested expansion. + */ + if ((p[0] == '$') || (p[0] == '%')) { + if (end && (p + 2) >= end) break; + + if ((p[1] == '{') || ((p[0] == '$') && (p[1] == '('))) { + slen = fr_skip_xlat(p, end); + + check: + if (slen <= 0) return -(p - start) + slen; + + p += slen; + continue; + } + + /* + * Bare $ or %, just leave it alone. + */ + p++; + continue; + } + + /* + * A quoted string. + */ + if ((*p == '"') || (*p == '\'') || (*p == '`')) { + slen = fr_skip_string(p, end); + goto check; + } + + /* + * @todo - bare '(' is a condition or nested + * expression. The brackets need to balance + * here, too. + */ + + if (*p != '\\') { + p++; + continue; + } + + if (end && ((p + 2) >= end)) break; + + /* + * Escapes here are only one-character escapes. + */ + if (p[1] < ' ') break; + p += 2; + } + + /* + * Unexpected end of xlat + */ + fr_strerror_const("Unexpected end of expansion"); + return -(p - start); +} + +/** Skip a conditional expression. + * + * This is a simple "peek ahead" parser which tries to not be wrong. It may accept + * some things which will later parse as invalid (e.g. unknown attributes, etc.) + * But it also rejects all malformed expressions. + * + * It's used as a quick hack because the full parser isn't always available. + * + * @param[in] start start of the condition. + * @param[in] end end of the string (or NULL for zero-terminated strings) + * @param[in] terminal terminal character(s) + * @param[out] eol did the parse error happen at eol? + * @return + * >0 length of the string which was parsed. *eol is false. + * <=0 on error, *eol may be set. + */ +ssize_t fr_skip_condition(char const *start, char const *end, bool const terminal[static UINT8_MAX + 1], bool *eol) +{ + char const *p = start; + bool was_regex = false; + int depth = 0; + ssize_t slen; + + if (eol) *eol = false; + + /* + * Keep parsing the condition until we hit EOS or EOL. + */ + while ((end && (p < end)) || *p) { + if (isspace((uint8_t) *p)) { + p++; + continue; + } + + /* + * In the configuration files, conditions end with ") {" or just "{" + */ + if ((depth == 0) && terminal[(uint8_t) *p]) { + return p - start; + } + + /* + * "recurse" to get more conditions. + */ + if (*p == '(') { + p++; + depth++; + was_regex = false; + continue; + } + + if (*p == ')') { + if (!depth) { + fr_strerror_const("Too many ')'"); + return -(p - start); + } + + p++; + depth--; + was_regex = false; + continue; + } + + /* + * Parse xlats. They cannot span EOL. + */ + if ((*p == '$') || (*p == '%')) { + if (end && ((p + 2) >= end)) { + fr_strerror_const("Expansions cannot extend across end of line"); + return -(p - start); + } + + if ((p[1] == '{') || ((p[0] == '$') && (p[1] == '('))) { + slen = fr_skip_xlat(p, end); + + check: + if (slen <= 0) return -(p - start) + slen; + + p += slen; + continue; + } + + /* + * Bare $ or %, just leave it alone. + */ + p++; + was_regex = false; + continue; + } + + /* + * Parse quoted strings. They cannot span EOL. + */ + if ((*p == '"') || (*p == '\'') || (*p == '`') || (was_regex && (*p == '/'))) { + was_regex = false; + + slen = fr_skip_string((char const *) p, end); + goto check; + } + + /* + * 192.168/16 is a netmask. So we only + * allow regex after a regex operator. + * + * This isn't perfect, but is good enough + * for most purposes. + */ + if ((p[0] == '=') || (p[0] == '!')) { + if (end && ((p + 2) >= end)) { + fr_strerror_const("Operators cannot extend across end of line"); + return -(p - start); + } + + if (p[1] == '~') { + was_regex = true; + p += 2; + continue; + } + + /* + * Some other '==' or '!=', just leave it alone. + */ + p++; + was_regex = false; + continue; + } + + /* + * Any control characters (other than \t) cause an error. + */ + if (*p < ' ') break; + + was_regex = false; + + /* + * Normal characters just get skipped. + */ + if (*p != '\\') { + p++; + continue; + } + + /* + * Backslashes at EOL are ignored. + */ + if (end && ((p + 2) >= end)) break; + + /* + * Escapes here are only one-character escapes. + */ + if (p[1] < ' ') break; + p += 2; + } + + /* + * We've fallen off of the end of a string. It may be OK? + */ + if (eol) *eol = (depth > 0); + + if (terminal[(uint8_t) *p]) return p - start; + + fr_strerror_const("Unexpected end of condition"); + return -(p - start); +} + diff --git a/src/lib/util/skip.h b/src/lib/util/skip.h new file mode 100644 index 00000000000..454b2be2e4d --- /dev/null +++ b/src/lib/util/skip.h @@ -0,0 +1,60 @@ +#pragma once +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** Preparse input by skipping known tokens + * + * @file src/lib/util/skip.h + * + * @copyright 2001,2006 The FreeRADIUS server project + */ +RCSIDH(skip_h, "$Id$") + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Skip whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') + * + * @param[in,out] _p string to skip over. + */ +#define fr_skip_whitespace(_p) while(isspace((uint8_t)*(_p))) _p++ + +/** Skip whitespace, stopping at end ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') + * + * @param[in,out] _p string to skip over. + * @param[in] _e pointer to end of string. + */ +#define fr_bskip_whitespace(_p, _e) while((_p < _e) && isspace((uint8_t)*(_p))) _p++ + +/** Skip everything that's not whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ') + * + * @param[in,out] _p string to skip over. + */ +#define fr_skip_not_whitespace(_p) while(*_p && !isspace((uint8_t)*(_p))) _p++ + +ssize_t fr_skip_string(char const *start, char const *end) CC_HINT(nonnull(1)); + +ssize_t fr_skip_xlat(char const *start, char const *end) CC_HINT(nonnull(1)); + +ssize_t fr_skip_condition(char const *start, char const *end, bool const terminal[static UINT8_MAX + 1], + bool *eol) CC_HINT(nonnull(1,3)); +#ifdef __cplusplus +} +#endif diff --git a/src/lib/util/time.c b/src/lib/util/time.c index 207a9af603f..a965af202b4 100644 --- a/src/lib/util/time.c +++ b/src/lib/util/time.c @@ -27,7 +27,7 @@ RCSID("$Id$") #include #include -#include +#include int64_t const fr_time_multiplier_by_res[] = { [FR_TIME_RES_NSEC] = 1, diff --git a/src/lib/util/token.c b/src/lib/util/token.c index 469c678c203..dcfd4eb71cf 100644 --- a/src/lib/util/token.c +++ b/src/lib/util/token.c @@ -24,7 +24,9 @@ */ RCSID("$Id$") -#include +#include + +#include #include #include @@ -511,90 +513,3 @@ char const *fr_token_name(int token) { return fr_table_str_by_value(fr_tokens_table, token, ""); } - - -/** Skip a quoted string. - * - * @param[in] start start of the string, pointing to the quotation character - * @param[in] end end of the string (or NULL for zero-terminated strings) - * @return - * >0 length of the string which was parsed - * <=0 on error - */ -ssize_t fr_skip_string(char const *start, char const *end) -{ - char const *p = start; - char quote; - - quote = *(p++); - - while ((end && (p < end)) || *p) { - /* - * Stop at the quotation character - */ - if (*p == quote) { - p++; - return p - start; - } - - /* - * Not an escape character: it's OK. - */ - if (*p != '\\') { - p++; - continue; - } - - if (end && ((p + 2) >= end)) { - fail: - fr_strerror_const("Unexpected escape at end of string"); - return -(p - start); - } - - /* - * Escape at EOL is not allowed. - */ - if (p[1] < ' ') goto fail; - - /* - * \r or \n, etc. - */ - if (!isdigit((uint8_t) p[1])) { - p += 2; - continue; - } - - /* - * Double-quoted strings use \000 - * Regexes use \0 - */ - if (quote == '/') { - p++; - continue; - } - - if (end && ((p + 4) >= end)) goto fail; - - /* - * Allow for \1f in single quoted strings - */ - if ((quote == '\'') && isxdigit((uint8_t) p[1]) && isxdigit((uint8_t) p[2])) { - p += 3; - continue; - } - - if (!isdigit((uint8_t) p[2]) || !isdigit((uint8_t) p[3])) { - fr_strerror_const("Invalid octal escape"); - return -(p - start); - } - - p += 4; - } - - /* - * Unexpected end of string. - */ - fr_strerror_const("Unexpected end of string"); - return -(p - start); -} - diff --git a/src/lib/util/token.h b/src/lib/util/token.h index 05f6062a44f..398084ec490 100644 --- a/src/lib/util/token.h +++ b/src/lib/util/token.h @@ -153,7 +153,6 @@ fr_token_t gettoken(char const **ptr, char *buf, int buflen, bool unescape); fr_token_t getop(char const **ptr); fr_token_t getstring(char const **ptr, char *buf, int buflen, bool unescape); char const *fr_token_name(int); -ssize_t fr_skip_string(char const *start, char const *end); #ifdef __cplusplus } diff --git a/src/lib/util/trie.c b/src/lib/util/trie.c index c8fe1cef472..70e4c6f3c48 100644 --- a/src/lib/util/trie.c +++ b/src/lib/util/trie.c @@ -23,6 +23,7 @@ RCSID("$Id$") #include +#include #include #include diff --git a/src/listen/control/radmin.c b/src/listen/control/radmin.c index f5aa08a6b5d..1428871c9b2 100644 --- a/src/listen/control/radmin.c +++ b/src/listen/control/radmin.c @@ -74,6 +74,7 @@ DIAG_ON(strict-prototypes) #include #include +#include #include #include diff --git a/src/listen/cron/proto_cron_crontab.c b/src/listen/cron/proto_cron_crontab.c index d3a0eb8f0c6..7c1355e824e 100644 --- a/src/listen/cron/proto_cron_crontab.c +++ b/src/listen/cron/proto_cron_crontab.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "lib/server/cf_util.h" #include "proto_cron.h" diff --git a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c index 8d0ab69643b..e13ed06df13 100644 --- a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c +++ b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c @@ -28,6 +28,7 @@ RCSID("$Id$") #include #include #include +#include #include diff --git a/src/modules/rlm_rest/rest.c b/src/modules/rlm_rest/rest.c index 0ae119dac46..33ddb2fc783 100644 --- a/src/modules/rlm_rest/rest.c +++ b/src/modules/rlm_rest/rest.c @@ -35,6 +35,7 @@ RCSID("$Id$") #include #include #include +#include #include #include diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index a236eadfd98..d8b9e9c0fbb 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -36,6 +36,7 @@ RCSID("$Id$") #include #include #include +#include #include #include #include diff --git a/src/modules/rlm_unix/rlm_unix.c b/src/modules/rlm_unix/rlm_unix.c index d1cc1b6c0b5..4ccdca7b06a 100644 --- a/src/modules/rlm_unix/rlm_unix.c +++ b/src/modules/rlm_unix/rlm_unix.c @@ -31,6 +31,7 @@ USES_APPLE_DEPRECATED_API #include #include #include +#include #include #include diff --git a/src/modules/rlm_winbind/rlm_winbind.c b/src/modules/rlm_winbind/rlm_winbind.c index 434f3966da0..1a2041472da 100644 --- a/src/modules/rlm_winbind/rlm_winbind.c +++ b/src/modules/rlm_winbind/rlm_winbind.c @@ -33,6 +33,7 @@ RCSID("$Id$") #include #include #include +#include #include #include "rlm_winbind.h"