--- a/exo-mount/exo-mount-hal.c 2008-06-05 21:26:41.000000000 -0700 +++ b/exo-mount/exo-mount-hal.c 2008-06-06 00:47:47.000000000 -0700 @@ -666,6 +666,7 @@ exo_mount_hal_device_mount (ExoMountHalD gchar *fstype; gchar *s; gint m, n = 0; + gchar *vol_udi=NULL; g_return_val_if_fail (device != NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -676,6 +677,11 @@ exo_mount_hal_device_mount (ExoMountHalD /* check if we know any valid mount options */ if (G_LIKELY (device->fsoptions != NULL)) { + /* get the udi of the volume for later use */ + if (device->volume != NULL) { + vol_udi= vol_udi=libhal_volume_get_udi(device->volume); + } + /* use utf8 on ubuntu by default */ if (strcmp (device->fstype, "vfat") == 0 || strcmp (device->fstype, "iso9660") == 0) @@ -705,13 +711,30 @@ exo_mount_hal_device_mount (ExoMountHalD { options[n++] = g_strdup_printf ("shortname=winnt"); } - else if (strcmp (device->fsoptions[m], "sync") == 0 - && device->volume == NULL) - { - /* non-pollable drive... */ - options[n++] = g_strdup ("sync"); - } - else if (strcmp (device->fsoptions[m], "longnames") == 0 + else if (strcmp (device->fsoptions[m], "sync") == 0 && + (device->volume == NULL + || libhal_device_get_property_bool(hal_context, vol_udi, + "volume.policy.mount_option.sync", NULL))) + { + options[n++] = g_strdup ("sync"); + } + else if (strcmp (device->fsoptions[m], "noatime") == 0 && + (device->volume == NULL + || libhal_device_get_property_bool(hal_context, vol_udi, + "volume.policy.mount_option.noatime", NULL))) + { + + options[n++] = g_strdup ("noatime"); + } + else if (strcmp (device->fsoptions[m], "ro") == 0 && + (device->volume == NULL + || libhal_device_get_property_bool(hal_context, vol_udi, + "volume.policy.mount_option.noatime", NULL))) + { + + options[n++] = g_strdup ("ro"); + } + else if (strcmp (device->fsoptions[m], "longnames") == 0 && strcmp (device->fstype, "vfat") == 0) { /* however this one is FreeBSD specific */