-
Notifications
You must be signed in to change notification settings - Fork 136
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
Script called with -p calls rmlint for directory compare - overwrites rmlint.sh etc. despite -x flag being set #552
Comments
Related to #458: When --equal is passed, |
lib/cmdline.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/cmdline.c b/lib/cmdline.c
index 49c81627..b3b884c5 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -1060,6 +1060,10 @@ static bool rm_cmd_set_paths(RmSession *session, char **paths) {
}
static bool rm_cmd_set_outputs(RmSession *session, GError **error) {
+ if(session->cfg->run_equal_mode) {
+ return true;
+ }
+
if(session->output_cnt[0] >= 0 && session->output_cnt[1] >= 0) {
g_set_error(error, RM_ERROR_QUARK, 0,
_("Specifying both -o and -O is not allowed")); I haven't tested this patch but it should work around the issue. The correct fix would be to have dedicated option parsing for --equal, just like --is-reflink and --dedupe - I disagree with the conclusion in #483 that it is fine as-is, because although it uses the main "shredder" code, it should only allow a narrow subset of options because of its specific purpose. |
I haven't had a chance to test this yet. Just to restate in case it gets forgotten: |
Calling
sudo ./rmlint.sh -px
A directory compare takes place for example if paranoid mode is selected.
The resulting call to rmlint (the command not the script) overwrites the rmlint.sh and rmlint.json despite -x being specified
This can be a little disconcerting
The text was updated successfully, but these errors were encountered: