[SSSD] [PATCH] sss_override: support fqn in override name
Pavel Březina
pbrezina at redhat.com
Wed Sep 16 10:17:10 UTC 2015
On 09/16/2015 12:07 PM, Jakub Hrozek wrote:
> On Tue, Sep 15, 2015 at 11:39:37AM +0200, Pavel Březina wrote:
>> https://fedorahosted.org/sssd/ticket/2782
>
> Thanks, this patch seems to work well. See one question inline..
>
>
>> From ce398000b0837013b4330260a3c093438a249f4a Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina at redhat.com>
>> Date: Tue, 15 Sep 2015 11:38:40 +0200
>> Subject: [PATCH] sss_override: support fqn in override name
>>
>> Resolves:
>> https://fedorahosted.org/sssd/ticket/2782
>> ---
>> src/tools/sss_override.c | 111 +++++++++++++++++++++++++++++++++++++++--------
>> 1 file changed, 93 insertions(+), 18 deletions(-)
>
> [...]
>
>> static errno_t override_user(struct sss_tool_ctx *tool_ctx,
>> - struct override_user *user)
>> + struct override_user *input_user)
>> {
>> + TALLOC_CTX *tmp_ctx;
>> + struct override_user user;
>> struct sysdb_attrs *attrs;
>> errno_t ret;
>>
>> - ret = prepare_view_msg(user->domain);
>> + tmp_ctx = talloc_new(NULL);
>> + if (tmp_ctx == NULL) {
>> + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n");
>> + return ENOMEM;
>> + }
>> +
>> + user = *input_user;
>
> Why not use:
> struct override_user *user;
> in the function? Wouldn't that allow us to keep using user-> instead of
> user. and make the diff smaller?
>
> Similar question for group.
Because I'm changing value of user->name and I do not want to propagate
this change to the caller, since it seems wrong to me.
More information about the sssd-devel
mailing list