Greenbone Vulnerability Management Libraries  22.8.0
credentials.c
Go to the documentation of this file.
1 /* SPDX-FileCopyrightText: 2010-2023 Greenbone AG
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  */
5 
11 #include "credentials.h"
12 
13 #include "strings.h" /* for gvm_append_text */
14 
15 #include <string.h>
16 
17 #undef G_LOG_DOMAIN
18 
21 #define G_LOG_DOMAIN "libgvm base"
22 
30 void
32 {
33  g_free (credentials->username);
34  g_free (credentials->password);
35  g_free (credentials->uuid);
36  g_free (credentials->timezone);
37  g_free (credentials->role);
38  g_free (credentials->severity_class);
39  memset (credentials, '\0', sizeof (*credentials));
40 }
41 
49 void
50 append_to_credentials_username (credentials_t *credentials, const char *text,
51  gsize length)
52 {
53  gvm_append_text (&credentials->username, text, length);
54 }
55 
63 void
64 append_to_credentials_password (credentials_t *credentials, const char *text,
65  gsize length)
66 {
67  gvm_append_text (&credentials->password, text, length);
68 }
credentials_t::timezone
gchar * timezone
Timezone of user.
Definition: credentials.h:27
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.
Definition: credentials.c:64
credentials_t::username
gchar * username
Login name of user.
Definition: credentials.h:21
drop_privileges
int drop_privileges(gchar *username, GError **error)
Drop privileges.
Definition: drop_privileges.c:58
cvss
Describe a CVSS metrics.
Definition: cvss.c:154
nvti
The structure of a information record that corresponds to a NVT.
Definition: nvti.c:394
free_credentials
void free_credentials(credentials_t *credentials)
Free credentials.
Definition: credentials.c:31
credentials.h
Credential pairs and triples.
credentials_t::severity_class
gchar * severity_class
Severity Class setting of user.
Definition: credentials.h:31
gvm_append_text
void gvm_append_text(gchar **var, const gchar *string, gsize length)
Append a string of a known length to a string variable.
Definition: strings.c:66
credentials_t
A username password pair.
Definition: credentials.h:20
credentials_t::password
gchar * password
Password of user.
Definition: credentials.h:23
strings.h
String utilities.
credentials_t::uuid
gchar * uuid
UUID of user.
Definition: credentials.h:25
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.
Definition: credentials.c:50
credentials_t::role
gchar * role
Role of user.
Definition: credentials.h:35