~ubuntu-branches/ubuntu/natty/dbus/natty-201012211412

« back to all changes in this revision

Viewing changes to dbus/dbus-credentials.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-08-09 16:09:57 UTC
  • mfrom: (1.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100809160957-3xh1a1tnhxebs159
Tags: 1.2.24-3ubuntu1
* Resync on Debian
* Remaining Ubuntu Changes:
  - Install into / rather than /usr.
  - debian/control: Depend on ConsoleKit for "at_console" policy stanza.
  - debian/dbus.postinst: Do not restart dbus on upgrades, since it breaks
    too many applications. Instead, trigger a "reboot required" notification.
  - debian/dbus.postinst: Create /var/run/dbus in postinst to handle system
    being rebooted before package is configured.  LP: #275229.
  - Add debian/dbus.upstart and bump debhelper b-dep to ensure that it is
    properly installed.
  - 20_system_conf_limit.patch: Increase max_match_rules_per_connection for
    the system bus to 5000 (LP #454093)
  - 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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
502
502
      strcmp (credentials->windows_sid, other_credentials->windows_sid) == 0));
503
503
}
504
504
 
 
505
/**
 
506
 * Convert the credentials in this object to a human-readable
 
507
 * string format, and append to the given string.
 
508
 *
 
509
 * @param credentials the object
 
510
 * @param string append to this string
 
511
 * @returns #FALSE if no memory
 
512
 */
 
513
dbus_bool_t
 
514
_dbus_credentials_to_string_append (DBusCredentials    *credentials,
 
515
                                    DBusString         *string)
 
516
{
 
517
  dbus_bool_t join;
 
518
 
 
519
  join = FALSE;
 
520
  if (credentials->unix_uid != DBUS_UID_UNSET)
 
521
    {
 
522
      if (!_dbus_string_append_printf (string, "uid=" DBUS_UID_FORMAT, credentials->unix_uid))
 
523
        goto oom;
 
524
      join = TRUE;
 
525
    }
 
526
  if (credentials->unix_pid != DBUS_PID_UNSET)
 
527
    {
 
528
      if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->unix_pid))
 
529
        goto oom;
 
530
      join = TRUE;
 
531
    }
 
532
  else
 
533
    join = FALSE;
 
534
  if (credentials->windows_sid != NULL)
 
535
    {
 
536
      if (!_dbus_string_append_printf (string, "%ssid=%s", join ? " " : "", credentials->windows_sid))
 
537
        goto oom;
 
538
      join = TRUE;
 
539
    }
 
540
  else
 
541
    join = FALSE;
 
542
 
 
543
  return TRUE;
 
544
oom:
 
545
  return FALSE;
 
546
}
 
547
 
505
548
/** @} */
506
549
 
507
550
/* tests in dbus-credentials-util.c */