summaryrefslogtreecommitdiff
path: root/0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-05 01:40:41 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-05 01:40:41 +0000
commit3f9fe74e5703e10375dfe1d1a8cbecfc0b2318b7 (patch)
tree1f422e933a3c4586f9b532f50cb22032933dd0c9 /0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch
parentc4c7a7210cd8f769f47de04872c6f2b0cd604e28 (diff)
automatic import of certmongeropeneuler24.03_LTS
Diffstat (limited to '0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch')
-rw-r--r--0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch b/0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch
new file mode 100644
index 0000000..e349fcf
--- /dev/null
+++ b/0001-getcert-return-2-when-trying-to-create-a-duplicate-e.patch
@@ -0,0 +1,54 @@
+From 4ef80a8365e746d514110520c76d23433d1a378b Mon Sep 17 00:00:00 2001
+From: Rob Crittenden <rcritten@redhat.com>
+Date: Mon, 22 Jan 2024 09:44:30 -0500
+Subject: [PATCH 1/2] getcert: return 2 when trying to create a duplicate entry
+
+This affects the add-ca, request and start-tracking commands.
+
+Returning a unique return code will make scripting easier.
+
+Fixes: https://www.pagure.io/certmonger/issue/269
+
+Signed-off-by: Rob Crittenden <rcritten@redhat.com>
+---
+ src/getcert.1.in | 9 +++++++++
+ src/getcert.c | 3 +++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/src/getcert.1.in b/src/getcert.1.in
+index 4adfc925..754a8836 100644
+--- a/src/getcert.1.in
++++ b/src/getcert.1.in
+@@ -43,6 +43,15 @@ All commands can take either the \fB\-s\fR or \fB\-S\fR arguments, which instruc
+ bus, if no value is set. By default, \fIgetcert\fR consults the @CM_DBUS_NAME@
+ service attached to the system bus.
+
++.SH "EXIT STATUS"
++The exit status is 0 on success, nonzero on error.
++
++0 Success
++
++1 Error
++
++2 Duplicate entry
++
+ .SH BUGS
+ Please file tickets for any that you find at https://fedorahosted.org/certmonger/
+
+diff --git a/src/getcert.c b/src/getcert.c
+index 77fa5367..81b4bc8d 100644
+--- a/src/getcert.c
++++ b/src/getcert.c
+@@ -497,6 +497,9 @@ send_req(DBusMessage *req, int verbose)
+ printf(_("No response received from %s service.\n"),
+ CM_DBUS_NAME);
+ }
++ if (strcmp(err.name, "org.fedorahosted.certmonger.duplicate") == 0) {
++ exit(2);
++ }
+ exit(1);
+ }
+ dbus_message_unref(req);
+--
+2.42.0
+