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: 3fd9fce54853c2297bdd76009c3a82c067c41a7c $
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: 3fd9fce54853c2297bdd76009c3a82c067c41a7c $")
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 void cf_md5_init(void);
53 void cf_md5_final(uint8_t *digest);
54 
55 /*
56  * Config file writing
57  */
58 int cf_section_write(FILE *fp, CONF_SECTION *cs, int depth);
59 
60 /*
61  * Misc
62  */
63 CONF_ITEM *cf_reference_item(CONF_SECTION const *parentcs, CONF_SECTION const *outercs, char const *ptr);
64 char const *cf_expand_variables(char const *filename, int lineno,
65  CONF_SECTION *outer_cs,
66  char *output, size_t outsize,
67  char const *input, ssize_t inlen, bool *soft_fail);
69 
70 #ifdef __cplusplus
71 }
72 #endif
int const char * file
Definition: acutest.h:702
#define RCSIDH(h, id)
Definition: build.h:482
int cf_file_read(CONF_SECTION *cs, char const *file)
Definition: cf_file.c:3415
void cf_section_set_unlang(CONF_SECTION *cs)
Definition: cf_file.c:3744
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:172
void cf_md5_init(void)
Definition: cf_file.c:3072
int cf_section_write(FILE *fp, CONF_SECTION *cs, int depth)
Definition: cf_file.c:3546
bool cf_file_check(CONF_PAIR *cp, bool check_perms)
Do some checks on the file as an "input" file.
Definition: cf_file.c:656
int cf_section_pass2(CONF_SECTION *cs)
Definition: cf_file.c:755
void cf_file_check_user(uid_t uid, gid_t gid)
Set the euid/egid used when performing file checks.
Definition: cf_file.c:3489
void cf_md5_final(uint8_t *digest)
Definition: cf_file.c:3085
CONF_ITEM * cf_reference_item(CONF_SECTION const *parentcs, CONF_SECTION const *outercs, char const *ptr)
Definition: cf_file.c:3611
void cf_file_free(CONF_SECTION *cs)
Definition: cf_file.c:3474
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:101
long int ssize_t
Definition: merged_model.c:24
unsigned char uint8_t
Definition: merged_model.c:30
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:997