libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

kdb set uses default: on cascading writes

Open markus2330 opened this issue 4 years ago • 7 comments
trafficstars

Steps to Reproduce the Problem

kdb meta-set "spec:/sw/redshift/#0/current/mode" default continual
kdb set "/sw/redshift/#0/current/mode" print
kdb get "/sw/redshift/#0/current/mode"

Expected Result

That the second command fails because the default: namespace is not writable.

Actual Result

kdb set "/sw/redshift/#0/current/mode" print
#> Set string to "print"
#> Using name default:/sw/redshift/#0/current/mode
kdb get "/sw/redshift/#0/current/mode"
#> continual

System Information

  • Elektra Version: master

Further Information

  • A similar problem will probably exist for other temporary namespaces like proc:.
  • meta-set, rm and other write commands are also affected.

@dev2718 do you have time to take a look? What behavior would you suggest?

markus2330 avatar Sep 10 '21 14:09 markus2330

@markus2330 I also noticed this today while working on #4029 and wanted to report this. But you were faster :)!

qwepoizt avatar Sep 10 '21 15:09 qwepoizt

I am a bit confused as to how to reproduce this, as kdb set spec:/sw/redshift/#0/current/mode default continual raises a syntax error (too may parameters).

dev2718 avatar Sep 20 '21 11:09 dev2718

Which shell do you use? Some shells interpret # also in the middle of words. I quoted the top-post so that the problem should not occur.

markus2330 avatar Sep 20 '21 13:09 markus2330

I use fish, but this is not the problem.

kdb set "spec:/sw/redshift/#0/current/mode" default continual

gives me

Sorry, I could not process the arguments: 2 arguments needed

caused by

https://github.com/ElektraInitiative/libelektra/blob/90fb5bef6bf2c899d8b90af90d08b99140ae6666/src/tools/kdb/set.cpp#L27-L30

dev2718 avatar Sep 20 '21 17:09 dev2718

Sorry, it should read meta-set instead of set, I updated the top description!

markus2330 avatar Sep 20 '21 17:09 markus2330

As discussed, we will disable all cascading writes.

markus2330 avatar Oct 01 '21 11:10 markus2330

@atmaxinger here is the question if you rewrite the tooling so that this bug get fixed.

markus2330 avatar Aug 06 '22 13:08 markus2330

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Aug 09 '23 01:08 github-actions[bot]

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Aug 24 '23 01:08 github-actions[bot]