From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Hofmann To: development@lists.ipfire.org Subject: Improve configuration file functions Date: Sat, 19 Jun 2021 15:30:00 +0200 Message-ID: <6893ae2f-6a8f-a7bc-a143-b10d0d4cbea1@leo-andres.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8299925846937432997==" List-Id: --===============8299925846937432997== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all, while working on bug #12603, I needed to improve the configuration file handl= ing functions. I soon thought that it might be a good idea to move these impo= rtant functions to a library. If you like, please have a look at the attached perl file. This library is in= tended to replace the read/writehash and read/writehasharray functions in gen= eral-functions.pl. I attempted to improve the existing functions while maintaining compatibily t= o the file formats. There are more checks to ensure that only usable data end= s up in the files and CGIs. The former "hasharray" format has been extended a= nd now supports CSV encoding. In addition, the library can be more easily tes= ted and further checks can be added. As this changes critical core functions, this library should be reviewed thor= oughly. Please let me know if this is of interest and if I should submit this= as a patch :) Best regards Leo --===============8299925846937432997== Content-Type: text/plain Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="configuration-functions.pl" MIME-Version: 1.0 IyEvdXNyL2Jpbi9wZXJsIC13DQojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjDQojICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAjDQojIFRoaXMgZmlsZSBpcyBwYXJ0IG9mIHRoZSBJUEZpcmUgRmlyZXdhbGwuICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAjDQojICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQojIElQRmlyZSBp cyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5ICAg ICAgICAgICAjDQojIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGlj IExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5ICAgICAjDQojIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5k YXRpb247IGVpdGhlciB2ZXJzaW9uIDIgb2YgdGhlIExpY2Vuc2UsIG9yICAgICAgICAjDQojIChh dCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAjDQojICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQojIElQRmlyZSBpcyBkaXN0cmli dXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCAgICAgICAgICAgICAgICAj DQojIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdh cnJhbnR5IG9mICAgICAgICAgICAjDQojIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBB IFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUgICAgICAgICAgICAjDQojIEdOVSBHZW5lcmFs IFB1YmxpYyBMaWNlbnNlIGZvciBtb3JlIGRldGFpbHMuICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAjDQojICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAjDQojIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBh IGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlICAgICAgICAjDQojIGFsb25n IHdpdGggSVBGaXJlOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlICAgICAgICAg ICAgICAgICAgICAjDQojIEZvdW5kYXRpb24sIEluYy4sIDU5IFRlbXBsZSBQbGFjZSwgU3VpdGUg MzMwLCBCb3N0b24sIE1BICAwMjExMS0xMzA3IFVTQSAjDQojICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQoj IENvcHlyaWdodCAoQykgMjAyMSBJUEZpcmUgVGVhbSA8aW5mb0BpcGZpcmUub3JnPi4gICAgICAg ICAgICAgICAgICAgICAgICAjDQojICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjDQojIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjDQoNCiMgVGhpcyBwYWNrYWdlIHByb3ZpZGVzIGZ1bmN0aW9ucyBmb3IgcmVhZGluZyBhbmQg d3JpdGluZyBjb25maWd1cmF0aW9uIGZpbGVzLg0KcGFja2FnZSBDb25maWd1cmF0aW9uOw0KDQp1 c2Ugc3RyaWN0Ow0KdXNlIFRleHQ6OkNTVl9YUzsNCnVzZSBGY250bCBxdyg6ZmxvY2spOw0KDQoj DQojIyBTdG9yZSBhIGhhc2ggYXMgYSBrZXkvdmFsdWUgbGlzdDoNCiMNCiMgJWhhc2ggPSAoImZv byIgPT4gImJhciIsIDEyMyA9PiA0NTYpOw0KIw0KIyBmb289YmFyDQojIDEyMz00NTYNCiMNCiMg V3JpdGluZyBub24gYWxwaGFudW1lcmljIGtleXMgaXMgcG9zc2libGUsIGJ1dCByZWFkaW5nIGlz IGxpbWl0ZWQgdG86ICJBLVphLXowLTlfLSIuDQojIENvbnRyb2wgY2hhcmFjdGVycyAoaS5lLiBj YXJyaWFnZSByZXR1cm4sIHRhYikgaW4gdmF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