[tracker/tracker-0.8] Fixes GB#621001: don't allow whitespaces in UUIDs
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] Fixes GB#621001: don't allow whitespaces in UUIDs
- Date: Thu, 17 Jun 2010 15:38:24 +0000 (UTC)
commit 6dd233404b06d2ff1f415b0fb6c0abb9f04ca16d
Author: Aleksander Morgado <aleksander lanedo com>
Date: Tue Jun 8 20:43:27 2010 +0200
Fixes GB#621001: don't allow whitespaces in UUIDs
* Using MD5 of the mount name for the UUID of optical media
* Using MD5 of the mount path for the UUID of GMounts without
a corresponding GVolume
src/libtracker-miner/tracker-storage.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-storage.c b/src/libtracker-miner/tracker-storage.c
index 18b8ad1..47c215d 100644
--- a/src/libtracker-miner/tracker-storage.c
+++ b/src/libtracker-miner/tracker-storage.c
@@ -464,7 +464,10 @@ mount_add (TrackerStorage *storage,
is_multimedia ? "yes" : "no");
if (!is_multimedia) {
- uuid = g_strdup (mount_name);
+ /* Get UUID as MD5 digest of the mount name */
+ uuid = g_compute_checksum_for_string (G_CHECKSUM_MD5,
+ mount_name,
+ -1);
is_optical = TRUE;
is_removable = TRUE;
g_debug (" Using UUID:'%s' for optical disc", uuid);
@@ -489,7 +492,10 @@ mount_add (TrackerStorage *storage,
uuid = g_mount_get_uuid (mount);
if (!uuid) {
if(mount_path) {
- uuid = g_strdup (mount_path);
+ /* Get UUID as MD5 digest of the mount path */
+ uuid = g_compute_checksum_for_string (G_CHECKSUM_MD5,
+ mount_path,
+ -1);
g_debug (" No UUID, so using:'%s' for mount without volume",
uuid);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]