On (06/03/15 19:28), Michal Židek wrote:
> On 03/06/2015 05:47 PM, Lukas Slebodnik wrote:
>> On (03/03/15 22:45), Michal Židek wrote:
>>> New patches are attached.
>>>
>>> SSSD loudly complains to logs and fails to start if
>>> default_domain_suffix is used and use_fully_qualified_names
>>> is set to False (as Stephen suggested). Also the change
>>> of defaults value for use_fully_quallified_names is logged
>>> (as Lukas suggested). The man page was also updated
>>> (in seperate patch).
>>>
>>> Michal
>>
>> >From 359f48a25aba03e036dfd7317dd0b34c8e80cd1e Mon Sep 17 00:00:00 2001
>>> From: Michal Zidek <mzidek(a)redhat.com>
>>> Date: Fri, 30 Jan 2015 15:48:04 +0100
>>> Subject: [PATCH 1/2] Use FQDN if default domain was set
>>>
>>>
https://fedorahosted.org/sssd/ticket/2569
>>> ---
>>> src/confdb/confdb.c | 35 ++++++++++++++++++++++++++++++++---
>>> src/util/util_errors.c | 1 +
>>> src/util/util_errors.h | 1 +
>> Patch cannot be applied to master due to conflict with newly added error code
>> ERR_TIMESPEC_NOT_SUPPORTED
>>
>> LS
>
> Thank you Lukas.
>
> New patch is attached.
>
> Michal
>
>From e16ab528c95a365c9156063ae4a761a45d2c3e3f Mon Sep 17 00:00:00 2001
> From: Michal Zidek <mzidek(a)redhat.com>
> Date: Fri, 30 Jan 2015 15:48:04 +0100
> Subject: [PATCH 1/2] Use FQDN if default domain was set
>
>
https://fedorahosted.org/sssd/ticket/2569
> ---
> src/confdb/confdb.c | 35 ++++++++++++++++++++++++++++++++---
> src/util/util_errors.c | 1 +
> src/util/util_errors.h | 1 +
> 3 files changed, 34 insertions(+), 3 deletions(-)
>
> diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
> index f94de30..b1146b9 100644
> --- a/src/confdb/confdb.c
> +++ b/src/confdb/confdb.c
> @@ -768,6 +768,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
> const char *tmp;
> int ret, val;
> uint32_t entry_cache_timeout;
> + char *default_domain;
> + bool fqnames_default = false;
>
> tmp_ctx = talloc_new(mem_ctx);
> if (!tmp_ctx) return ENOMEM;
> @@ -903,11 +905,38 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
> DEBUG(SSSDBG_TRACE_FUNC, "No enumeration for [%s]!\n",
domain->name);
> }
>
> + ret = confdb_get_string(cdb, tmp_ctx, CONFDB_MONITOR_CONF_ENTRY,
> + CONFDB_MONITOR_DEFAULT_DOMAIN, NULL,
> + &default_domain);
> + if (ret != EOK) {
> + DEBUG(SSSDBG_OP_FAILURE,
> + "Cannnot get the default domain [%d]: %s\n",
> + ret, strerror(ret));
> + goto done;
> + }
> +
> /* Determine if user/group names will be Fully Qualified
> * in NSS interfaces */
> - ret = get_entry_as_bool(res->msgs[0], &domain->fqnames,
CONFDB_DOMAIN_FQ, 0);
> - if(ret != EOK) {
> - DEBUG(SSSDBG_FATAL_FAILURE, "Invalid value for %s\n",
CONFDB_DOMAIN_FQ);
> + if (default_domain != NULL) {
> + DEBUG(SSSDBG_CONF_SETTINGS,
> + "Default domain suffix set. Changing default for "
> + "use_fully_qualified_names to True.\n");
> + fqnames_default = true;
> + }
> +
> + ret = get_entry_as_bool(res->msgs[0], &domain->fqnames,
> + CONFDB_DOMAIN_FQ, fqnames_default);
> + if (ret != EOK) {
> + DEBUG(SSSDBG_FATAL_FAILURE, "Invalid value for %s\n",
> + CONFDB_DOMAIN_FQ);
> + goto done;
> + }
> +
> + if (default_domain != NULL && domain->fqnames == false) {
> + DEBUG(SSSDBG_FATAL_FAILURE,
> + "Invalid configuration detected (default_domain_suffix is used
"
> + "while use_fully_qualified_names was set to false).\n");
> + ret = ERR_INVALID_CONFIG;
The function confdb_get_domain_internal returns int. It is not big problem
because errnot_t is typdef to int, but strerror is used to transform
return code(errno) to string. It means your new error code would be be used.
LS
_______________________________________________
sssd-devel mailing list
sssd-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
Thank you Lukas.
I will not change the 'int' to 'errno_t'. We have many places
in code where we do not distinguish between the two and the
purpose of this patch is different. But I updated the
caller to use sss_strerror so that the error message is
picked up correctly.
Updated patch is attached.
Michal