~ubuntu-branches/ubuntu/maverick/dbus/maverick-proposed

« back to all changes in this revision

Viewing changes to bus/policy.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-27 13:06:32 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20100927130632-bqs145trvchd2lmf
Tags: 1.4.0-0ubuntu1
* New upstream release
 - Fixes https://bugs.freedesktop.org/show_bug.cgi?id=17754 Race condition in protected_change_timeout
 - Requested by various upstream KDE developers http://lists.kde.org/?t=128514970000004&r=1&w=2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *
22
22
 */
23
23
 
 
24
#include <config.h>
24
25
#include "policy.h"
25
26
#include "services.h"
26
27
#include "test.h"
168
169
 
169
170
  policy->refcount = 1;
170
171
  
171
 
  policy->rules_by_uid = _dbus_hash_table_new (DBUS_HASH_ULONG,
 
172
  policy->rules_by_uid = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
172
173
                                               NULL,
173
174
                                               free_rule_list_func);
174
175
  if (policy->rules_by_uid == NULL)
175
176
    goto failed;
176
177
 
177
 
  policy->rules_by_gid = _dbus_hash_table_new (DBUS_HASH_ULONG,
 
178
  policy->rules_by_gid = _dbus_hash_table_new (DBUS_HASH_UINTPTR,
178
179
                                               NULL,
179
180
                                               free_rule_list_func);
180
181
  if (policy->rules_by_gid == NULL)
303
304
        {
304
305
          DBusList **list;
305
306
          
306
 
          list = _dbus_hash_table_lookup_ulong (policy->rules_by_gid,
 
307
          list = _dbus_hash_table_lookup_uintptr (policy->rules_by_gid,
307
308
                                                groups[i]);
308
309
          
309
310
          if (list != NULL)
327
328
        {
328
329
          DBusList **list;
329
330
          
330
 
          list = _dbus_hash_table_lookup_ulong (policy->rules_by_uid,
 
331
          list = _dbus_hash_table_lookup_uintptr (policy->rules_by_uid,
331
332
                                                uid);
332
333
          
333
334
          if (list != NULL)
517
518
{
518
519
  DBusList **list;
519
520
 
520
 
  list = _dbus_hash_table_lookup_ulong (hash, key);
 
521
  list = _dbus_hash_table_lookup_uintptr (hash, key);
521
522
 
522
523
  if (list == NULL)
523
524
    {
525
526
      if (list == NULL)
526
527
        return NULL;
527
528
 
528
 
      if (!_dbus_hash_table_insert_ulong (hash, key, list))
 
529
      if (!_dbus_hash_table_insert_uintptr (hash, key, list))
529
530
        {
530
531
          dbus_free (list);
531
532
          return NULL;
638
639
  _dbus_hash_iter_init (to_absorb, &iter);
639
640
  while (_dbus_hash_iter_next (&iter))
640
641
    {
641
 
      unsigned long id = _dbus_hash_iter_get_ulong_key (&iter);
 
642
      unsigned long id = _dbus_hash_iter_get_uintptr_key (&iter);
642
643
      DBusList **list = _dbus_hash_iter_get_value (&iter);
643
644
      DBusList **target = get_list (dest, id);
644
645