Blob Blame History Raw
Index: src/manager.c
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/src/manager.c,v
retrieving revision 1.31
diff -u -p -r1.31 manager.c
--- src/manager.c	1 Sep 2004 19:17:41 -0000	1.31
+++ src/manager.c	20 Sep 2004 14:41:18 -0000
@@ -38,7 +38,7 @@
 # define N_(String) (String)
 #endif
 
-/*#define GVM_DEBUG*/
+#define GVM_DEBUG
 #ifdef GVM_DEBUG
 # define dbg(fmt,arg...) fprintf(stderr, "%s/%d: " fmt,__FILE__,__LINE__,##arg)
 #else
@@ -663,6 +663,16 @@ gvm_media_changed (const char *udi, cons
 		   const char *device)
 {
 	char *media_type;
+
+	/* Refuse to enforce policy on removable media if drive is locked */
+	if (hal_device_property_exists (
+		    hal_ctx, storage_device, "info.locked") &&
+	    hal_device_get_property_bool (
+		    hal_ctx, storage_device, "info.locked")) {
+		dbg ("Drive with udi %s is locked through hal; "
+		     "skipping policy\n", storage_device);
+		return;
+	}
 
 	/*
 	 * Get HAL's interpretation of our media type.  Note that we must check