=================================================================== RCS file: /cvs/gnome/gnome-volume-manager/src/manager.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- manager.c 2004/09/01 19:17:41 1.31 +++ manager.c 2004/09/20 16:12:22 1.32 @@ -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 @@ -664,6 +664,16 @@ { 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 * the storage device and not this UDI