Greenbone Security Assistant  8.0.0
gsad_base.h File Reference

Headers/structs used generally in GSA. More...

#include "gsad_cmd.h"
#include "gsad_user.h"
#include <glib.h>
#include <sys/time.h>
Include dependency graph for gsad_base.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int gsad_base_init ()
 Base init. More...
 
int gsad_base_cleanup ()
 Base init. More...
 
void set_chroot_state (int)
 Sets the chroot state. More...
 
void set_http_only (int)
 Sets the http_only state. More...
 
char * ctime_r_strip_newline (time_t *, char *)
 Return string from ctime_r with newline replaces with terminator. More...
 

Detailed Description

Headers/structs used generally in GSA.

Definition in file gsad_base.h.

Function Documentation

◆ ctime_r_strip_newline()

char* ctime_r_strip_newline ( time_t *  time,
char *  string 
)

Return string from ctime_r with newline replaces with terminator.

Parameters
[in]timeTime.
[out]stringTime string.
Returns
Return from ctime_r applied to time, with newline stripped off.

Definition at line 111 of file gsad_base.c.

112 {
113  struct tm *tm;
114 
115  tm = localtime (time);
116  if (tm == NULL || (strftime (string, 199, "%c %Z", tm) == 0))
117  {
118  string[0] = '\0';
119  return string;
120  }
121  return string;
122 }

Referenced by envelope_gmp(), and gsad_message().

Here is the caller graph for this function:

◆ gsad_base_cleanup()

int gsad_base_cleanup ( )

Base init.

Returns
0 success, -1 error.

Definition at line 74 of file gsad_base.c.

75 {
76  xmlCleanupParser ();
77  return 0;
78 }

◆ gsad_base_init()

int gsad_base_init ( )

Base init.

Returns
0 success, 1 XML needs thread support.

Definition at line 59 of file gsad_base.c.

60 {
61  if (!xmlHasFeature (XML_WITH_THREAD))
62  return 1;
63  /* Required by libxml for thread safety. */
64  xmlInitParser ();
65  return 0;
66 }

◆ set_chroot_state()

void set_chroot_state ( int  state)

Sets the chroot state.

Parameters
[in]stateThe new chroot state.

Definition at line 86 of file gsad_base.c.

87 {
88  chroot_state = state;
89 }
static int chroot_state
The chroot state: 0 = no chroot, 1 = chroot used.
Definition: gsad_base.c:46

References chroot_state.

◆ set_http_only()

void set_http_only ( int  state)

Sets the http_only state.

Parameters
[in]stateThe new http_only state.

Definition at line 97 of file gsad_base.c.

98 {
99  http_only = state;
100 }
static int http_only
The http_only state: 0 = using HTTPS, 1 = HTTP only.
Definition: gsad_base.c:51

References http_only.