OpenVAS Libraries  9.0.3
credentials.c File Reference
#include "credentials.h"
#include "openvas_string.h"
Include dependency graph for credentials.c:

Go to the source code of this file.

Functions

void free_credentials (credentials_t *credentials)
 Free credentials. More...
 
void append_to_credentials_username (credentials_t *credentials, const char *text, gsize length)
 Append text to the username of a credential pair. More...
 
void append_to_credentials_password (credentials_t *credentials, const char *text, gsize length)
 Append text to the password of a credential pair. More...
 

Function Documentation

◆ append_to_credentials_password()

void append_to_credentials_password ( credentials_t credentials,
const char *  text,
gsize  length 
)

Append text to the password of a credential pair.

Parameters
[in]credentialsCredentials.
[in]textThe text to append.
[in]lengthLength of the text.

Definition at line 84 of file credentials.c.

References openvas_append_text(), and credentials_t::password.

86 {
87  openvas_append_text (&credentials->password, text, length);
88 }
gchar * password
Password of user.
Definition: credentials.h:40
void openvas_append_text(gchar **var, const gchar *string, gsize length)
Append a string of a known length to a string variable.
Here is the call graph for this function:

◆ append_to_credentials_username()

void append_to_credentials_username ( credentials_t credentials,
const char *  text,
gsize  length 
)

Append text to the username of a credential pair.

Parameters
[in]credentialsCredentials.
[in]textThe text to append.
[in]lengthLength of the text.

Definition at line 70 of file credentials.c.

References openvas_append_text(), and credentials_t::username.

72 {
73  openvas_append_text (&credentials->username, text, length);
74 }
gchar * username
Login name of user.
Definition: credentials.h:38
void openvas_append_text(gchar **var, const gchar *string, gsize length)
Append a string of a known length to a string variable.
Here is the call graph for this function:

◆ free_credentials()

void free_credentials ( credentials_t credentials)

Free credentials.

Free the members of a credentials pair.

Parameters
[in]credentialsPointer to the credentials.
Todo:
Check whether uuid has to be freed, too.

Definition at line 40 of file credentials.c.

References credentials_t::dynamic_severity, credentials_t::password, credentials_t::role, credentials_t::severity_class, credentials_t::timezone, and credentials_t::username.

41 {
42  g_free (credentials->username);
43  credentials->username = NULL;
44 
45  g_free (credentials->password);
46  credentials->password = NULL;
47 
50  g_free (credentials->timezone);
51  credentials->timezone = NULL;
52 
53  g_free (credentials->role);
54  credentials->role = NULL;
55 
56  g_free (credentials->severity_class);
57  credentials->severity_class = NULL;
58 
59  credentials->dynamic_severity = 0;
60 }
gchar * role
Role of user.
Definition: credentials.h:52
gchar * username
Login name of user.
Definition: credentials.h:38
gchar * severity_class
Severity Class setting of user. Set in OpenVAS Manager.
Definition: credentials.h:48
gchar * timezone
Timezone of user. Set in OpenVAS Manager.
Definition: credentials.h:44
gchar * password
Password of user.
Definition: credentials.h:40
int dynamic_severity
Dynamic Severity setting of user. Set in OpenVAS Manager.
Definition: credentials.h:50