summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2014-05-06 10:54:47 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-05-28 16:41:05 +0200
commitebd2db737485d334cd54316e05f848f3ccfd2fee (patch)
tree914b7db92a657d3041cb63853ca9b357f75effe4 /src
parentd81f46fb294a6f6f64d3237ab0e0ab01f2c5ea20 (diff)
downloadsssd-ebd2db737485d334cd54316e05f848f3ccfd2fee.tar.gz
sssd-ebd2db737485d334cd54316e05f848f3ccfd2fee.tar.xz
sssd-ebd2db737485d334cd54316e05f848f3ccfd2fee.zip
utils: add get_known_services()
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/monitor/monitor.c3
-rw-r--r--src/util/util.c8
-rw-r--r--src/util/util.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index a164ede8a..5e6eb37fd 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -888,8 +888,7 @@ done:
static char *check_services(char **services)
{
- const char *known_services[] = { "nss", "pam", "sudo", "autofs", "ssh",
- "pac", "ifp", NULL };
+ const char * const *known_services = get_known_services();
int i;
int ii;
diff --git a/src/util/util.c b/src/util/util.c
index fc37aad22..ad93ca1a0 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -806,3 +806,11 @@ bool check_ipv6_addr(struct in6_addr *addr, uint8_t flags)
return true;
}
+
+const char * const * get_known_services(void)
+{
+ static const char *svc[] = {"nss", "pam", "sudo", "autofs",
+ "ssh", "pac", "ifp", NULL };
+
+ return svc;
+}
diff --git a/src/util/util.h b/src/util/util.h
index f682f50fe..38d9fca4c 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -378,6 +378,8 @@ errno_t check_and_open_readonly(const char *filename, int *fd,
bool check_ipv4_addr(struct in_addr *addr, uint8_t check);
bool check_ipv6_addr(struct in6_addr *addr, uint8_t check);
+const char * const * get_known_services(void);
+
int split_on_separator(TALLOC_CTX *mem_ctx, const char *str,
const char sep, bool trim, bool skip_empty,
char ***_list, int *size);