[Pkg-privacy-commits] [libgsecuredelete] 58/168: Fix delete-operation error message on some failure scenarios

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 20:06:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch master
in repository libgsecuredelete.

commit bb51a83a401850dbdf32eb8267b0edb1db3a2c2f
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Fri Feb 26 22:55:46 2010 +0100

    Fix delete-operation error message on some failure scenarios
    
    Workaround for srm output that misses a newline on a warning message.
---
 gsecuredelete/delete-operation.vala | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gsecuredelete/delete-operation.vala b/gsecuredelete/delete-operation.vala
index 31137d3..53e8e9f 100644
--- a/gsecuredelete/delete-operation.vala
+++ b/gsecuredelete/delete-operation.vala
@@ -83,6 +83,22 @@ namespace Gsd
       }
     }
     
+    /* We override the base one to insert a hack:
+     * We add a "\n" after a special message because srm writes it on stdout
+     * rather than stderr, then we miss it. this is not easily fixable in the
+     * srm side without getting a not-so-nice output with mixed stdout and
+     * stderr.
+     * Pretty funny hack! */
+    protected override string? get_subprocess_error_msg ()
+    {
+      /* this string is very unlikely to appear somewhere we don't want to
+       * replace it, and even if it appears it is not a real problem to replace
+       * it */
+      unowned string pattern = "rename/unlink only!";
+      
+      return base.get_subprocess_error_msg ().replace (pattern, pattern + "\n");
+    }
+    
     /* Counts regular files, starting from @path.
      * Used to get the actual count of files we shall delete (and then the
      * actual final progress) because srm reports the progress for each and

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libgsecuredelete.git



More information about the Pkg-privacy-commits mailing list