[SSSD] [PATCHES] SYSDB ghost fix

Ondrej Kos okos at redhat.com
Mon Jan 7 14:24:36 UTC 2013


On 07/01/13 15:08, Simo Sorce wrote:
> On Mon, 2013-01-07 at 15:01 +0100, Ondrej Kos wrote:
>> tps://fedorahosted.org/sssd/ticket/1714
>>
>> The attempt to delete all ghosts for users name and aliases was
>> failing,
>> resulting into failure of whole user-add operation. In permissive
>> mode,
>> the attempts to delete non-existent entries are not interpreted as
>> error.
>
> Comments inline.
>
>> diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
>> index
>> 4bbc76c5c39501a4d878a1d41faa81919a23228f..6fb9b1d1e17f15710e3e1cff6577865525391699 100644
>> --- a/src/db/sysdb_ops.c
>> +++ b/src/db/sysdb_ops.c
>> @@ -74,6 +74,38 @@ static uint32_t get_attr_as_uint32(struct
>> ldb_message *msg, const char *attr)
>>       return l;
>>   }
>>
>> +errno_t
>> +sss_ldb_modify_permissive(struct ldb_context *ldb,
>> +               struct ldb_message *msg)
>
> Do not \n after errno_t
> Make it a static function.
> Properly align the second argument.
> You are not returing errno_t here you are returning LDB errors, so just
> use 'int'.
>
>> +{
>> +    struct ldb_request *req;
>> +    errno_t ret = EOK;
>
> 'int' not errno_t here.
>
> Whole indent one tab too much after this line.
>
>> +       ret = ldb_build_mod_req(&req, ldb, ldb,
>> +                            msg,
>> +                            NULL,
>> +                            NULL,
>> +                            ldb_op_default_callback,
>> +                            NULL);
>
> Also misaligned arguments.
>
>> +
>> +       if (ret != LDB_SUCCESS) return ret;
>> +
>> +       ret = ldb_request_add_control(req,
>> LDB_CONTROL_PERMISSIVE_MODIFY_OID, false, NULL);
>
> Split this line so iut doesn't wrap on 80 please
>
>> +       if (ret != LDB_SUCCESS) {
>> +               talloc_free(req);
>> +               return ret;
>> +       }
>
> Indent issue here too in ineer block.
>
>> +
>> +       ret = ldb_request(ldb, req);
>> +       if (ret == LDB_SUCCESS) {
>> +               ret = ldb_wait(req->handle, LDB_WAIT_ALL);
>> +       }
>
> Again indent in inner block.
>
>> +       talloc_free(req);
>> +
>> +    return ret;
>> +}
>> +
>
> Yeah copy&paste from samba code is not straightforward :-)
>
> Once you fix these issues you get an ACK.
>
> Simo.
>
Thanks for the review, the indentation looked fine in vim, however my 
script somehow misbehaved and haven't replaced tab's with spaces.

New patches are attached

Ondra

-- 
Ondrej Kos
Associate Software Engineer
Identity Management
Red Hat Czech

phone: +420-532-294-558
cell:  +420-736-417-909
ext:   82-62558
loc:   1013 Brno 1 office
irc:   okos @ #brno
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-SYSDB-Modify-ghosts-in-permissive-mode.patch
Type: text/x-patch
Size: 2113 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130107/fbaf5f36/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-SYSDB-split-sysdb_add_user.patch
Type: text/x-patch
Size: 10571 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20130107/fbaf5f36/attachment-0001.bin>


More information about the sssd-devel mailing list