int (*cf_read_hook)(byte *buf, unsigned int max, int fd);
int (*cf_open_hook)(char *filename);
+struct include_file_stack *ifs;
#define YY_INPUT(buf,result,max) result = cf_read_hook(buf, max, ifs->conf_fd);
#define YY_NO_UNPUT
struct include_file_stack *next;
};
-struct include_file_stack *ifs;
+extern struct include_file_stack *ifs;
int cf_lex(void);
struct cli *this_cli;
static int
-cli_cmd_read_hook(byte *buf, unsigned int max)
+cli_cmd_read_hook(byte *buf, unsigned int max, UNUSED int fd)
{
if (!cli_rh_trick_flag)
{
if (*filename != '/') {
snprintf(full_name, sizeof(full_name), "%s/%s", dirname(config_name), filename);
+ full_name[sizeof(full_name)-1] = 0;
cur = full_name;
}
if ((ret = open(cur, O_RDONLY)) == -1)
cf_error("Unable to open included configuration file: %s", cur);
+
+ return ret;
}