[nautilus/cherry-pick-807ff3d7] file-operations: Call autoar_compressor_set_passphrase conditionally




commit 02794a65ac81c19355ef6b9e887febdc1317ed51
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Jan 17 15:50:08 2022 +0100

    file-operations: Call autoar_compressor_set_passphrase conditionally
    
    The `autoar_compressor_set_passphrase` function is always called currently
    regardless the fact whether password is set, or not. Consequently, the
     "autoar_compressor_set_passphrase: assertion 'self->format == AUTOAR_FORMAT_ZIP'
    failed" critical is printed. Let's call that function only if the passphrase is
    really wanted.
    
    
    (cherry picked from commit 807ff3d77b68dd2fcd37ce488048f3c8518a3cfa)

 src/nautilus-file-operations.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 4e55e076f..5cb0128b1 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -9066,7 +9066,10 @@ compress_task_thread_func (GTask        *task,
                                         compress_job->format,
                                         compress_job->filter,
                                         FALSE);
-    autoar_compressor_set_passphrase (compressor, compress_job->passphrase);
+    if (compress_job->passphrase && compress_job->passphrase[0] != '\0')
+    {
+        autoar_compressor_set_passphrase (compressor, compress_job->passphrase);
+    }
 
     autoar_compressor_set_output_is_dest (compressor, TRUE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]