~ubuntu-branches/ubuntu/hardy/dbus/hardy-proposed

« back to all changes in this revision

Viewing changes to bus/bus.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-12-03 14:02:03 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20071203140203-qumlc82ob8vphbyv
Tags: 1.1.2-1ubuntu1
* Merge with Debian unstable. Remaining Ubuntu changes:
  - devhelp integration:
    o Add debian/doxygen_to_devhelp.xsl: XSLT from Fedora to generate a
      devhelp documentation index. (Forwarded to FD#13495)
    o debian/patches/dbus-1.0.1-generate-xml-docs.patch: Enable generation
      of XML documentation (which will be turned into the devhelp index).
    o debian/rules: Build and clean the devhelp index. Add xsltproc build
      dependency for that.
    o debian/dbus-1-doc.install: Install the devhelp index, and shuffle
      files around so that devhelp finds them.
    o Add debian/dbus-1-doc.links: gtk-doc symlink.
    o Patch forwarded to Debian #454142.
  - debian/patches/80-dbus-change-at-console-policy.patch: Make at_console
    policy work with libpam-foreground. (Not forwarded upstream: this should
    go away soon when dbus gets proper ConsoleKit integration.)
  - debian/patches/81-session.conf-timeout.patch: Raise the service startup
    timeout from 25 to 60 seconds. It may be too short on the live CD with
    slow machines.
  - debian/rules: Start dbus at runlevel priority 12, so that it comes
    before gdm. This eliminates the race condition of starting the X session
    before hal is running. Also use 'multiuser' mode of update-rc.d.
  - debian/dbus.{postinst,prerm}: Do not restart dbus on upgrades, since it
    breaks too many applications. Instead, trigger a "reboot required"
    notification.
  - Upgrade transitions which need to be kept until after Hardy's release:
    o debian/dbus.postinst: Migrate rc?.d symlinks from 20 to 12 on
      upgrades.
    o debian/dbus.preinst: Remove obsolete conffile
      /etc/X11/Xsession.d/75dbus_dbus-launch.
    o debian/control: Bump dbus-x11's Conflicts/Replaces: dbus for the
      moving of dbus-launch.
* Move dbus-launch to dbus-x11 again, as in Debian. Just don't install the
  Xsession.d script in debian/rules, we do not need it in Ubuntu.
* Tag our remaining patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: C; c-file-style: "gnu" -*- */
 
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2
2
/* bus.c  message bus context object
3
3
 *
4
4
 * Copyright (C) 2003, 2004 Red Hat, Inc.
41
41
  DBusGUID uuid;
42
42
  char *config_file;
43
43
  char *type;
 
44
  char *servicehelper;
44
45
  char *address;
45
46
  char *pidfile;
46
47
  char *user;
253
254
}
254
255
 
255
256
/* This code only gets executed the first time the
256
 
   config files are parsed.  It is not executed
257
 
   when config files are reloaded.*/
 
257
 * config files are parsed.  It is not executed
 
258
 * when config files are reloaded.
 
259
 */
258
260
static dbus_bool_t
259
261
process_config_first_time_only (BusContext      *context,
260
262
                                BusConfigParser *parser,
392
394
}
393
395
 
394
396
/* This code gets executed every time the config files
395
 
   are parsed: both during BusContext construction
396
 
   and on reloads. */
 
397
 * are parsed: both during BusContext construction
 
398
 * and on reloads. This function is slightly screwy
 
399
 * since it can do a "half reload" in out-of-memory
 
400
 * situations. Realistically, unlikely to ever matter.
 
401
 */
397
402
static dbus_bool_t
398
403
process_config_every_time (BusContext      *context,
399
404
                           BusConfigParser *parser,
402
407
{
403
408
  DBusString full_address;
404
409
  DBusList *link;
 
410
  DBusList **dirs;
405
411
  BusActivation *new_activation;
406
412
  char *addr;
407
 
 
 
413
  const char *servicehelper;
 
414
  char *s;
 
415
  
408
416
  dbus_bool_t retval;
409
417
 
410
418
  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
467
475
      goto failed;
468
476
    }
469
477
 
 
478
  /* get the service directories */
 
479
  dirs = bus_config_parser_get_service_dirs (parser);
 
480
 
 
481
  /* and the service helper */
 
482
  servicehelper = bus_config_parser_get_servicehelper (parser);
 
483
 
 
484
  s = _dbus_strdup(servicehelper);
 
485
  if (s == NULL && servicehelper != NULL)
 
486
    {
 
487
      BUS_SET_OOM (error);
 
488
      goto failed;
 
489
    }
 
490
  else
 
491
    {
 
492
      dbus_free(context->servicehelper);
 
493
      context->servicehelper = s;
 
494
    }
 
495
  
470
496
  /* Create activation subsystem */
471
497
  new_activation = bus_activation_new (context, &full_address,
472
 
                                       bus_config_parser_get_service_dirs (parser),
473
 
                                       error);
 
498
                                       dirs, error);
474
499
  if (new_activation == NULL)
475
500
    {
476
501
      _DBUS_ASSERT_ERROR_IS_SET (error);
941
966
      dbus_free (context->type);
942
967
      dbus_free (context->address);
943
968
      dbus_free (context->user);
 
969
      dbus_free (context->servicehelper);
944
970
 
945
971
      if (context->pidfile)
946
972
        {
973
999
  return context->address;
974
1000
}
975
1001
 
 
1002
const char*
 
1003
bus_context_get_servicehelper (BusContext *context)
 
1004
{
 
1005
  return context->servicehelper;
 
1006
}
 
1007
 
976
1008
BusRegistry*
977
1009
bus_context_get_registry (BusContext  *context)
978
1010
{