The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
cf_file.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: fb3165f410ffd13191021146da14a3f0091f19b2 $
20  *
21  * @file lib/server/cf_file.h
22  * @brief Parse on-disk text based config files into the FreeRADIUS internal format.
23  *
24  * @copyright 2017 The FreeRADIUS server project
25  */
26 RCSIDH(cf_file_h, "$Id: fb3165f410ffd13191021146da14a3f0091f19b2 $")
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 
31 #include <freeradius-devel/server/cf_util.h>
32 
33 #include <freeradius-devel/util/rb.h>
34 #include <freeradius-devel/util/syserror.h>
35 #include <freeradius-devel/util/table.h>
36 #include <freeradius-devel/util/print.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * Config file parsing
44  */
45 int cf_file_read(CONF_SECTION *cs, char const *file);
47 void cf_file_free(CONF_SECTION *cs);
48 
49 bool cf_file_check(CONF_PAIR *cp, bool check_perms);
50 void cf_file_check_user(uid_t uid, gid_t gid);
51 
52 /*
53  * Config file writing
54  */
55 int cf_section_write(FILE *fp, CONF_SECTION *cs, int depth);
56 
57 /*
58  * Misc
59  */
60 CONF_ITEM *cf_reference_item(CONF_SECTION const *parentcs, CONF_SECTION const *outercs, char const *ptr);
61 char const *cf_expand_variables(char const *filename, int lineno,
62  CONF_SECTION *outer_cs,
63  char *output, size_t outsize,
64  char const *input, ssize_t inlen, bool *soft_fail);
65 #ifdef __cplusplus
66 }
67 #endif
int const char * file
Definition: acutest.h:702
#define RCSIDH(h, id)
Definition: build.h:445
int cf_file_read(CONF_SECTION *cs, char const *file)
Definition: cf_file.c:3010
char const * cf_expand_variables(char const *filename, int lineno, CONF_SECTION *outer_cs, char *output, size_t outsize, char const *input, ssize_t inlen, bool *soft_fail)
Definition: cf_file.c:174
int cf_section_write(FILE *fp, CONF_SECTION *cs, int depth)
Definition: cf_file.c:3141
bool cf_file_check(CONF_PAIR *cp, bool check_perms)
Do some checks on the file as an "input" file.
Definition: cf_file.c:658
int cf_section_pass2(CONF_SECTION *cs)
Definition: cf_file.c:757
void cf_file_check_user(uid_t uid, gid_t gid)
Set the euid/egid used when performing file checks.
Definition: cf_file.c:3084
CONF_ITEM * cf_reference_item(CONF_SECTION const *parentcs, CONF_SECTION const *outercs, char const *ptr)
Definition: cf_file.c:3206
void cf_file_free(CONF_SECTION *cs)
Definition: cf_file.c:3069
Common header for all CONF_* types.
Definition: cf_priv.h:49
Configuration AVP similar to a fr_pair_t.
Definition: cf_priv.h:70
A section grouping multiple CONF_PAIR.
Definition: cf_priv.h:89
long int ssize_t
Definition: merged_model.c:24
static uint8_t depth(fr_minmax_heap_index_t i)
Definition: minmax_heap.c:83
static size_t char fr_sbuff_t size_t inlen
Definition: value.h:984