sssd/0002-UTIL-Add-ERR_SBUS_REQUEST_HANDLED.patch
2016-05-13 11:09:38 +02:00

63 lines
2.3 KiB
Diff

From 33abcf8b0ba5c71369c1c12f91b89e6f6a0143c3 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Wed, 27 Apr 2016 11:11:31 +0200
Subject: [PATCH 2/3] UTIL: Add ERR_SBUS_REQUEST_HANDLED
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In most cases when sbus request parsing finishes, the request is handled
internally and a reply is sent to the caller. However, in handlers that
are parsed and handled completely manually, we might want to be notified
about this case so that the called of sbus_request_parse_or_finish()
aborts the request and doesn't proceed with using the sbus request which
is already freed internally in sbus_request_parse_or_finish().
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
(cherry picked from commit 406a7e5b731ae79084dce00021e01ebe7b7d724a)
---
src/sbus/sssd_dbus_request.c | 1 +
src/util/util_errors.c | 1 +
src/util/util_errors.h | 1 +
3 files changed, 3 insertions(+)
diff --git a/src/sbus/sssd_dbus_request.c b/src/sbus/sssd_dbus_request.c
index aa57f6b6587183a9edd7764d123e82b01b5f6070..c71a79b1f06c92c25f8bb836b5bf815c056d3912 100644
--- a/src/sbus/sssd_dbus_request.c
+++ b/src/sbus/sssd_dbus_request.c
@@ -74,6 +74,7 @@ sbus_request_invoke_or_finish(struct sbus_request *dbus_req,
}
switch(ret) {
+ case ERR_SBUS_REQUEST_HANDLED:
case EOK:
return;
case ENOMEM:
diff --git a/src/util/util_errors.c b/src/util/util_errors.c
index 59ae63ab8d6e834a772349b162bf282f9a4f1c72..c998e14c26e43c3cd6a5a060bb6f74698b9e93ae 100644
--- a/src/util/util_errors.c
+++ b/src/util/util_errors.c
@@ -84,6 +84,7 @@ struct err_string error_to_str[] = {
{ "Subdomain is inactive" }, /* ERR_SUBDOM_INACTIVE */
{ "Account is locked" }, /* ERR_ACCOUNT_LOCKED */
{ "AD renewal child failed" }, /* ERR_RENEWAL_CHILD */
+ { "SBUS request already handled" }, /* ERR_SBUS_REQUEST_HANDLED */
{ "ERR_LAST" } /* ERR_LAST */
};
diff --git a/src/util/util_errors.h b/src/util/util_errors.h
index 05791f2f08f107a8b4830b810b8826983763174f..c0d9622a431a9946fdfa5e5c60ecf7b9e1ae66a5 100644
--- a/src/util/util_errors.h
+++ b/src/util/util_errors.h
@@ -106,6 +106,7 @@ enum sssd_errors {
ERR_SUBDOM_INACTIVE,
ERR_ACCOUNT_LOCKED,
ERR_RENEWAL_CHILD,
+ ERR_SBUS_REQUEST_HANDLED,
ERR_LAST /* ALWAYS LAST */
};
--
2.7.4