diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2010-06-08 20:43:27 +0200 |
---|---|---|
committer | Arnel A. Borja <arnelborja@src.gnome.org> | 2013-08-31 00:56:44 +0800 |
commit | 840e1c8de10161c888b3d09a56ab770bff71afd7 (patch) | |
tree | e8ee8efc80d57029c4146222a028a70d6ba0ca10 | |
parent | 363b88f52cec9db8a304d9890deefa1c1d3a42e2 (diff) | |
download | libmediaart-840e1c8de10161c888b3d09a56ab770bff71afd7.tar.gz |
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
-rw-r--r-- | 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 { |