Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
ini plugin has problems with multiline metadata #2467
Steps to Reproduce the Problem
The ini plugin does not save multiline data properly unfortunately.
Create a file with the following content
 mountpoint = LCDd-spec.conf infos/plugins = ini validation [server/driverpath] type = string check/type = string check/validation = .*[\/]$ check/validation/match = LINE check/validation/message = "The path has to contain a backslack (/) at the end" default = "server/drivers/" description = "Where can we find the driver modules ? IMPORTANT: Make sure to change this setting to reflect your specific setup! Otherwise LCDd won't be able to find the driver modules and will thus not be able to function properly. NOTE: Always place a slash as last character !"
Then mount it and set a valid path:
kdb mount /home/wespe/Desktop/tmp.ini spec/tmp ni kdb spec-mount /tmp kdb set /tmp/server/driverpath '/tmp/directory2/' #Now the error occurs because the data is saved incorrectly kdb set /tmp/server/driverpath '/tmp/directory/' #> Using name user/tmp/server/driverpath #> The command kdb set failed while accessing the key database with the info: #> Sorry, 1 warning was issued ;( #> Warning (#52): #> Description: could not type check value of key #> Ingroup: plugin #> Module: type #> At: /media/wespe/extended/repository/libelektra/src/plugins/type/type.cpp:31 #> Reason: The type string failed to match for user/tmp/server/IMPORTANT: Make sure to change this setting to reflect your with string: #> Mountpoint: user/tmp #> Configfile: /home/wespe/.config/kdb/user/LCDd-spec.conf.3875:1552046962.490367.tmp #> Sorry, the error (#42) occurred ;( #> Description: key value failed to validate #> Reason: The path has to contain a backslack (/) at the end #> Ingroup: plugin #> Module: validator #> At: /media/wespe/extended/repository/libelektra/src/plugins/validation/validation.c:148 #> Mountpoint: user/tmp #> Configfile: /home/wespe/.config/kdb/user/LCDd-spec.conf.3875:1552046962.490367.tmp
Despite a correct path, the file which contains the data has multiple lines and the ini plugins seems to also take these into account.
When I look into the file where it is saved I see the following content:
Multiline metadata are allowed
Multiline metadata cause problems
Thank you for reporting this bug!
The bug can also be reproduced if the default plugin is not ini.
I see here two problems: