[SSSD] [INI] Patches for the INI configuration modification

Lukas Slebodnik lslebodn at redhat.com
Sat May 30 19:49:49 UTC 2015


On (02/01/15 14:47), Dmitri Pal wrote:
>Hello,
>
>Please find attached patches for the new interface to modify configuration
>files using libini_config.
>

Dimitri,
I was writing additional unit tests for missing parts
and I found a small problem with INI_VA_MOD and INI_VA_MODADD

The documentation says:
/**
 * @brief Update a specific value (best effort).
 *
 * Value of the index is used to determine which one of the duplicates
 * needs to be updated. Index is 0-based. If the index is out of range
 * the function will do best effort and return the last instance of the key.
 * For example if you have five duplicates and you are searching for the tenth
 * the function will find and return the fifth instance.
 */
 INI_VA_MOD        = 1,

Input config:
key0 = valuer0
key1 = value1a
key1 = value1b
key1 = value1c
key1 = value1d
key2 = value2
key3 = value3


Expected:                               Result:
[zero]                                    [zero]
[one]                                     [one]
key0 = valuer0                            key0 = valuer0
key1 = value1a                            key1 = value1a
key1 = value1b                            key1 = value1b
key1 = value1c                            key1 = value1c
key1 = newvalue <<<<<<<<<<                key1 = value1d       <<<<<<<
key2 = value2   <<<<<<<<<<                key2 = newvalue      <<<<<<<
key3 = value3                             key3 = value3


I need the second pair of eyes to look into this issue.
I will appreciate if you could find few minutes.
Attached is updated patches with check-based unit for this problem.
(ini_configmod_ut_check)

BTW. It's not clear to me waht is a difference
between INI_VA_MOD and INI_VA_MODADD
or between INI_VA_MOD_E and INI_VA_MODADD_E.
The code is the same.

LS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patches.tar.gz
Type: application/gzip
Size: 49537 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150530/0d3a952a/attachment.bin>


More information about the sssd-devel mailing list