hal/libhal-storage libhal-storage.c,1.9,1.10
David Zeuthen
david at freedesktop.org
Tue Jan 25 08:55:12 PST 2005
Update of /cvs/hal/hal/libhal-storage
In directory gabe:/tmp/cvs-serv21115/libhal-storage
Modified Files:
libhal-storage.c
Log Message:
2005-01-25 David Zeuthen <davidz at redhat.com>
* hald/linux2/osspec.c (osspec_probe): Add HAL_INFO's around
coldplug event synthesization so we can see how long it takes.
* hald/linux2/coldplug.c: Undefine HAL_COLDPLUG_VERBOSE by default
to reduce log spamming.
2005-01-25 David Zeuthen <davidz at redhat.com>
Merge the changes applied to the hal-0_4-stable-branch yesterday
2005-01-24 David Zeuthen <davidz at redhat.com>
* libhal-storage/libhal-storage.c (mopts_collect): Remove debugging
fprintf's
2005-01-24 David Zeuthen <davidz at redhat.com>
* libhal-storage/libhal-storage.c (mopts_collect): Also remove
mount options if something is set to FALSE (based on patch from
Sebastian Dransfeld <sebastid at stud.ntnu.no>; also fix a pretty bad
bug where the computation of is_imply_opt were totally wrong.
(hal_volume_policy_get_mount_options),
(hal_drive_policy_get_mount_options): Collect imply options in the
correct order now that mopts_collect is fixed : -do-
Index: libhal-storage.c
===================================================================
RCS file: /cvs/hal/hal/libhal-storage/libhal-storage.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- libhal-storage.c 14 Dec 2004 02:57:48 -0000 1.9
+++ libhal-storage.c 25 Jan 2005 16:55:09 -0000 1.10
@@ -1472,7 +1472,7 @@
type = hal_psi_get_type (&it);
key = hal_psi_get_key (&it);
- if (hal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN && hal_psi_get_bool (&it) &&
+ if (hal_psi_get_type (&it) == DBUS_TYPE_BOOLEAN &&
strncmp (key, namespace, namespace_len - 1) == 0) {
const char *option = key + namespace_len - 1;
char *location;
@@ -1482,9 +1482,10 @@
if (strcmp (option, "user") == 0 ||
strcmp (option, "users") == 0 ||
strcmp (option, "defaults") == 0 ||
- strcmp (option, "pamconsole"))
+ strcmp (option, "pamconsole") == 0)
is_imply_opt = TRUE;
+
if (only_collect_imply_opts) {
if (!is_imply_opt)
continue;
@@ -1493,12 +1494,28 @@
continue;
}
- /* see if option is already there */
- location = strstr (options_string, option);
- if (location == NULL) {
- if (strlen (options_string) > 0)
- strcat_len (options_string, ",", options_max_len);
- strcat_len (options_string, option, options_max_len);
+ if (hal_psi_get_bool (&it)) {
+ /* see if option is already there */
+ location = strstr (options_string, option);
+ if (location == NULL) {
+ if (strlen (options_string) > 0)
+ strcat_len (options_string, ",", options_max_len);
+ strcat_len (options_string, option, options_max_len);
+ }
+ } else {
+ /* remove option if already there */
+ location = strstr (options_string, option);
+ if (location != NULL) {
+ char *end;
+
+ end = strchr (location, ',');
+ if (end == NULL) {
+ location[0] = '\0';
+ } else {
+ strcpy (location, end + 1); /* skip the extra comma */
+ }
+ }
+
}
}
}
@@ -1518,15 +1535,15 @@
drive->mount_options[0] = '\0';
/* collect options != ('pamconsole', 'user', 'users', 'defaults' options that imply other options) */
- mopts_collect (drive->hal_ctx, stor_mount_option_begin, sizeof (stor_mount_option_begin),
- drive->udi, drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/Hal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
- /* ensure ('pamconsole', 'user', 'users', 'defaults' options that imply other options), are first */
+ "/org/freedesktop/Hal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
mopts_collect (drive->hal_ctx, stor_mount_option_begin, sizeof (stor_mount_option_begin),
drive->udi, drive->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
+ /* ensure ('pamconsole', 'user', 'users', 'defaults' options that imply other options), are first */
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/Hal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
+ "/org/freedesktop/Hal/devices/computer", drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
+ mopts_collect (drive->hal_ctx, stor_mount_option_begin, sizeof (stor_mount_option_begin),
+ drive->udi, drive->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
result = drive->mount_options;
@@ -1560,16 +1577,16 @@
result = NULL;
volume->mount_options[0] = '\0';
- /* collect options != ('pamconsole', 'user', 'users', 'defaults' options that imply other options) */
- mopts_collect (drive->hal_ctx, vol_mount_option_begin, sizeof (vol_mount_option_begin),
- volume->udi, volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
- mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/Hal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
/* ensure ('pamconsole', 'user', 'users', 'defaults' options that imply other options), are first */
+ mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
+ "/org/freedesktop/Hal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
mopts_collect (drive->hal_ctx, vol_mount_option_begin, sizeof (vol_mount_option_begin),
volume->udi, volume->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
+ /* collect options != ('pamconsole', 'user', 'users', 'defaults' options that imply other options) */
mopts_collect (drive->hal_ctx, stor_mount_option_default_begin, sizeof (stor_mount_option_default_begin),
- "/org/freedesktop/Hal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, TRUE);
+ "/org/freedesktop/Hal/devices/computer", volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
+ mopts_collect (drive->hal_ctx, vol_mount_option_begin, sizeof (vol_mount_option_begin),
+ volume->udi, volume->mount_options, MOUNT_OPTIONS_SIZE, FALSE);
result = volume->mount_options;
More information about the hal-commit
mailing list