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

Legacy synchronous exec functions. More...

#include <freeradius-devel/server/request.h>
#include <freeradius-devel/util/pair.h>
#include <freeradius-devel/util/talloc.h>
#include <sys/types.h>
+ Include dependency graph for exec_legacy.h:

Go to the source code of this file.

Functions

int radius_exec_program_legacy (char *out, size_t outlen, request_t *request, char const *cmd, fr_pair_list_t *input_pairs, bool exec_wait, bool shell_escape, fr_time_delta_t timeout))
 Execute a program. More...
 
int radius_readfrom_program_legacy (int fd, pid_t pid, fr_time_delta_t timeout, char *answer, int left)
 Read from the child process. More...
 
pid_t radius_start_program_legacy (int *stdin_fd, int *stdout_fd, int *stderr_fd, char const *cmd, request_t *request, bool exec_wait, fr_pair_list_t *input_pairs, bool shell_escape)
 Start a process. More...
 

Detailed Description

Legacy synchronous exec functions.

Id
7251d4856716364fc6717eae1d18015fac0056e0

Definition in file exec_legacy.h.

Function Documentation

◆ radius_exec_program_legacy()

int radius_exec_program_legacy ( char *  out,
size_t  outlen,
request_t request,
char const *  cmd,
fr_pair_list_t input_pairs,
bool  exec_wait,
bool  shell_escape,
fr_time_delta_t  timeout 
)

Execute a program.

Parameters
[out]outbuffer to append plaintext (non valuepair) output.
[in]outlenlength of out buffer.
[in]requestCurrent request (may be NULL).
[in]cmdCommand to execute. This is parsed into argv[] parts, then each individual argv part is xlat'ed.
[in]input_pairslist of value pairs - these will be available in the environment of the child.
[in]exec_waitset to 1 if you want to read from or write to child.
[in]shell_escapevalues before passing them as arguments.
[in]timeoutamount of time to wait, in seconds.
Returns
  • 0 if exec_wait==0.
  • exit code if exec_wait!=0.
  • -1 on failure.

Definition at line 474 of file exec_legacy.c.

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

◆ radius_readfrom_program_legacy()

int radius_readfrom_program_legacy ( int  fd,
pid_t  pid,
fr_time_delta_t  timeout,
char *  answer,
int  left 
)

Read from the child process.

Parameters
fdfile descriptor to read from.
pidpid of child, will be reaped if it dies.
timeoutamount of time to wait, in seconds.
answerbuffer to write into.
leftlength of buffer.
Returns
  • -1 on failure.
  • Length of output.

Definition at line 357 of file exec_legacy.c.

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

◆ radius_start_program_legacy()

pid_t radius_start_program_legacy ( int *  stdin_fd,
int *  stdout_fd,
int *  stderr_fd,
char const *  cmd,
request_t request,
bool  exec_wait,
fr_pair_list_t input_pairs,
bool  shell_escape 
)

Start a process.

Parameters
[out]stdin_fdpointer to int, receives the stdin file descriptor. Set to NULL and the child will have /dev/null on stdin.
[out]stdout_fdpointer to int, receives the stdout file descriptor. Set to NULL and the child will have /dev/null on stdout.
[out]stderr_fdpointer to int, receives the stderr file descriptor. Set to NULL and the child will have /dev/null on stderr.
[in]cmdCommand to execute. This is parsed into argv[] parts, then each individual argv part is xlat'ed.
[in]requestCurrent request
[in]exec_waitset to true to read from or write to child.
[in]input_pairslist of value pairs - these will be put into the environment variables of the child.
[in]shell_escapevalues before passing them as arguments.
Returns
  • PID of the child process.
  • -1 on failure.

Definition at line 227 of file exec_legacy.c.

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