Don't accept a blank options string when adding/updating fstab entries
authorDavid Zeuthen <davidz@redhat.com>
Thu, 19 Jan 2012 18:36:22 +0000 (13:36 -0500)
committerDavid Zeuthen <davidz@redhat.com>
Thu, 19 Jan 2012 18:36:22 +0000 (13:36 -0500)
Signed-off-by: David Zeuthen <davidz@redhat.com>
src/udiskslinuxblock.c

index 24bbff0..ca4366f 100644 (file)
@@ -1051,6 +1051,15 @@ add_remove_fstab_entry (GVariant  *remove,
                        "Missing fsname, dir, type, opts, freq or passno parameter in entry to add");
           goto out;
         }
+
+      if (strlen (mntent_add.mnt_opts) == 0)
+        {
+          g_set_error (error,
+                       UDISKS_ERROR,
+                       UDISKS_ERROR_FAILED,
+                       "opts must not be blank");
+          goto out;
+        }
     }
 
   if (!g_file_get_contents ("/etc/fstab",