[PATCH] udisks: fix a bug of unquoted/unescaped label string

Jiro SEKIBA jir at unicus.jp
Thu Oct 14 21:44:22 PDT 2010


This patch quotes/escapes label string for nilfs-tune.

Signed-off-by: Jiro SEKIBA <jir at unicus.jp>
---
 src/helpers/job-change-filesystem-label.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/helpers/job-change-filesystem-label.c b/src/helpers/job-change-filesystem-label.c
index bdb28c6..ec826fc 100644
--- a/src/helpers/job-change-filesystem-label.c
+++ b/src/helpers/job-change-filesystem-label.c
@@ -105,7 +105,9 @@ main (int argc,
     }
   else if (strcmp (fstype, "nilfs2") == 0)
     {
-      command_line = g_strdup_printf ("nilfs-tune -L %s \"%s\"", new_label, device);
+      if (!validate_and_escape_label (&new_label, 80))
+        goto out;
+      command_line = g_strdup_printf ("nilfs-tune -L \"%s\" %s", new_label, device);
     }
   else
     {
-- 
1.7.0.4



More information about the devkit-devel mailing list