On 05/26/2014 07:14 PM, Jakub Hrozek wrote:
On Thu, May 22, 2014 at 07:57:28PM +0200, Pavel Březina wrote:
> On 05/21/2014 11:03 PM, Jakub Hrozek wrote:
>> Hi,
>>
>> the attaches two patches implement DBus methods to retrieve SSSD domains
>> using the system bus as well as two example getters that leverage the
>> infrastructure to Get and GetAll the object properties.
>>
>> Pavel, I know you have a large patchset in a private tree that
>> implements the other getters and moves the domain methods into a
>> separate file. I'm fine with merging your and mine patches, I just
>> wanted to get the ball rolling on the list. Feel free to reply with your
>> patchset.
>
> Hi,
> see the attachment.
>
> I squash all my patches to these five - mainly discarded the moving
> the code around.
>
> I kept you as the author for the methods as I made only very minor
> changes there. However, I took the ownership for the properties
> since there only very little of your original code remains there - I
> hope you don't mind.
>
> The next three patches implements the SSSD components interface
> required for the OpenLMI provider. I'm sending it to this thread
> since it depends on the domain patches anyway - there is enough
> dependency fuzz already.
>
> From a1a69124369eb50d37bc151802125b909fe7d1ec Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina(a)redhat.com>
> Date: Tue, 6 May 2014 10:54:47 +0200
> Subject: [PATCH 4/5] utils: add get_known_services()
>
> ---
> src/monitor/monitor.c | 3 +--
> src/util/util.c | 8 ++++++++
> src/util/util.h | 2 ++
> 3 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
> index
a164ede8a46f5b383c56a23ada693ba6d2ca2210..5e6eb37fdbf30c4079b309d98a1b05fdffdf65c7 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
fc37aad229813f328c9af007a005569bb02c5091..ad93ca1a0715e3a5f5c6c7371eb142718c38afa3 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
54c6c6c78b87398da66e276d67a04f4558cec790..de7f9e553ef8f91df88fe7a71284538358e8798d 100644
> --- a/src/util/util.h
> +++ b/src/util/util.h
> @@ -377,6 +377,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);
> --
> 1.7.11.7
>
ACK, see attached patch for what I tested with.
Ack. Thank you for the test.