[Goodies-commits] r5216 - in thunar-volman/trunk: . thunar-volman

Brian Tarricone kelnos at xfce.org
Tue Aug 12 10:54:28 CEST 2008


Author: kelnos
Date: 2008-08-12 08:54:28 +0000 (Tue, 12 Aug 2008)
New Revision: 5216

Modified:
   thunar-volman/trunk/ChangeLog
   thunar-volman/trunk/configure.in.in
   thunar-volman/trunk/thunar-volman/Makefile.am
   thunar-volman/trunk/thunar-volman/tvm-block-device.c
Log:
2008-08-12  Brian Tarricone <bjt23 at cornell.edu>

    * thunar-volman/{Makefile.am,tvm-block-device.c}: Add support
      for auto-mounting encrypted volumes.  Patch from Colin
      Leroy.  Bug #3349.
    * configure.in.in: Bump exo-hal version requirement to ensure
      we pull in an exo-mount that can handle encrypted volumes.

Modified: thunar-volman/trunk/ChangeLog
===================================================================
--- thunar-volman/trunk/ChangeLog	2008-08-12 08:54:15 UTC (rev 5215)
+++ thunar-volman/trunk/ChangeLog	2008-08-12 08:54:28 UTC (rev 5216)
@@ -1,5 +1,13 @@
-2008-08-12  Brian Tarricone <bjt23 at cornell.edu>
+2008-08-12	Brian Tarricone <bjt23 at cornell.edu>
 
+	* thunar-volman/{Makefile.am,tvm-block-device.c}: Add support
+	  for auto-mounting encrypted volumes.  Patch from Colin
+	  Leroy.  Bug #3349.
+	* configure.in.in: Bump exo-hal version requirement to ensure
+	  we pull in an exo-mount that can handle encrypted volumes.
+
+2008-08-12	Brian Tarricone <bjt23 at cornell.edu>
+
 	* thunar-volman/*.h: Remove semicolons after G_BEGIN_DECLS/G_END_DECLS
 	  macros; they'd be harmful if compiled with a C++ compiler.
 	  Patch from Colin Leroy.  Bug #3349.

Modified: thunar-volman/trunk/configure.in.in
===================================================================
--- thunar-volman/trunk/configure.in.in	2008-08-12 08:54:15 UTC (rev 5215)
+++ thunar-volman/trunk/configure.in.in	2008-08-12 08:54:28 UTC (rev 5216)
@@ -81,7 +81,7 @@
 dnl *** Check for required packages ***
 dnl ***********************************
 XDT_CHECK_PACKAGE([DBUS], [dbus-glib-1], [0.34])
-XDT_CHECK_PACKAGE([EXO_HAL], [exo-hal-0.3], [0.3.1.13])
+XDT_CHECK_PACKAGE([EXO_HAL], [exo-hal-0.3], [0.3.7.1svn-r27445])
 XDT_CHECK_PACKAGE([HAL], [hal], [0.5.0])
 XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.5.1])
 

Modified: thunar-volman/trunk/thunar-volman/Makefile.am
===================================================================
--- thunar-volman/trunk/thunar-volman/Makefile.am	2008-08-12 08:54:15 UTC (rev 5215)
+++ thunar-volman/trunk/thunar-volman/Makefile.am	2008-08-12 08:54:28 UTC (rev 5216)
@@ -21,6 +21,8 @@
 	tvm-camera-device.h						\
 	tvm-command-entry.c						\
 	tvm-command-entry.h						\
+	tvm-crypto-volume.c						\
+	tvm-crypto-volume.h						\
 	tvm-device.c							\
 	tvm-device.h							\
 	tvm-input-device.c						\

Modified: thunar-volman/trunk/thunar-volman/tvm-block-device.c
===================================================================
--- thunar-volman/trunk/thunar-volman/tvm-block-device.c	2008-08-12 08:54:15 UTC (rev 5215)
+++ thunar-volman/trunk/thunar-volman/tvm-block-device.c	2008-08-12 08:54:28 UTC (rev 5216)
@@ -1,6 +1,6 @@
 /* $Id$ */
 /*-
- * Copyright (c) 2007 Benedikt Meurer <benny at xfce.org>.
+ * Copyright (c) 2007-2008 Benedikt Meurer <benny at xfce.org>.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -42,6 +42,7 @@
 #include <dbus/dbus-glib-lowlevel.h>
 
 #include <thunar-volman/tvm-block-device.h>
+#include <thunar-volman/tvm-crypto-volume.h>
 #include <thunar-volman/tvm-prompt.h>
 #include <thunar-volman/tvm-run.h>
 
@@ -609,6 +610,7 @@
   gboolean  autoplay;
   gboolean  is_cdrom;
   gboolean  has_filesystem;
+  gboolean  has_crypto;
   gchar    *storage_udi;
   gchar    *drive_type;
   gchar    *fsusage;
@@ -749,20 +751,30 @@
       libhal_free_string (storage_udi);
     }
 
-  /* make sure the volume has a mountable filesystem */
+  /* determine the file system usage of the volume */
   fsusage = libhal_device_get_property_string (context, udi, "volume.fsusage", NULL);
-  has_filesystem = (G_LIKELY (fsusage && strcmp (fsusage, "filesystem") == 0));
+  has_crypto = (G_UNLIKELY (fsusage != NULL && strcmp (fsusage, "crypto") == 0));
+  has_filesystem = (G_LIKELY (fsusage != NULL && strcmp (fsusage, "filesystem") == 0));
   libhal_free_string (fsusage);
-  if (G_UNLIKELY (!has_filesystem))
-    return FALSE;
 
-  /* check if we should automount drives, otherwise, we're done here */
-  g_object_get (G_OBJECT (preferences), "automount-drives", &automount, NULL);
-  if (G_UNLIKELY (!automount))
-    return FALSE;
+  /* check if we have a crypto volume to setup here */
+  if (G_UNLIKELY (has_crypto))
+    {
+      /* try to setup the crypto volume */
+      return tvm_crypto_volume_setup (preferences, context, udi, error);
+    }
+  else if (G_LIKELY (has_filesystem))
+    {
+      /* check if we should automount drives, otherwise, we're done here */
+      g_object_get (G_OBJECT (preferences), "automount-drives", &automount, NULL);
+      if (G_UNLIKELY (!automount))
+        return FALSE;
 
-  /* try to mount the block device */
-  return tvm_block_device_mount (preferences, context, udi, error);
+      /* try to mount the block device */
+      return tvm_block_device_mount (preferences, context, udi, error);
+    }
+
+  return FALSE;
 }
 
 




More information about the Goodies-commits mailing list