[Pkg-privacy-commits] [libgsecuredelete] 24/168: Add support for specific wiping mode.

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 20:06:34 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 36075af47301c542aa0a116fcda575512522860a
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Fri Oct 2 19:47:30 2009 +0200

    Add support for specific wiping mode.
    
    Now it is possible to specify if wiping should be done on free inodes space,
    free data space or both.
---
 gsecuredelete/fill-operation.vala | 49 +++++++++++++++++++++++++++++++++++----
 1 file changed, 45 insertions(+), 4 deletions(-)

diff --git a/gsecuredelete/fill-operation.vala b/gsecuredelete/fill-operation.vala
index 48a518e..7434089 100644
--- a/gsecuredelete/fill-operation.vala
+++ b/gsecuredelete/fill-operation.vala
@@ -21,12 +21,32 @@ namespace SecureDelete
 {
   /*
    * TODO:
-   * support -i and -I options of sfill,
-   * perhaps support -z.
+   * perhaps add support -z.
    */
   
+  /**
+   * FillOperationWipeMode:
+   * 
+   * @FULL:   wipe both free inode and data free space.
+   * @INODES: wipe only free inode space (not free data space)
+   * @DATA:   wipe only free data space (not free inode space)
+   */
+  public enum FillOperationWipeMode {
+    FULL,
+    INODES,
+    DATA
+  }
+  
   public class FillOperation : SecureDeleteOperation
   {
+    /** FillOperation:wipe_mode
+     * The wiping mode
+     */
+    public FillOperationWipeMode wipe_mode {
+      get;
+      set;
+      default = FillOperationWipeMode.FULL;
+    }
     /** FillOperation:directory:
      * The directory to fill (must of course be on the filesystem to clean).
      * I recommend you not to fill in a useful directory but inside a new and
@@ -34,13 +54,33 @@ namespace SecureDelete
      * or not, as this process may spawn a lot of files that might not be
      * deleted.
      */
-    public string directory
-    {
+    public string directory {
       get;
       set;
       default = null;
     }
     
+    /* returns the argument needed for the a wipe mode */
+    private unowned string? get_argument_for_wipe_mode (FillOperationWipeMode wipe_mode)
+    {
+      switch (wipe_mode) {
+        case FillOperationWipeMode.INODES:
+          return "-i";
+        case FillOperationWipeMode.DATA:
+          return "-I";
+      }
+      return null;
+    }
+    
+    /* adds the argument needed by the current wipe mode to an argument list */
+    protected void add_wipe_mode_argument (ref List<string> args)
+    {
+      unowned string? arg_mode = this.get_argument_for_wipe_mode (this.wipe_mode);
+      if (arg_mode != null) {
+        args.append (arg_mode);
+      }
+    }
+    
     /* builds the argument vector */
     private override List<string> build_args ()
       throws AsyncOperationError
@@ -54,6 +94,7 @@ namespace SecureDelete
       args.append ("sfill");
       args.append ("-v");
       this.add_mode_argument (ref args);
+      this.add_wipe_mode_argument (ref args);
       args.append (this.directory);
       
       return args;

-- 
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