diff options
author | Petr Cech <pcech@redhat.com> | 2015-08-18 06:59:31 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-14 16:00:49 +0200 |
commit | 376eaf187c13c2a1eaea0ffbdd970b6b563ab74c (patch) | |
tree | 0b4829b53497f0020d22385ef4e65c883ea8e5e2 /src/providers/data_provider_req.h | |
parent | b3074dca3acebd91437ef13d3329d6d65d655215 (diff) | |
download | sssd-376eaf187c13c2a1eaea0ffbdd970b6b563ab74c.tar.gz sssd-376eaf187c13c2a1eaea0ffbdd970b6b563ab74c.tar.xz sssd-376eaf187c13c2a1eaea0ffbdd970b6b563ab74c.zip |
DATA_PROVIDER: BE_REQ as string in log message
Add be_req2str() for translation BE_REQ to string.
So we will have
|| Got request for [0x1001][FAST BE_REQ_USER][1][name=celestian]
instead of
|| Got request for [0x1001][1][name=celestian]
Function be_req2str() is used in data provider and in responder too.
So this patch create new header file data_provider_req.h which
delivers function be_req2str() and definitions of BE_REQ_*.
Resolves:
https://fedorahosted.org/sssd/ticket/2708
Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/providers/data_provider_req.h')
-rw-r--r-- | src/providers/data_provider_req.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/providers/data_provider_req.h b/src/providers/data_provider_req.h new file mode 100644 index 000000000..338f8192f --- /dev/null +++ b/src/providers/data_provider_req.h @@ -0,0 +1,51 @@ +/* + SSSD + + Data Provider -- backend request + + Copyright (C) Petr Cech <pcech@redhat.com> 2015 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __DATA_PROVIDER_REQ__ +#define __DATA_PROVIDER_REQ__ + +#include <dbus/dbus.h> + +#define BE_REQ_USER 0x0001 +#define BE_REQ_GROUP 0x0002 +#define BE_REQ_INITGROUPS 0x0003 +#define BE_REQ_NETGROUP 0x0004 +#define BE_REQ_SERVICES 0x0005 +#define BE_REQ_SUDO_FULL 0x0006 +#define BE_REQ_SUDO_RULES 0x0007 +#define BE_REQ_AUTOFS 0x0009 +#define BE_REQ_HOST 0x0010 +#define BE_REQ_BY_SECID 0x0011 +#define BE_REQ_USER_AND_GROUP 0x0012 +#define BE_REQ_BY_UUID 0x0013 +#define BE_REQ_BY_CERT 0x0014 +#define BE_REQ_TYPE_MASK 0x00FF +#define BE_REQ_FAST 0x1000 + +/** + * @brief Convert request type to string for logging purpose. + * + * @param[in] req_type Type of request. + * @return Pointer to string with request type. There could be 'fast' flag. + */ +const char *be_req2str(dbus_uint32_t req_type); + +#endif /* __DATA_PROVIDER_REQ__ */ |