hal/libhal-storage libhal-storage.c,1.6,1.7

David Zeuthen david at freedesktop.org
Thu Oct 14 11:37:30 PDT 2004


Update of /cvs/hal/hal/libhal-storage
In directory gabe:/tmp/cvs-serv19112/libhal-storage

Modified Files:
	libhal-storage.c 
Log Message:
2004-10-14  David Zeuthen  <davidz at redhat.com>

	* configure.in: Add fstab-sync.8 to AC_OUTPUT
	
	* doc/conf/storage-non-fixed.fdi: New file, example

	* doc/conf/storage-skip-all.fdi: New file, example

	* doc/conf/Makefile.am: Dist and install two new .fdi files

	* fdi/90defaultpolicy/storage-policy.fdi: Fix a typo in a comment

	* hald/device_info.c:
	(my_alphasort): New function 
	(scan_fdi_files): Use my_alphasort to sort in the right order. Process
	all .fdi files instead of bailing out on the first match.

	* hald/linux/osspec.c:
	(get_selinux_removable_context): New function, copied over from 
	tools/fstab-sync.c (not currently used)
	(osspec_probe): Use get_selinux_removable_context (not currently used)

	* libhal-storage/libhal-storage.c:
	(hal_drive_policy_get_mount_options): Check if mount_option property
	is actually FALSE.
	(hal_volume_policy_get_mount_options): Same

	* libhal/libhal.c:
	(hal_free_property_set): Check if object to free is NULL and just
	return. Allows hal_free_property_set (NULL).

	* tools/Makefile.am: Add rules for building fstab-sync.8 man page

	* tools/fstab-sync.8.in: New file

	* tools/fstab-sync.c: Much rewritten to use libhal-storage and the new
	policy properties. See diff for details.



Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- libhal-storage.c	13 Oct 2004 18:50:45 -0000	1.6
+++ libhal-storage.c	14 Oct 2004 18:37:28 -0000	1.7
@@ -1468,7 +1468,8 @@
 		
 		type = hal_psi_get_type (&it);
 		key = hal_psi_get_key (&it);
-		if (strncmp (key, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin) - 1) == 0) {
+		if (hal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN && hal_psi_get_bool (&it) &&
+		    strncmp (key, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin) - 1) == 0) {
 			if (strlen (drive->mount_options) > 0)
 				strcat_len (drive->mount_options, ",", MOUNT_OPTIONS_SIZE);
 			strcat_len (drive->mount_options, key + sizeof(stor_mount_option_default_begin)-1, MOUNT_OPTIONS_SIZE);
@@ -1485,7 +1486,8 @@
 		char *key;		
 		type = hal_psi_get_type (&it);
 		key = hal_psi_get_key (&it);
-		if (strncmp (key, stor_mount_option_begin, sizeof (stor_mount_option_begin) - 1) == 0) {
+		if (hal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN && hal_psi_get_bool (&it) &&
+		    strncmp (key, stor_mount_option_begin, sizeof (stor_mount_option_begin) - 1) == 0) {
 			if (strlen (drive->mount_options) > 0)
 				strcat_len (drive->mount_options, ",", MOUNT_OPTIONS_SIZE);
 			strcat_len (drive->mount_options, key + sizeof (stor_mount_option_begin)-1, MOUNT_OPTIONS_SIZE);
@@ -1538,7 +1540,8 @@
 		
 		type = hal_psi_get_type (&it);
 		key = hal_psi_get_key (&it);
-		if (strncmp (key, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin) - 1) == 0) {
+		if (hal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN && hal_psi_get_bool (&it) &&
+		    strncmp (key, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin) - 1) == 0) {
 			if (strlen (volume->mount_options) > 0)
 				strcat_len (volume->mount_options, ",", MOUNT_OPTIONS_SIZE);
 			strcat_len (volume->mount_options, key + sizeof(stor_mount_option_default_begin)-1, MOUNT_OPTIONS_SIZE);
@@ -1555,7 +1558,8 @@
 		char *key;		
 		type = hal_psi_get_type (&it);
 		key = hal_psi_get_key (&it);
-		if (strncmp (key, vol_mount_option_begin, sizeof (vol_mount_option_begin) - 1) == 0) {
+		if (hal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN && hal_psi_get_bool (&it) &&
+		    strncmp (key, vol_mount_option_begin, sizeof (vol_mount_option_begin) - 1) == 0) {
 			if (strlen (volume->mount_options) > 0)
 				strcat_len (volume->mount_options, ",", MOUNT_OPTIONS_SIZE);
 			strcat_len (volume->mount_options, key + sizeof (vol_mount_option_begin)-1, MOUNT_OPTIONS_SIZE);




More information about the hal-commit mailing list