New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ini plugin: line breaks in sections and properties #1720

Open
BernhardDenner opened this Issue Dec 9, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@BernhardDenner
Contributor

BernhardDenner commented Dec 9, 2017

Writing a section or property key with a containing newline char, breaks the ini syntax.
Possible solutions:

  • issue an error?
  • simply remove the newline char and issue a warning?

Steps to Reproduce the Problem

All steps were done in Docker with Ubuntu 16.04 based image with elektra current master (f6f7952).

kdb mount /root/test.ini system/tests/ini ini
cat > test.ini  <<EOF
> [section1]
> hello = world
> EOF

kdb ls system/tests/ini
#> system/tests/ini/section1
#> system/tests/ini/section1/hello

kdb set 'system/tests/ini/section1/property
> withnewline' hmmm
#> Create a new key system/tests/ini/section1/property
#> withnewline with string "hmmm"
cat test.ini 
#> [section1]
#> hello = world
#> property
#> withnewline = hmmm

kdb ls system/tests/ini
#> system/tests/ini/section1
#> system/tests/ini/section1/hello
#> system/tests/ini/section1/property
#> system/tests/ini/section1/withnewline

kdb set 'system/tests/ini/section          
> withnewline'     
#> Create a new key system/tests/ini/section
#> withnewline with null value

cat test.ini 
#> [section1]
#> hello = world
#> property
#> withnewline = hmmm
#> [section
#> withnewline]

kdb ls system/tests/ini
#> system/tests/ini/section
#> withnewline
#> system/tests/ini/section1
#> system/tests/ini/section1/hello
#> system/tests/ini/section1/property
#> system/tests/ini/section1/withnewline

@BernhardDenner BernhardDenner referenced this issue Dec 9, 2017

Open

bugs in storage plugins #1718

0 of 2 tasks complete

@BernhardDenner BernhardDenner changed the title from `ini` plugin: line breaks in sections and properties to ini plugin: line breaks in sections and properties Dec 9, 2017

@BernhardDenner BernhardDenner added the bug label Dec 9, 2017

@markus2330 markus2330 added this to the 0.8.21 milestone Dec 9, 2017

@markus2330

This comment has been minimized.

Show comment
Hide comment
@markus2330

markus2330 Dec 9, 2017

Contributor

Thank you for reporting and writing these test cases!

In the same way as for #1721 and #1716 (meta keys suffer the same problem) we need escaping of these characters.

Contributor

markus2330 commented Dec 9, 2017

Thank you for reporting and writing these test cases!

In the same way as for #1721 and #1716 (meta keys suffer the same problem) we need escaping of these characters.

@markus2330 markus2330 modified the milestones: 0.8.21, 0.8.22 Dec 22, 2017

@markus2330 markus2330 modified the milestones: 0.8.22, 0.8.23 Feb 24, 2018

@markus2330 markus2330 modified the milestones: 0.8.23, 0.8.24 Apr 15, 2018

@markus2330 markus2330 modified the milestones: 0.8.24, 0.8.25 Aug 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment