The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Functions
cf_file.h File Reference

Parse on-disk text based config files into the FreeRADIUS internal format. More...

#include <stddef.h>
#include <stdint.h>
#include <freeradius-devel/server/cf_util.h>
#include <freeradius-devel/util/rb.h>
#include <freeradius-devel/util/syserror.h>
#include <freeradius-devel/util/table.h>
#include <freeradius-devel/util/print.h>
+ Include dependency graph for cf_file.h:

Go to the source code of this file.

Functions

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)
 
bool cf_file_check (CONF_PAIR *cp, bool check_perms)
 Do some checks on the file as an "input" file. More...
 
void cf_file_check_user (uid_t uid, gid_t gid)
 Set the euid/egid used when performing file checks. More...
 
void cf_file_free (CONF_SECTION *cs)
 
int cf_file_read (CONF_SECTION *cs, char const *file)
 
void cf_md5_final (uint8_t *digest)
 
void cf_md5_init (void)
 
CONF_ITEMcf_reference_item (CONF_SECTION const *parentcs, CONF_SECTION const *outercs, char const *ptr)
 
int cf_section_pass2 (CONF_SECTION *cs)
 
void cf_section_set_unlang (CONF_SECTION *cs)
 
int cf_section_write (FILE *fp, CONF_SECTION *cs, int depth)
 

Detailed Description

Parse on-disk text based config files into the FreeRADIUS internal format.

Id
3fd9fce54853c2297bdd76009c3a82c067c41a7c

Definition in file cf_file.h.

Function Documentation

◆ cf_expand_variables()

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 at line 172 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cf_file_check()

bool cf_file_check ( CONF_PAIR cp,
bool  check_perms 
)

Do some checks on the file as an "input" file.

i.e. one read by a module.

Note
Must be called with super user privileges.
Parameters
cpcurrently being processed.
check_permsIf true - will return false if file is world readable, or not readable by the unprivileged user/group.
Returns
  • true if permissions are OK, or the file exists.
  • false if the file does not exist or the permissions are incorrect.

Definition at line 656 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cf_file_check_user()

void cf_file_check_user ( uid_t  uid,
gid_t  gid 
)

Set the euid/egid used when performing file checks.

Sets the euid, and egid used when cf_file_check is called to check permissions on conf items of type CONF_FLAG_FILE_INPUT

Note
This is probably only useful for the freeradius daemon itself.
Parameters
uidto set, (uid_t)-1 to use current euid.
gidto set, (gid_t)-1 to use current egid.

Definition at line 3489 of file cf_file.c.

◆ cf_file_free()

void cf_file_free ( CONF_SECTION cs)

Definition at line 3474 of file cf_file.c.

+ Here is the call graph for this function:

◆ cf_file_read()

int cf_file_read ( CONF_SECTION cs,
char const *  file 
)

Definition at line 3415 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cf_md5_final()

void cf_md5_final ( uint8_t digest)

Definition at line 3085 of file cf_file.c.

+ Here is the caller graph for this function:

◆ cf_md5_init()

void cf_md5_init ( void  )

Definition at line 3072 of file cf_file.c.

+ Here is the caller graph for this function:

◆ cf_reference_item()

CONF_ITEM* cf_reference_item ( CONF_SECTION const *  parentcs,
CONF_SECTION const *  outercs,
char const *  ptr 
)

Definition at line 3611 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cf_section_pass2()

int cf_section_pass2 ( CONF_SECTION cs)

Definition at line 755 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cf_section_set_unlang()

void cf_section_set_unlang ( CONF_SECTION cs)

Definition at line 3744 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cf_section_write()

int cf_section_write ( FILE *  fp,
CONF_SECTION cs,
int  depth 
)

Definition at line 3546 of file cf_file.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: