lsh123 / xmlsec

XML Security Library
Other
128 stars 97 forks source link

Test script does 'rm -rf /*' on ubuntu #714

Closed blackbearman closed 8 months ago

blackbearman commented 8 months ago

When tests/testKeys.sh script is running it doesn't check the directory that he have to delete. So, rm -rf $crypto_config_folder/* turns to rm -rf /* because $crypto_config_folder is not set in this script.

It deleted all files in ~ in my case. Only good point that I pushed all commits BEFORE testing.

lsh123 commented 8 months ago

crypto_config_folder is set here:

https://github.com/lsh123/xmlsec/blob/9b0821762a32e67077dd3fd76187550aae60d3f4/tests/testrun.sh#L69

And TMPFOLDER is set here:

https://github.com/lsh123/xmlsec/blob/9b0821762a32e67077dd3fd76187550aae60d3f4/tests/testrun.sh#L28

The testKeys.sh was never intended to be run standalone:

https://github.com/lsh123/xmlsec/blob/9b0821762a32e67077dd3fd76187550aae60d3f4/tests/testKeys.sh#L3