On 07/12/2016 10:31 AM, Pavel Březina wrote:
On 07/11/2016 05:12 PM, Petr Cech wrote:
On 07/05/2016 08:44 AM, Jakub Hrozek wrote:
On Mon, Jun 27, 2016 at 03:37:25PM +0200, Petr Cech wrote:
...
+static errno_t ad_get_enabled_domains(TALLOC_CTX *mem_ctx,
struct ad_id_ctx *ad_id_ctx,
const char *ad_domain,
const char
***_ad_enabled_domains) +{
- int ret;
- const char *str;
- const char *option_name;
- char **domains = NULL;
- const char **list = NULL;
- int count;
- bool is_ad_in_domains;
- TALLOC_CTX *tmp_ctx = NULL;
- tmp_ctx = talloc_new(NULL);
- if (tmp_ctx == NULL) {
return ENOMEM;
- }
- str = dp_opt_get_cstring(ad_id_ctx->ad_options->basic,
AD_ENABLED_DOMAINS);
- if (str == NULL) {
_ad_enabled_domains = NULL;
ret = EOK;
goto done;
- }
- count = 0;
- ret = split_on_separator(tmp_ctx, str, ',', true, true,
&domains, &count);
- if (ret != EOK) {
option_name =
ad_id_ctx->ad_options->basic[AD_ENABLED_DOMAINS].opt_name;
DEBUG(SSSDBG_CRIT_FAILURE, "Failed to parse option [%s],
[%i] [%s]!\n",
option_name, ret,
sss_strerror(ret));
ret = EINVAL;
goto done;
- }
- list = talloc_array_size(tmp_ctx, sizeof(char*), count);
- if (list == NULL) {
ret = ENOMEM;
goto done;
- }
- is_ad_in_domains = false;
- for (int i = 0; i < count; i++) {
list[i] = talloc_strdup(list, domains[i]);
Do we need to duplicate the string here, wouldn't it be enough to steal it?
This is my attempt to satisfy the needs. I am trying to make: # const char** from char** I would like to return const char** because it is option. But the function split_on_separator() expects char**.
Does anybody know better solution?
You can use discard_const for this case.
Hi list,
I addressed all comments, new patch set is attached. Thanks for review and for help with discard_const(_p).
I am afraid that my patch set is not fully compatible with dp_refactor. It is not unfortunately fully tested yet. I have 'test manual' which I would like to pass before I can say work is done.
I hit issue with my local test environment (LTE) after pulling to recent master. My LTE consists of:
A (forest root) | |-- S1 (SSSD client) | |-- B (AD client) | |-- S2 (SSSD client)
S2 box is fine but S1 box has troubles... I make new S1 with new domain name, connect to A with 'sudo real join s1.domain' and I start SSSD. It crash very quickly.
Attachment data.tar.bz2 contains log and sssd.conf
Could you help me, please?
Regards...