diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-15 16:24:25 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-12-18 20:03:27 +0100 |
commit | eae21d66fbca2628593d6b3f18e5326f91ba6fe8 (patch) | |
tree | 35294ae75b9193d1e1ac2db04be86fad74b7eb4c | |
parent | 301f7c3099fbb5f149eeeaf1010a19ed7db8d003 (diff) | |
download | sssd-eae21d66fbca2628593d6b3f18e5326f91ba6fe8.tar.gz sssd-eae21d66fbca2628593d6b3f18e5326f91ba6fe8.tar.xz sssd-eae21d66fbca2628593d6b3f18e5326f91ba6fe8.zip |
RESPONDERS: Create a common file with service names and versions
The monitor sends calls different sbus methods to different responders.
Instead of including headers of the particular responders directly in
monitor, which breaks layering a little, create a common header file
that will be included from src/responder/common/
-rw-r--r-- | src/monitor/monitor.c | 2 | ||||
-rw-r--r-- | src/responder/autofs/autofs_private.h | 3 | ||||
-rw-r--r-- | src/responder/common/responder_sbus.h | 43 | ||||
-rw-r--r-- | src/responder/nss/nsssrv.c | 1 | ||||
-rw-r--r-- | src/responder/nss/nsssrv.h | 3 | ||||
-rw-r--r-- | src/responder/pac/pacsrv.h | 4 | ||||
-rw-r--r-- | src/responder/pam/pamsrv.c | 4 | ||||
-rw-r--r-- | src/responder/ssh/sshsrv.c | 1 | ||||
-rw-r--r-- | src/responder/ssh/sshsrv_private.h | 3 | ||||
-rw-r--r-- | src/responder/sudo/sudosrv.c | 1 | ||||
-rw-r--r-- | src/responder/sudo/sudosrv_private.h | 2 |
11 files changed, 50 insertions, 17 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 25169e853..19de7682b 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -51,7 +51,7 @@ #include "dbus/dbus.h" #include "sbus/sssd_dbus.h" #include "monitor/monitor_interfaces.h" -#include "responder/nss/nsssrv.h" +#include "responder/common/responder_sbus.h" #ifdef USE_KEYRING #include <keyutils.h> diff --git a/src/responder/autofs/autofs_private.h b/src/responder/autofs/autofs_private.h index 58445f35b..efe1d623f 100644 --- a/src/responder/autofs/autofs_private.h +++ b/src/responder/autofs/autofs_private.h @@ -21,8 +21,7 @@ #ifndef _AUTOFSSRV_PRIVATE_H_ #define _AUTOFSSRV_PRIVATE_H_ -#define SSS_AUTOFS_SBUS_SERVICE_VERSION 0x0001 -#define SSS_AUTOFS_SBUS_SERVICE_NAME "autofs" +#include "responder/common/responder_sbus.h" #define SSS_AUTOFS_PROTO_VERSION 0x001 diff --git a/src/responder/common/responder_sbus.h b/src/responder/common/responder_sbus.h new file mode 100644 index 000000000..4927d72a7 --- /dev/null +++ b/src/responder/common/responder_sbus.h @@ -0,0 +1,43 @@ +/* + SSSD + + SSS Client Responder, common header file + + Copyright (C) Red Hat, 2012 + + 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 __SSS_RESPONDER_SBUS_H__ +#define __SSS_RESPONDER_SBUS_H__ + +#define NSS_SBUS_SERVICE_NAME "nss" +#define NSS_SBUS_SERVICE_VERSION 0x0001 + +#define SSS_PAM_SBUS_SERVICE_NAME "pam" +#define SSS_PAM_SBUS_SERVICE_VERSION 0x0001 + +#define SSS_SUDO_SBUS_SERVICE_NAME "sudo" +#define SSS_SUDO_SBUS_SERVICE_VERSION 0x0001 + +#define SSS_AUTOFS_SBUS_SERVICE_NAME "autofs" +#define SSS_AUTOFS_SBUS_SERVICE_VERSION 0x0001 + +#define SSS_SSH_SBUS_SERVICE_NAME "ssh" +#define SSS_SSH_SBUS_SERVICE_VERSION 0x0001 + +#define PAC_SBUS_SERVICE_NAME "pac" +#define PAC_SBUS_SERVICE_VERSION 0x0001 + +#endif /* __SSS_RESPONDER_SBUS_H__ */ diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c index 71f9a0bce..17a59b19a 100644 --- a/src/responder/nss/nsssrv.c +++ b/src/responder/nss/nsssrv.c @@ -42,6 +42,7 @@ #include "sbus/sssd_dbus.h" #include "responder/common/responder_packet.h" #include "responder/common/responder.h" +#include "responder/common/responder_sbus.h" #include "providers/data_provider.h" #include "monitor/monitor_interfaces.h" #include "sbus/sbus_client.h" diff --git a/src/responder/nss/nsssrv.h b/src/responder/nss/nsssrv.h index a8b2c3c97..de15f53ec 100644 --- a/src/responder/nss/nsssrv.h +++ b/src/responder/nss/nsssrv.h @@ -33,9 +33,6 @@ #include "responder/common/responder_packet.h" #include "responder/common/responder.h" -#define NSS_SBUS_SERVICE_VERSION 0x0001 -#define NSS_SBUS_SERVICE_NAME "nss" - #define NSS_PACKET_MAX_RECV_SIZE 1024 struct getent_ctx; diff --git a/src/responder/pac/pacsrv.h b/src/responder/pac/pacsrv.h index c0a13a332..8b73d9957 100644 --- a/src/responder/pac/pacsrv.h +++ b/src/responder/pac/pacsrv.h @@ -37,13 +37,11 @@ #include "sbus/sssd_dbus.h" #include "responder/common/responder_packet.h" #include "responder/common/responder.h" +#include "responder/common/responder_sbus.h" #include "lib/idmap/sss_idmap.h" #include "util/sss_nss.h" #include "db/sysdb.h" -#define PAC_SBUS_SERVICE_VERSION 0x0001 -#define PAC_SBUS_SERVICE_NAME "pac" - #define PAC_PACKET_MAX_RECV_SIZE 1024 struct getent_ctx; diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c index 4a4d0ce92..bf03db03c 100644 --- a/src/responder/pam/pamsrv.c +++ b/src/responder/pam/pamsrv.c @@ -43,12 +43,10 @@ #include "sbus/sbus_client.h" #include "responder/pam/pamsrv.h" #include "responder/common/negcache.h" +#include "responder/common/responder_sbus.h" #define DEFAULT_PAM_FD_LIMIT 8192 -#define SSS_PAM_SBUS_SERVICE_VERSION 0x0001 -#define SSS_PAM_SBUS_SERVICE_NAME "pam" - struct sbus_method monitor_pam_methods[] = { { MON_CLI_METHOD_PING, monitor_common_pong }, { MON_CLI_METHOD_RES_INIT, monitor_common_res_init }, diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c index fe01f81f1..52ac9b04b 100644 --- a/src/responder/ssh/sshsrv.c +++ b/src/responder/ssh/sshsrv.c @@ -24,6 +24,7 @@ #include "confdb/confdb.h" #include "monitor/monitor_interfaces.h" #include "responder/common/responder.h" +#include "responder/common/responder_sbus.h" #include "responder/ssh/sshsrv_private.h" #include "providers/data_provider.h" diff --git a/src/responder/ssh/sshsrv_private.h b/src/responder/ssh/sshsrv_private.h index 4b13ca1df..296bd94a2 100644 --- a/src/responder/ssh/sshsrv_private.h +++ b/src/responder/ssh/sshsrv_private.h @@ -23,9 +23,6 @@ #include "responder/common/responder.h" -#define SSS_SSH_SBUS_SERVICE_VERSION 0x0001 -#define SSS_SSH_SBUS_SERVICE_NAME "ssh" - #define SSS_SSH_KNOWN_HOSTS_PATH PUBCONF_PATH"/known_hosts" #define SSS_SSH_KNOWN_HOSTS_TEMP_TMPL PUBCONF_PATH"/.known_hosts.XXXXXX" diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c index b4f8f8879..a0b1e8870 100644 --- a/src/responder/sudo/sudosrv.c +++ b/src/responder/sudo/sudosrv.c @@ -24,6 +24,7 @@ #include "confdb/confdb.h" #include "monitor/monitor_interfaces.h" #include "responder/common/responder.h" +#include "responder/common/responder_sbus.h" #include "responder/sudo/sudosrv_private.h" #include "providers/data_provider.h" diff --git a/src/responder/sudo/sudosrv_private.h b/src/responder/sudo/sudosrv_private.h index c9eae57b8..9d3156ca1 100644 --- a/src/responder/sudo/sudosrv_private.h +++ b/src/responder/sudo/sudosrv_private.h @@ -29,8 +29,6 @@ #include "responder/common/responder.h" #define SSS_SUDO_ERROR_OK 0 -#define SSS_SUDO_SBUS_SERVICE_VERSION 0x0001 -#define SSS_SUDO_SBUS_SERVICE_NAME "sudo" enum sss_dp_sudo_type { SSS_DP_SUDO_REFRESH_RULES, |