Description of problem ====================== rlFileBackup can corrupt user's files. If rlFileBackup * is called with --clean * and more than 2 arguments, * and DEBUG is set to 1, then part of message from rlLogDebug around line 600 of infrastructure.sh will be written to *second* of files that are to be backed up. Version-Release number of selected component ============================================ beakerlib-1.10-2.el6eso.noarch How reproducible ================ Always Steps to Reproduce ================== rlFileBackup --clean arg1 arg2 arg3 Actual results ============== A partial debug message gets written to arg2 file before backing up. Expected results ================ All three files untouched (backed up verbatim) Additional info =============== Apparently this stems from the use of '$@' in the call. In Bash, with three arguments, say, "a", "b", and "c": "foo $@ bar" is interpreted as "foo a" "b" "c bar" i.e. three arguments in case of the mentioned *rlrlLogDebug* call. Looking at *rlLogDebug* and its backend *rlLog*, the above example would mean "log 'foo a' to file 'b' with priority 'c bar'" With 2 arguments the problem is just more subtle: "log 'foo a' to file 'b bar'" that is, lost debug message and dropping debris to $PWD. Proposed fix ============ One could simply replace rhe `$@` with `$*` (which does not split the final string into arguments), but the resulting message does not seem to be a little confusing: "Adding 'a b c' to the clean list" Therefore I moved the debug message to the nearby for loop so that N messages (among others) get emitted: "Adding 'a' to the clean list" "Adding 'b' to the clean list" "Adding 'c' to the clean list" I'm including both patches, though.
Created attachment 1019807 [details] Patch, version A
Created attachment 1019808 [details] Patch, version B
Created attachment 1019810 [details] test case tarball
That's really good point. Thanks for report and patch.
fixed by https://git.fedorahosted.org/cgit/beakerlib.git/commit/?h=devel&id=00fdb2f386593e2834244a06ed4e6166da2fe38f
beakerlib-1.11-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-f36ff57e84
beakerlib-1.11-1.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update beakerlib' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-4c96e73472
beakerlib-1.11-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update beakerlib' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-ba802d1bd6
beakerlib-1.11-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update beakerlib' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-7ab9feeb42
beakerlib-1.11-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'yum --enablerepo=epel-testing update beakerlib' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-0e03df1475
This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '21'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 21 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Still relevant in FC22; in fact the fix is being tested by now.
beakerlib-1.11-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'yum --enablerepo=epel-testing update beakerlib' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-8f65d5290a
beakerlib-1.11-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'yum --enablerepo=epel-testing update beakerlib' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-f36ff57e84
beakerlib-1.11-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
beakerlib-1.11-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
beakerlib-1.11-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.
beakerlib-1.11-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.
beakerlib-1.11-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
beakerlib-1.11-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.