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)
 
CONF_ITEMcf_reference_item (CONF_SECTION const *parentcs, CONF_SECTION const *outercs, char const *ptr)
 
int cf_section_pass2 (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
fb3165f410ffd13191021146da14a3f0091f19b2

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 174 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 658 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 3084 of file cf_file.c.

◆ cf_file_free()

void cf_file_free ( CONF_SECTION cs)

Definition at line 3069 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 3010 of file cf_file.c.

+ Here is the call graph for this function:
+ 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 3206 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 757 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 3141 of file cf_file.c.

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