The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
exec_legacy.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: 7251d4856716364fc6717eae1d18015fac0056e0 $
20  *
21  * @file lib/server/exec_legacy.h
22  * @brief Legacy synchronous exec functions
23  *
24  * @copyright 2014 The FreeRADIUS server project
25  */
26 RCSIDH(exec_legacy_h, "$Id: 7251d4856716364fc6717eae1d18015fac0056e0 $")
27 
28 #include <freeradius-devel/server/request.h>
29 #include <freeradius-devel/util/pair.h>
30 #include <freeradius-devel/util/talloc.h>
31 #include <sys/types.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 pid_t radius_start_program_legacy(int *stdin_fd, int *stdout_fd, int *stderr_fd,
38  char const *cmd, request_t *request, bool exec_wait,
39  fr_pair_list_t *input_pairs, bool shell_escape);
40 
42  char *answer, int left);
43 
44 int radius_exec_program_legacy(char *out, size_t outlen,
45  request_t *request, char const *cmd, fr_pair_list_t *input_pairs,
46  bool exec_wait, bool shell_escape, fr_time_delta_t timeout) CC_HINT(nonnull (3, 4));
47 
48 #ifdef __cplusplus
49 }
50 #endif
#define RCSIDH(h, id)
Definition: build.h:445
static fr_time_delta_t timeout
Definition: dhcpclient.c:54
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.
Definition: exec_legacy.c:227
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.
Definition: exec_legacy.c:474
int radius_readfrom_program_legacy(int fd, pid_t pid, fr_time_delta_t timeout, char *answer, int left)
Read from the child process.
Definition: exec_legacy.c:357
static int stdout_fd
The original unmolested stdout file descriptor.
Definition: log.c:50
static int stderr_fd
The original unmolested stderr file descriptor.
Definition: log.c:49
A time delta, a difference in time measured in nanoseconds.
Definition: time.h:80
int nonnull(2, 5))
static size_t char ** out
Definition: value.h:984