Greenbone Vulnerability Management Libraries 22.26.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
10
11#include "credentials.h"
12
13#include "strings.h" /* for gvm_append_text */
14
15#include <string.h>
16
17#undef G_LOG_DOMAIN
21#define G_LOG_DOMAIN "libgvm base"
22
30void
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
49void
50append_to_credentials_username (credentials_t *credentials, const char *text,
51 gsize length)
52{
53 gvm_append_text (&credentials->username, text, length);
54}
55
63void
64append_to_credentials_password (credentials_t *credentials, const char *text,
65 gsize length)
66{
67 gvm_append_text (&credentials->password, text, length);
68}
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
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
void free_credentials(credentials_t *credentials)
Free credentials.
Definition credentials.c:31
Credential pairs and triples.
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
String utilities.
A username password pair.
Definition credentials.h:20
gchar * role
Role of user.
Definition credentials.h:35
gchar * password
Password of user.
Definition credentials.h:23
gchar * timezone
Timezone of user.
Definition credentials.h:27
gchar * username
Login name of user.
Definition credentials.h:21
gchar * uuid
UUID of user.
Definition credentials.h:25
gchar * severity_class
Severity Class setting of user.
Definition credentials.h:31