diff options
| author | Michael Biebl <biebl@debian.org> | 2025-12-13 13:48:57 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-12-13 13:48:57 +0100 |
| commit | 6de29285e533f4fec22a219013f3687edb6b7399 (patch) | |
| tree | 4b1627413f2e8fc8e3ccfa1496a79a04b8a71bde /src/libnm-client-impl/tests/test-copy-cert-as-user.c | |
| parent | 01609e485803fa250413385ae209660fb7b30a2e (diff) | |
New upstream version 1.54.3 upstream/1.54.3
Diffstat (limited to 'src/libnm-client-impl/tests/test-copy-cert-as-user.c')
| -rw-r--r-- | src/libnm-client-impl/tests/test-copy-cert-as-user.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libnm-client-impl/tests/test-copy-cert-as-user.c b/src/libnm-client-impl/tests/test-copy-cert-as-user.c new file mode 100644 index 00000000..b2ef9de6 --- /dev/null +++ b/src/libnm-client-impl/tests/test-copy-cert-as-user.c @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +/* + * This is a program to manually test the + * nm_utils_copy_cert_as_user() libnm function. + */ + +#include "libnm-client-impl/nm-default-libnm.h" + +#include "nm-utils.h" + +int +main(int argc, char **argv) +{ + gs_free_error GError *error = NULL; + gs_free char *filename = NULL; + + if (argc != 3) { + g_printerr("Usage: %s <FILE> <USER>\n", argv[0]); + return 1; + } + + filename = nm_utils_copy_cert_as_user(argv[1], argv[2], &error); + if (!filename) { + g_printerr("Error: %s\n", error->message); + return 1; + } + + g_print("%s\n", filename); + + return 0; +} |