Coverage report for bus/config-parser.c.gcov

        -:    0:Source:config-parser.c
        -:    0:Graph:config-parser.gcno
        -:    0:Data:config-parser.gcda
        -:    0:Runs:10120
        -:    0:Programs:2
        -:    1:/* -*- mode: C; c-file-style: "gnu" -*- */
        -:    2:/* config-parser.c  XML-library-agnostic configuration file parser
        -:    3: *
        -:    4: * Copyright (C) 2003, 2004 Red Hat, Inc.
        -:    5: *
        -:    6: * Licensed under the Academic Free License version 2.1
        -:    7: *
        -:    8: * This program is free software; you can redistribute it and/or modify
        -:    9: * it under the terms of the GNU General Public License as published by
        -:   10: * the Free Software Foundation; either version 2 of the License, or
        -:   11: * (at your option) any later version.
        -:   12: *
        -:   13: * This program is distributed in the hope that it will be useful,
        -:   14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
        -:   15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        -:   16: * GNU General Public License for more details.
        -:   17: *
        -:   18: * You should have received a copy of the GNU General Public License
        -:   19: * along with this program; if not, write to the Free Software
        -:   20: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
        -:   21: *
        -:   22: */
        -:   23:#include "config-parser.h"
        -:   24:#include "test.h"
        -:   25:#include "utils.h"
        -:   26:#include "policy.h"
        -:   27:#include "selinux.h"
        -:   28:#include <dbus/dbus-list.h>
        -:   29:#include <dbus/dbus-internals.h>
        -:   30:#include <string.h>
        -:   31:
        -:   32:typedef enum
        -:   33:{
        -:   34:  ELEMENT_NONE,
        -:   35:  ELEMENT_BUSCONFIG,
        -:   36:  ELEMENT_INCLUDE,
        -:   37:  ELEMENT_USER,
        -:   38:  ELEMENT_LISTEN,
        -:   39:  ELEMENT_AUTH,
        -:   40:  ELEMENT_POLICY,
        -:   41:  ELEMENT_LIMIT,
        -:   42:  ELEMENT_ALLOW,
        -:   43:  ELEMENT_DENY,
        -:   44:  ELEMENT_FORK,
        -:   45:  ELEMENT_PIDFILE,
        -:   46:  ELEMENT_SERVICEDIR,
        -:   47:  ELEMENT_INCLUDEDIR,
        -:   48:  ELEMENT_TYPE,
        -:   49:  ELEMENT_SELINUX,
        -:   50:  ELEMENT_ASSOCIATE
        -:   51:} ElementType;
        -:   52:
        -:   53:typedef enum
        -:   54:{
        -:   55:  /* we ignore policies for unknown groups/users */
        -:   56:  POLICY_IGNORED,
        -:   57:
        -:   58:  /* non-ignored */
        -:   59:  POLICY_DEFAULT,
        -:   60:  POLICY_MANDATORY,
        -:   61:  POLICY_USER,
        -:   62:  POLICY_GROUP,
        -:   63:  POLICY_CONSOLE
        -:   64:} PolicyType;
        -:   65:
        -:   66:typedef struct
        -:   67:{
        -:   68:  ElementType type;
        -:   69:
        -:   70:  unsigned int had_content : 1;
        -:   71:
        -:   72:  union
        -:   73:  {
        -:   74:    struct
        -:   75:    {
        -:   76:      unsigned int ignore_missing : 1;
        -:   77:      unsigned int if_selinux_enabled : 1;
        -:   78:      unsigned int selinux_root_relative : 1;
        -:   79:    } include;
        -:   80:
        -:   81:    struct
        -:   82:    {
        -:   83:      PolicyType type;
        -:   84:      unsigned long gid_uid_or_at_console;      
        -:   85:    } policy;
        -:   86:
        -:   87:    struct
        -:   88:    {
        -:   89:      char *name;
        -:   90:      long value;
        -:   91:    } limit;
        -:   92:    
        -:   93:  } d;
        -:   94:
        -:   95:} Element;
        -:   96:
        -:   97:/**
        -:   98: * Parser for bus configuration file. 
        -:   99: */
        -:  100:struct BusConfigParser
        -:  101:{
        -:  102:  int refcount;        /**< Reference count */
        -:  103:
        -:  104:  DBusString basedir;  /**< Directory we resolve paths relative to */
        -:  105:  
        -:  106:  DBusList *stack;     /**< stack of Element */
        -:  107:
        -:  108:  char *user;          /**< user to run as */
        -:  109:
        -:  110:  char *bus_type;          /**< Message bus type */
        -:  111:  
        -:  112:  DBusList *listen_on; /**< List of addresses to listen to */
        -:  113:
        -:  114:  DBusList *mechanisms; /**< Auth mechanisms */
        -:  115:
        -:  116:  DBusList *service_dirs; /**< Directories to look for services in */
        -:  117:
        -:  118:  DBusList *conf_dirs;   /**< Directories to look for policy configuration in */
        -:  119:
        -:  120:  BusPolicy *policy;     /**< Security policy */
        -:  121:
        -:  122:  BusLimits limits;      /**< Limits */
        -:  123:
        -:  124:  char *pidfile;         /**< PID file */
        -:  125:
        -:  126:  DBusList *included_files;  /**< Included files stack */
        -:  127:
        -:  128:  DBusHashTable *service_context_table; /**< Map service names to SELinux contexts */
        -:  129:
        -:  130:  unsigned int fork : 1; /**< TRUE to fork into daemon mode */
        -:  131:
        -:  132:  unsigned int is_toplevel : 1; /**< FALSE if we are a sub-config-file inside another one */
        -:  133:};
        -:  134:
        -:  135:static const char*
        -:  136:element_type_to_name (ElementType type)
function element_type_to_name called 252 returned 100% blocks executed 90%
      252:  137:{
      252:  138:  switch (type)
branch  0 taken 0%
branch  1 taken 7%
branch  2 taken 5%
branch  3 taken 7%
branch  4 taken 18%
branch  5 taken 1%
branch  6 taken 7%
branch  7 taken 16%
branch  8 taken 18%
branch  9 taken 9%
branch 10 taken 1%
branch 11 taken 1%
branch 12 taken 5%
branch 13 taken 3%
branch 14 taken 1%
branch 15 taken 1%
branch 16 taken 1%
branch 17 taken 0%
        -:  139:    {
        -:  140:    case ELEMENT_NONE:
    #####:  141:      return NULL;
        -:  142:    case ELEMENT_BUSCONFIG:
       17:  143:      return "busconfig";
        -:  144:    case ELEMENT_INCLUDE:
       13:  145:      return "include";
        -:  146:    case ELEMENT_USER:
       18:  147:      return "user";
        -:  148:    case ELEMENT_LISTEN:
       45:  149:      return "listen";
        -:  150:    case ELEMENT_AUTH:
        3:  151:      return "auth";
        -:  152:    case ELEMENT_POLICY:
       17:  153:      return "policy";
        -:  154:    case ELEMENT_LIMIT:
       41:  155:      return "limit";
        -:  156:    case ELEMENT_ALLOW:
       46:  157:      return "allow";
        -:  158:    case ELEMENT_DENY:
       23:  159:      return "deny";
        -:  160:    case ELEMENT_FORK:
        1:  161:      return "fork";
        -:  162:    case ELEMENT_PIDFILE:
        1:  163:      return "pidfile";
        -:  164:    case ELEMENT_SERVICEDIR:
       13:  165:      return "servicedir";
        -:  166:    case ELEMENT_INCLUDEDIR:
        8:  167:      return "includedir";
        -:  168:    case ELEMENT_TYPE:
        3:  169:      return "type";
        -:  170:    case ELEMENT_SELINUX:
        1:  171:      return "selinux";
        -:  172:    case ELEMENT_ASSOCIATE:
        2:  173:      return "associate";
        -:  174:    }
        -:  175:
    #####:  176:  _dbus_assert_not_reached ("bad element type");
call    0 never executed
        -:  177:
        -:  178:  return NULL;
        -:  179:}
        -:  180:
        -:  181:static Element*
        -:  182:push_element (BusConfigParser *parser,
        -:  183:              ElementType      type)
function push_element called 290 returned 100% blocks executed 70%
      290:  184:{
        -:  185:  Element *e;
        -:  186:
      290:  187:  _dbus_assert (type != ELEMENT_NONE);
call    0 returned 100%
        -:  188:  
      290:  189:  e = dbus_new0 (Element, 1);
call    0 returned 100%
      290:  190:  if (e == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  191:    return NULL;
        -:  192:
      290:  193:  if (!_dbus_list_append (&parser->stack, e))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  194:    {
    #####:  195:      dbus_free (e);
call    0 never executed
    #####:  196:      return NULL;
        -:  197:    }
        -:  198:  
      290:  199:  e->type = type;
        -:  200:
      290:  201:  return e;
        -:  202:}
        -:  203:
        -:  204:static void
        -:  205:element_free (Element *e)
function element_free called 290 returned 100% blocks executed 100%
      290:  206:{
      290:  207:  if (e->type == ELEMENT_LIMIT)
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
       41:  208:    dbus_free (e->d.limit.name);
call    0 returned 100%
        -:  209:  
      290:  210:  dbus_free (e);
call    0 returned 100%
      290:  211:}
        -:  212:
        -:  213:static void
        -:  214:pop_element (BusConfigParser *parser)
function pop_element called 290 returned 100% blocks executed 100%
      290:  215:{
        -:  216:  Element *e;
        -:  217:
      290:  218:  e = _dbus_list_pop_last (&parser->stack);
call    0 returned 100%
        -:  219:  
      290:  220:  element_free (e);
call    0 returned 100%
      290:  221:}
        -:  222:
        -:  223:static Element*
        -:  224:peek_element (BusConfigParser *parser)
function peek_element called 773 returned 100% blocks executed 100%
      773:  225:{
        -:  226:  Element *e;
        -:  227:
      773:  228:  e = _dbus_list_get_last (&parser->stack);
call    0 returned 100%
        -:  229:
      773:  230:  return e;
        -:  231:}
        -:  232:
        -:  233:static ElementType
        -:  234:top_element_type (BusConfigParser *parser)
function top_element_type called 994 returned 100% blocks executed 100%
      994:  235:{
        -:  236:  Element *e;
        -:  237:
      994:  238:  e = _dbus_list_get_last (&parser->stack);
call    0 returned 100%
        -:  239:
      994:  240:  if (e)
branch  0 taken 96% (fallthrough)
branch  1 taken 4%
      958:  241:    return e->type;
        -:  242:  else
       36:  243:    return ELEMENT_NONE;
        -:  244:}
        -:  245:
        -:  246:static dbus_bool_t
        -:  247:merge_service_context_hash (DBusHashTable *dest,
        -:  248:			    DBusHashTable *from)
function merge_service_context_hash called 3 returned 100% blocks executed 35%
        3:  249:{
        -:  250:  DBusHashIter iter;
        -:  251:  
        3:  252:  _dbus_hash_iter_init (from, &iter);
call    0 returned 100%
        3:  253:  while (_dbus_hash_iter_next (&iter))
call    0 returned 100%
branch  1 taken 0%
branch  2 taken 100% (fallthrough)
        -:  254:    {
    #####:  255:      const char *service = _dbus_hash_iter_get_string_key (&iter);
call    0 never executed
    #####:  256:      const char *context = _dbus_hash_iter_get_value (&iter);
call    0 never executed
        -:  257:      char *service_copy;
        -:  258:      char *context_copy;
        -:  259:
    #####:  260:      service_copy = _dbus_strdup (service);
call    0 never executed
    #####:  261:      if (service_copy == NULL)
branch  0 never executed
branch  1 never executed
    #####:  262:        return FALSE;
    #####:  263:      context_copy = _dbus_strdup (context);
call    0 never executed
    #####:  264:      if (context_copy == NULL)
branch  0 never executed
branch  1 never executed
    #####:  265:        return FALSE;
        -:  266:      
    #####:  267:      if (!_dbus_hash_table_insert_string (dest, service_copy, context_copy))
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####:  268:	return FALSE;
        -:  269:    }
        -:  270:
        3:  271:  return TRUE;
        -:  272:}
        -:  273:
        -:  274:static dbus_bool_t
        -:  275:merge_included (BusConfigParser *parser,
        -:  276:                BusConfigParser *included,
        -:  277:                DBusError       *error)
function merge_included called 3 returned 100% blocks executed 73%
        3:  278:{
        -:  279:  DBusList *link;
        -:  280:
        3:  281:  if (!bus_policy_merge (parser->policy,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  282:                         included->policy))
        -:  283:    {
    #####:  284:      BUS_SET_OOM (error);
call    0 never executed
    #####:  285:      return FALSE;
        -:  286:    }
        -:  287:
        3:  288:  if (!merge_service_context_hash (parser->service_context_table,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  289:				   included->service_context_table))
        -:  290:    {
    #####:  291:      BUS_SET_OOM (error);
call    0 never executed
    #####:  292:      return FALSE;
        -:  293:    }
        -:  294:  
        3:  295:  if (included->user != NULL)
branch  0 taken 67% (fallthrough)
branch  1 taken 33%
        -:  296:    {
        2:  297:      dbus_free (parser->user);
call    0 returned 100%
        2:  298:      parser->user = included->user;
        2:  299:      included->user = NULL;
        -:  300:    }
        -:  301:
        3:  302:  if (included->bus_type != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  303:    {
    #####:  304:      dbus_free (parser->bus_type);
call    0 never executed
    #####:  305:      parser->bus_type = included->bus_type;
    #####:  306:      included->bus_type = NULL;
        -:  307:    }
        -:  308:  
        3:  309:  if (included->fork)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  310:    parser->fork = TRUE;
        -:  311:
        3:  312:  if (included->pidfile != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  313:    {
    #####:  314:      dbus_free (parser->pidfile);
call    0 never executed
    #####:  315:      parser->pidfile = included->pidfile;
    #####:  316:      included->pidfile = NULL;
        -:  317:    }
        -:  318:  
       10:  319:  while ((link = _dbus_list_pop_first_link (&included->listen_on)))
call    0 returned 100%
branch  1 taken 57%
branch  2 taken 43% (fallthrough)
        4:  320:    _dbus_list_append_link (&parser->listen_on, link);
call    0 returned 100%
        -:  321:
        6:  322:  while ((link = _dbus_list_pop_first_link (&included->mechanisms)))
call    0 returned 100%
branch  1 taken 0%
branch  2 taken 100% (fallthrough)
    #####:  323:    _dbus_list_append_link (&parser->mechanisms, link);
call    0 never executed
        -:  324:
        8:  325:  while ((link = _dbus_list_pop_first_link (&included->service_dirs)))
call    0 returned 100%
branch  1 taken 40%
branch  2 taken 60% (fallthrough)
        2:  326:    _dbus_list_append_link (&parser->service_dirs, link);
call    0 returned 100%
        -:  327:
        8:  328:  while ((link = _dbus_list_pop_first_link (&included->conf_dirs)))
call    0 returned 100%
branch  1 taken 40%
branch  2 taken 60% (fallthrough)
        2:  329:    _dbus_list_append_link (&parser->conf_dirs, link);
call    0 returned 100%
        -:  330:  
        3:  331:  return TRUE;
        -:  332:}
        -:  333:
        -:  334:static dbus_bool_t
        -:  335:seen_include (BusConfigParser  *parser,
        -:  336:	      const DBusString *file)
function seen_include called 27 returned 100% blocks executed 92%
       27:  337:{
        -:  338:  DBusList *iter;
        -:  339:
       27:  340:  iter = parser->included_files;
       60:  341:  while (iter != NULL)
branch  0 taken 27%
branch  1 taken 73% (fallthrough)
        -:  342:    {
        9:  343:      if (! strcmp (_dbus_string_get_const_data (file), iter->data))
call    0 returned 100%
call    1 returned 100%
branch  2 taken 33% (fallthrough)
branch  3 taken 67%
        3:  344:	return TRUE;
        -:  345:
        6:  346:      iter = _dbus_list_get_next_link (&parser->included_files, iter);
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  347:    }
        -:  348:
       24:  349:  return FALSE;
        -:  350:}
        -:  351:
        -:  352:BusConfigParser*
        -:  353:bus_config_parser_new (const DBusString      *basedir,
        -:  354:                       dbus_bool_t            is_toplevel,
        -:  355:                       const BusConfigParser *parent)
function bus_config_parser_new called 45 returned 100% blocks executed 65%
       45:  356:{
        -:  357:  BusConfigParser *parser;
        -:  358:
       45:  359:  parser = dbus_new0 (BusConfigParser, 1);
call    0 returned 100%
       45:  360:  if (parser == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  361:    return NULL;
        -:  362:
       45:  363:  parser->is_toplevel = !!is_toplevel;
        -:  364:  
       45:  365:  if (!_dbus_string_init (&parser->basedir))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  366:    {
    #####:  367:      dbus_free (parser);
call    0 never executed
    #####:  368:      return NULL;
        -:  369:    }
        -:  370:
       45:  371:  if (((parser->policy = bus_policy_new ()) == NULL) ||
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
call    3 returned 100%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
call    6 returned 100%
branch  7 taken 0% (fallthrough)
branch  8 taken 100%
        -:  372:      !_dbus_string_copy (basedir, 0, &parser->basedir, 0) ||
        -:  373:      ((parser->service_context_table = _dbus_hash_table_new (DBUS_HASH_STRING,
        -:  374:							      dbus_free,
        -:  375:							      dbus_free)) == NULL))
        -:  376:    {
    #####:  377:      if (parser->policy)
branch  0 never executed
branch  1 never executed
    #####:  378:        bus_policy_unref (parser->policy);
call    0 never executed
        -:  379:      
    #####:  380:      _dbus_string_free (&parser->basedir);
call    0 never executed
        -:  381:
    #####:  382:      dbus_free (parser);
call    0 never executed
    #####:  383:      return NULL;
        -:  384:    }
        -:  385:
       45:  386:  if (parent != NULL)
branch  0 taken 53% (fallthrough)
branch  1 taken 47%
        -:  387:    {
        -:  388:      /* Initialize the parser's limits from the parent. */
       24:  389:      parser->limits = parent->limits;
        -:  390:
        -:  391:      /* Use the parent's list of included_files to avoid
        -:  392:	 circular inclusions. */
       24:  393:      parser->included_files = parent->included_files;
        -:  394:    }
        -:  395:  else
        -:  396:    {
        -:  397:
        -:  398:      /* Make up some numbers! woot! */
       21:  399:      parser->limits.max_incoming_bytes = _DBUS_ONE_MEGABYTE * 63;
       21:  400:      parser->limits.max_outgoing_bytes = _DBUS_ONE_MEGABYTE * 63;
       21:  401:      parser->limits.max_message_size = _DBUS_ONE_MEGABYTE * 32;
        -:  402:      
        -:  403:      /* Making this long means the user has to wait longer for an error
        -:  404:       * message if something screws up, but making it too short means
        -:  405:       * they might see a false failure.
        -:  406:       */
       21:  407:      parser->limits.activation_timeout = 25000; /* 25 seconds */
        -:  408:
        -:  409:      /* Making this long risks making a DOS attack easier, but too short
        -:  410:       * and legitimate auth will fail.  If interactive auth (ask user for
        -:  411:       * password) is allowed, then potentially it has to be quite long.
        -:  412:       */
       21:  413:      parser->limits.auth_timeout = 30000; /* 30 seconds */
        -:  414:      
       21:  415:      parser->limits.max_incomplete_connections = 32;
       21:  416:      parser->limits.max_connections_per_user = 128;
        -:  417:      
        -:  418:      /* Note that max_completed_connections / max_connections_per_user
        -:  419:       * is the number of users that would have to work together to
        -:  420:       * DOS all the other users.
        -:  421:       */
       21:  422:      parser->limits.max_completed_connections = 1024;
        -:  423:      
       21:  424:      parser->limits.max_pending_activations = 256;
       21:  425:      parser->limits.max_services_per_connection = 256;
        -:  426:      
       21:  427:      parser->limits.max_match_rules_per_connection = 512;
        -:  428:      
       21:  429:      parser->limits.reply_timeout = 5 * 60 * 1000; /* 5 minutes */
       21:  430:      parser->limits.max_replies_per_connection = 32;
        -:  431:    }
        -:  432:      
       45:  433:  parser->refcount = 1;
        -:  434:      
       45:  435:  return parser;
        -:  436:}
        -:  437:
        -:  438:BusConfigParser *
        -:  439:bus_config_parser_ref (BusConfigParser *parser)
function bus_config_parser_ref called 0 returned 0% blocks executed 0%
    #####:  440:{
    #####:  441:  _dbus_assert (parser->refcount > 0);
call    0 never executed
        -:  442:
    #####:  443:  parser->refcount += 1;
        -:  444:
    #####:  445:  return parser;
        -:  446:}
        -:  447:
        -:  448:void
        -:  449:bus_config_parser_unref (BusConfigParser *parser)
function bus_config_parser_unref called 45 returned 100% blocks executed 100%
       45:  450:{
       45:  451:  _dbus_assert (parser->refcount > 0);
call    0 returned 100%
        -:  452:
       45:  453:  parser->refcount -= 1;
        -:  454:
       45:  455:  if (parser->refcount == 0)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        -:  456:    {
      128:  457:      while (parser->stack != NULL)
branch  0 taken 46%
branch  1 taken 54% (fallthrough)
       38:  458:        pop_element (parser);
call    0 returned 100%
        -:  459:
       45:  460:      dbus_free (parser->user);
call    0 returned 100%
       45:  461:      dbus_free (parser->bus_type);
call    0 returned 100%
       45:  462:      dbus_free (parser->pidfile);
call    0 returned 100%
        -:  463:      
       45:  464:      _dbus_list_foreach (&parser->listen_on,
call    0 returned 100%
        -:  465:                          (DBusForeachFunction) dbus_free,
        -:  466:                          NULL);
        -:  467:
       45:  468:      _dbus_list_clear (&parser->listen_on);
call    0 returned 100%
        -:  469:
       45:  470:      _dbus_list_foreach (&parser->service_dirs,
call    0 returned 100%
        -:  471:                          (DBusForeachFunction) dbus_free,
        -:  472:                          NULL);
        -:  473:
       45:  474:      _dbus_list_clear (&parser->service_dirs);
call    0 returned 100%
        -:  475:
       45:  476:      _dbus_list_foreach (&parser->conf_dirs,
call    0 returned 100%
        -:  477:                          (DBusForeachFunction) dbus_free,
        -:  478:                          NULL);
        -:  479:
       45:  480:      _dbus_list_clear (&parser->conf_dirs);
call    0 returned 100%
        -:  481:
       45:  482:      _dbus_list_foreach (&parser->mechanisms,
call    0 returned 100%
        -:  483:                          (DBusForeachFunction) dbus_free,
        -:  484:                          NULL);
        -:  485:
       45:  486:      _dbus_list_clear (&parser->mechanisms);
call    0 returned 100%
        -:  487:      
       45:  488:      _dbus_string_free (&parser->basedir);
call    0 returned 100%
        -:  489:
       45:  490:      if (parser->policy)
branch  0 taken 93% (fallthrough)
branch  1 taken 7%
       42:  491:        bus_policy_unref (parser->policy);
call    0 returned 100%
        -:  492:
       45:  493:      if (parser->service_context_table)
branch  0 taken 93% (fallthrough)
branch  1 taken 7%
       42:  494:        _dbus_hash_table_unref (parser->service_context_table);
call    0 returned 100%
        -:  495:      
       45:  496:      dbus_free (parser);
call    0 returned 100%
        -:  497:    }
       45:  498:}
        -:  499:
        -:  500:dbus_bool_t
        -:  501:bus_config_parser_check_doctype (BusConfigParser   *parser,
        -:  502:                                 const char        *doctype,
        -:  503:                                 DBusError         *error)
function bus_config_parser_check_doctype called 0 returned 0% blocks executed 0%
    #####:  504:{
    #####:  505:  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
branch  0 never executed
branch  1 never executed
call    2 never executed
branch  3 never executed
branch  4 never executed
call    5 never executed
        -:  506:
    #####:  507:  if (strcmp (doctype, "busconfig") != 0)
call    0 never executed
branch  1 never executed
branch  2 never executed
        -:  508:    {
    #####:  509:      dbus_set_error (error,
call    0 never executed
        -:  510:                      DBUS_ERROR_FAILED,
        -:  511:                      "Configuration file has the wrong document type %s",
        -:  512:                      doctype);
    #####:  513:      return FALSE;
        -:  514:    }
        -:  515:  else
    #####:  516:    return TRUE;
        -:  517:}
        -:  518:
        -:  519:typedef struct
        -:  520:{
        -:  521:  const char  *name;
        -:  522:  const char **retloc;
        -:  523:} LocateAttr;
        -:  524:
        -:  525:static dbus_bool_t
        -:  526:locate_attributes (BusConfigParser  *parser,
        -:  527:                   const char       *element_name,
        -:  528:                   const char      **attribute_names,
        -:  529:                   const char      **attribute_values,
        -:  530:                   DBusError        *error,
        -:  531:                   const char       *first_attribute_name,
        -:  532:                   const char      **first_attribute_retloc,
        -:  533:                   ...)
function locate_attributes called 150 returned 100% blocks executed 78%
      150:  534:{
        -:  535:  va_list args;
        -:  536:  const char *name;
        -:  537:  const char **retloc;
        -:  538:  int n_attrs;
        -:  539:#define MAX_ATTRS 24
        -:  540:  LocateAttr attrs[MAX_ATTRS];
        -:  541:  dbus_bool_t retval;
        -:  542:  int i;
        -:  543:
      150:  544:  _dbus_assert (first_attribute_name != NULL);
call    0 returned 100%
      150:  545:  _dbus_assert (first_attribute_retloc != NULL);
call    0 returned 100%
        -:  546:
      150:  547:  retval = TRUE;
        -:  548:
      150:  549:  n_attrs = 1;
      150:  550:  attrs[0].name = first_attribute_name;
      150:  551:  attrs[0].retloc = first_attribute_retloc;
      150:  552:  *first_attribute_retloc = NULL;
        -:  553:
      150:  554:  va_start (args, first_attribute_retloc);
call    0 returned 100%
        -:  555:
      150:  556:  name = va_arg (args, const char*);
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
      150:  557:  retloc = va_arg (args, const char**);
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  558:
     1568:  559:  while (name != NULL)
branch  0 taken 89%
branch  1 taken 11% (fallthrough)
        -:  560:    {
     1268:  561:      _dbus_assert (retloc != NULL);
call    0 returned 100%
     1268:  562:      _dbus_assert (n_attrs < MAX_ATTRS);
call    0 returned 100%
        -:  563:
     1268:  564:      attrs[n_attrs].name = name;
     1268:  565:      attrs[n_attrs].retloc = retloc;
     1268:  566:      n_attrs += 1;
     1268:  567:      *retloc = NULL;
        -:  568:
     1268:  569:      name = va_arg (args, const char*);
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
     1268:  570:      retloc = va_arg (args, const char**);
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  571:    }
        -:  572:
      150:  573:  va_end (args);
call    0 returned 100%
        -:  574:
      150:  575:  if (!retval)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####:  576:    return retval;
        -:  577:
      150:  578:  i = 0;
      457:  579:  while (attribute_names[i])
branch  0 taken 51%
branch  1 taken 49% (fallthrough)
        -:  580:    {
        -:  581:      int j;
        -:  582:      dbus_bool_t found;
        -:  583:      
      157:  584:      found = FALSE;
      157:  585:      j = 0;
     1946:  586:      while (j < n_attrs)
branch  0 taken 91%
branch  1 taken 9% (fallthrough)
        -:  587:        {
     1632:  588:          if (strcmp (attrs[j].name, attribute_names[i]) == 0)
call    0 returned 100%
branch  1 taken 10% (fallthrough)
branch  2 taken 90%
        -:  589:            {
      157:  590:              retloc = attrs[j].retloc;
        -:  591:
      157:  592:              if (*retloc != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  593:                {
    #####:  594:                  dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  595:                                  "Attribute \"%s\" repeated twice on the same <%s> element",
        -:  596:                                  attrs[j].name, element_name);
    #####:  597:                  retval = FALSE;
    #####:  598:                  goto out;
        -:  599:                }
        -:  600:
      157:  601:              *retloc = attribute_values[i];
      157:  602:              found = TRUE;
        -:  603:            }
        -:  604:
     1632:  605:          ++j;
        -:  606:        }
        -:  607:
      157:  608:      if (!found)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  609:        {
    #####:  610:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  611:                          "Attribute \"%s\" is invalid on <%s> element in this context",
        -:  612:                          attribute_names[i], element_name);
    #####:  613:          retval = FALSE;
    #####:  614:          goto out;
        -:  615:        }
        -:  616:
      157:  617:      ++i;
        -:  618:    }
        -:  619:
      150:  620: out:
      150:  621:  return retval;
        -:  622:}
        -:  623:
        -:  624:static dbus_bool_t
        -:  625:check_no_attributes (BusConfigParser  *parser,
        -:  626:                     const char       *element_name,
        -:  627:                     const char      **attribute_names,
        -:  628:                     const char      **attribute_values,
        -:  629:                     DBusError        *error)
function check_no_attributes called 140 returned 100% blocks executed 60%
      140:  630:{
      140:  631:  if (attribute_names[0] != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  632:    {
    #####:  633:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  634:                      "Attribute \"%s\" is invalid on <%s> element in this context",
        -:  635:                      attribute_names[0], element_name);
    #####:  636:      return FALSE;
        -:  637:    }
        -:  638:
      140:  639:  return TRUE;
        -:  640:}
        -:  641:
        -:  642:static dbus_bool_t
        -:  643:start_busconfig_child (BusConfigParser   *parser,
        -:  644:                       const char        *element_name,
        -:  645:                       const char       **attribute_names,
        -:  646:                       const char       **attribute_values,
        -:  647:                       DBusError         *error)
function start_busconfig_child called 183 returned 100% blocks executed 61%
      183:  648:{
      183:  649:  if (strcmp (element_name, "user") == 0)
call    0 returned 100%
branch  1 taken 10% (fallthrough)
branch  2 taken 90%
        -:  650:    {
       19:  651:      if (!check_no_attributes (parser, "user", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  652:        return FALSE;
        -:  653:
       19:  654:      if (push_element (parser, ELEMENT_USER) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  655:        {
    #####:  656:          BUS_SET_OOM (error);
call    0 never executed
    #####:  657:          return FALSE;
        -:  658:        }
        -:  659:
       19:  660:      return TRUE;
        -:  661:    }
      164:  662:  else if (strcmp (element_name, "type") == 0)
call    0 returned 100%
branch  1 taken 2% (fallthrough)
branch  2 taken 98%
        -:  663:    {
        3:  664:      if (!check_no_attributes (parser, "type", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  665:        return FALSE;
        -:  666:
        3:  667:      if (push_element (parser, ELEMENT_TYPE) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  668:        {
    #####:  669:          BUS_SET_OOM (error);
call    0 never executed
    #####:  670:          return FALSE;
        -:  671:        }
        -:  672:
        3:  673:      return TRUE;
        -:  674:    }
      161:  675:  else if (strcmp (element_name, "fork") == 0)
call    0 returned 100%
branch  1 taken 1% (fallthrough)
branch  2 taken 99%
        -:  676:    {
        1:  677:      if (!check_no_attributes (parser, "fork", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  678:        return FALSE;
        -:  679:
        1:  680:      if (push_element (parser, ELEMENT_FORK) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  681:        {
    #####:  682:          BUS_SET_OOM (error);
call    0 never executed
    #####:  683:          return FALSE;
        -:  684:        }
        -:  685:
        1:  686:      parser->fork = TRUE;
        -:  687:      
        1:  688:      return TRUE;
        -:  689:    }
      160:  690:  else if (strcmp (element_name, "pidfile") == 0)
call    0 returned 100%
branch  1 taken 1% (fallthrough)
branch  2 taken 99%
        -:  691:    {
        1:  692:      if (!check_no_attributes (parser, "pidfile", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  693:        return FALSE;
        -:  694:
        1:  695:      if (push_element (parser, ELEMENT_PIDFILE) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  696:        {
    #####:  697:          BUS_SET_OOM (error);
call    0 never executed
    #####:  698:          return FALSE;
        -:  699:        }
        -:  700:
        1:  701:      return TRUE;
        -:  702:    }
      159:  703:  else if (strcmp (element_name, "listen") == 0)
call    0 returned 100%
branch  1 taken 28% (fallthrough)
branch  2 taken 72%
        -:  704:    {
       45:  705:      if (!check_no_attributes (parser, "listen", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  706:        return FALSE;
        -:  707:
       45:  708:      if (push_element (parser, ELEMENT_LISTEN) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  709:        {
    #####:  710:          BUS_SET_OOM (error);
call    0 never executed
    #####:  711:          return FALSE;
        -:  712:        }
        -:  713:
       45:  714:      return TRUE;
        -:  715:    }
      114:  716:  else if (strcmp (element_name, "auth") == 0)
call    0 returned 100%
branch  1 taken 3% (fallthrough)
branch  2 taken 97%
        -:  717:    {
        3:  718:      if (!check_no_attributes (parser, "auth", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  719:        return FALSE;
        -:  720:
        3:  721:      if (push_element (parser, ELEMENT_AUTH) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  722:        {
    #####:  723:          BUS_SET_OOM (error);
call    0 never executed
    #####:  724:          return FALSE;
        -:  725:        }
        -:  726:      
        3:  727:      return TRUE;
        -:  728:    }
      111:  729:  else if (strcmp (element_name, "includedir") == 0)
call    0 returned 100%
branch  1 taken 16% (fallthrough)
branch  2 taken 84%
        -:  730:    {
       18:  731:      if (!check_no_attributes (parser, "includedir", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  732:        return FALSE;
        -:  733:
       18:  734:      if (push_element (parser, ELEMENT_INCLUDEDIR) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  735:        {
    #####:  736:          BUS_SET_OOM (error);
call    0 never executed
    #####:  737:          return FALSE;
        -:  738:        }
        -:  739:
       18:  740:      return TRUE;
        -:  741:    }
       93:  742:  else if (strcmp (element_name, "servicedir") == 0)
call    0 returned 100%
branch  1 taken 14% (fallthrough)
branch  2 taken 86%
        -:  743:    {
       13:  744:      if (!check_no_attributes (parser, "servicedir", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  745:        return FALSE;
        -:  746:
       13:  747:      if (push_element (parser, ELEMENT_SERVICEDIR) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  748:        {
    #####:  749:          BUS_SET_OOM (error);
call    0 never executed
    #####:  750:          return FALSE;
        -:  751:        }
        -:  752:
       13:  753:      return TRUE;
        -:  754:    }
       80:  755:  else if (strcmp (element_name, "include") == 0)
call    0 returned 100%
branch  1 taken 26% (fallthrough)
branch  2 taken 74%
        -:  756:    {
        -:  757:      Element *e;
        -:  758:      const char *if_selinux_enabled;
        -:  759:      const char *ignore_missing;
        -:  760:      const char *selinux_root_relative;
        -:  761:
       21:  762:      if ((e = push_element (parser, ELEMENT_INCLUDE)) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  763:        {
    #####:  764:          BUS_SET_OOM (error);
call    0 never executed
    #####:  765:          return FALSE;
        -:  766:        }
        -:  767:
       21:  768:      e->d.include.ignore_missing = FALSE;
       21:  769:      e->d.include.if_selinux_enabled = FALSE;
       21:  770:      e->d.include.selinux_root_relative = FALSE;
        -:  771:
       21:  772:      if (!locate_attributes (parser, "include",
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  773:                              attribute_names,
        -:  774:                              attribute_values,
        -:  775:                              error,
        -:  776:                              "ignore_missing", &ignore_missing,
        -:  777:                              "if_selinux_enabled", &if_selinux_enabled,
        -:  778:                              "selinux_root_relative", &selinux_root_relative,
        -:  779:                              NULL))
    #####:  780:        return FALSE;
        -:  781:
       21:  782:      if (ignore_missing != NULL)
branch  0 taken 43% (fallthrough)
branch  1 taken 57%
        -:  783:        {
        9:  784:          if (strcmp (ignore_missing, "yes") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        9:  785:            e->d.include.ignore_missing = TRUE;
    #####:  786:          else if (strcmp (ignore_missing, "no") == 0)
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####:  787:            e->d.include.ignore_missing = FALSE;
        -:  788:          else
        -:  789:            {
    #####:  790:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  791:                              "ignore_missing attribute must have value \"yes\" or \"no\"");
    #####:  792:              return FALSE;
        -:  793:            }
        -:  794:        }
        -:  795:
       21:  796:      if (if_selinux_enabled != NULL)
branch  0 taken 10% (fallthrough)
branch  1 taken 90%
        -:  797:        {
        2:  798:          if (strcmp (if_selinux_enabled, "yes") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        2:  799:            e->d.include.if_selinux_enabled = TRUE;
    #####:  800:          else if (strcmp (if_selinux_enabled, "no") == 0)
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####:  801:            e->d.include.if_selinux_enabled = FALSE;
        -:  802:          else
        -:  803:            {
    #####:  804:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  805:                              "if_selinux_enabled attribute must have value"
        -:  806:                              " \"yes\" or \"no\"");
    #####:  807:              return FALSE;
        -:  808:	    }
        -:  809:        }
        -:  810:      
       21:  811:      if (selinux_root_relative != NULL)
branch  0 taken 10% (fallthrough)
branch  1 taken 90%
        -:  812:        {
        2:  813:          if (strcmp (selinux_root_relative, "yes") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        2:  814:            e->d.include.selinux_root_relative = TRUE;
    #####:  815:          else if (strcmp (selinux_root_relative, "no") == 0)
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####:  816:            e->d.include.selinux_root_relative = FALSE;
        -:  817:          else
        -:  818:            {
    #####:  819:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  820:                              "selinux_root_relative attribute must have value"
        -:  821:                              " \"yes\" or \"no\"");
    #####:  822:              return FALSE;
        -:  823:	    }
        -:  824:        }
        -:  825:
       21:  826:      return TRUE;
        -:  827:    }
       59:  828:  else if (strcmp (element_name, "policy") == 0)
call    0 returned 100%
branch  1 taken 29% (fallthrough)
branch  2 taken 71%
        -:  829:    {
        -:  830:      Element *e;
        -:  831:      const char *context;
        -:  832:      const char *user;
        -:  833:      const char *group;
        -:  834:      const char *at_console;
        -:  835:
       17:  836:      if ((e = push_element (parser, ELEMENT_POLICY)) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  837:        {
    #####:  838:          BUS_SET_OOM (error);
call    0 never executed
    #####:  839:          return FALSE;
        -:  840:        }
        -:  841:
       17:  842:      e->d.policy.type = POLICY_IGNORED;
        -:  843:      
       17:  844:      if (!locate_attributes (parser, "policy",
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  845:                              attribute_names,
        -:  846:                              attribute_values,
        -:  847:                              error,
        -:  848:                              "context", &context,
        -:  849:                              "user", &user,
        -:  850:                              "group", &group,
        -:  851:                              "at_console", &at_console,
        -:  852:                              NULL))
    #####:  853:        return FALSE;
        -:  854:
       17:  855:      if (((context && user) ||
branch  0 taken 94% (fallthrough)
branch  1 taken 6%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
branch  4 taken 94% (fallthrough)
branch  5 taken 6%
branch  6 taken 100% (fallthrough)
branch  7 taken 0%
branch  8 taken 94% (fallthrough)
branch  9 taken 6%
branch 10 taken 100% (fallthrough)
branch 11 taken 0%
branch 12 taken 6% (fallthrough)
branch 13 taken 94%
branch 14 taken 100% (fallthrough)
branch 15 taken 0%
branch 16 taken 6% (fallthrough)
branch 17 taken 94%
branch 18 taken 100% (fallthrough)
branch 19 taken 0%
branch 20 taken 0% (fallthrough)
branch 21 taken 100%
branch 22 never executed
branch 23 never executed
branch 24 taken 6% (fallthrough)
branch 25 taken 94%
branch 26 taken 0% (fallthrough)
branch 27 taken 100%
branch 28 never executed
branch 29 never executed
branch 30 never executed
branch 31 never executed
        -:  856:           (context && group) ||
        -:  857:           (context && at_console)) ||
        -:  858:           ((user && group) ||
        -:  859:           (user && at_console)) ||
        -:  860:           (group && at_console) ||
        -:  861:          !(context || user || group || at_console))
        -:  862:        {
    #####:  863:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  864:                          "<policy> element must have exactly one of (context|user|group|at_console) attributes");
    #####:  865:          return FALSE;
        -:  866:        }
        -:  867:
       17:  868:      if (context != NULL)
branch  0 taken 94% (fallthrough)
branch  1 taken 6%
        -:  869:        {
       16:  870:          if (strcmp (context, "default") == 0)
call    0 returned 100%
branch  1 taken 94% (fallthrough)
branch  2 taken 6%
        -:  871:            {
       15:  872:              e->d.policy.type = POLICY_DEFAULT;
        -:  873:            }
        1:  874:          else if (strcmp (context, "mandatory") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -:  875:            {
        1:  876:              e->d.policy.type = POLICY_MANDATORY;
        -:  877:            }
        -:  878:          else
        -:  879:            {
    #####:  880:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  881:                              "context attribute on <policy> must have the value \"default\" or \"mandatory\", not \"%s\"",
        -:  882:                              context);
    #####:  883:              return FALSE;
        -:  884:            }
        -:  885:        }
        1:  886:      else if (user != NULL)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        -:  887:        {
        -:  888:          DBusString username;
        1:  889:          _dbus_string_init_const (&username, user);
call    0 returned 100%
        -:  890:
        1:  891:          if (_dbus_get_user_id (&username,
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -:  892:                                 &e->d.policy.gid_uid_or_at_console))
        1:  893:            e->d.policy.type = POLICY_USER;
        -:  894:          else
    #####:  895:            _dbus_warn ("Unknown username \"%s\" in message bus configuration file\n",
call    0 never executed
        -:  896:                        user);
        -:  897:        }
    #####:  898:      else if (group != NULL)
branch  0 never executed
branch  1 never executed
        -:  899:        {
        -:  900:          DBusString group_name;
    #####:  901:          _dbus_string_init_const (&group_name, group);
call    0 never executed
        -:  902:
    #####:  903:          if (_dbus_get_group_id (&group_name,
call    0 never executed
branch  1 never executed
branch  2 never executed
        -:  904:                                  &e->d.policy.gid_uid_or_at_console))
    #####:  905:            e->d.policy.type = POLICY_GROUP;
        -:  906:          else
    #####:  907:            _dbus_warn ("Unknown group \"%s\" in message bus configuration file\n",
call    0 never executed
        -:  908:                        group);          
        -:  909:        }
    #####:  910:      else if (at_console != NULL)
branch  0 never executed
branch  1 never executed
        -:  911:        {
        -:  912:           dbus_bool_t t;
    #####:  913:           t = (strcmp (at_console, "true") == 0);
call    0 never executed
    #####:  914:           if (t || strcmp (at_console, "false") == 0)
branch  0 never executed
branch  1 never executed
call    2 never executed
branch  3 never executed
branch  4 never executed
        -:  915:             {
    #####:  916:               e->d.policy.gid_uid_or_at_console = t; 
    #####:  917:               e->d.policy.type = POLICY_CONSOLE;
        -:  918:             }  
        -:  919:           else
        -:  920:             {
    #####:  921:               dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  922:                              "Unknown value \"%s\" for at_console in message bus configuration file",
        -:  923:                              at_console);
        -:  924:
    #####:  925:               return FALSE;
        -:  926:             }
        -:  927:        }
        -:  928:      else
        -:  929:        {
    #####:  930:          _dbus_assert_not_reached ("all <policy> attributes null and we didn't set error");
call    0 never executed
        -:  931:        }
        -:  932:      
       17:  933:      return TRUE;
        -:  934:    }
       42:  935:  else if (strcmp (element_name, "limit") == 0)
call    0 returned 100%
branch  1 taken 98% (fallthrough)
branch  2 taken 2%
        -:  936:    {
        -:  937:      Element *e;
        -:  938:      const char *name;
        -:  939:
       41:  940:      if ((e = push_element (parser, ELEMENT_LIMIT)) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  941:        {
    #####:  942:          BUS_SET_OOM (error);
call    0 never executed
    #####:  943:          return FALSE;
        -:  944:        }
        -:  945:      
       41:  946:      if (!locate_attributes (parser, "limit",
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  947:                              attribute_names,
        -:  948:                              attribute_values,
        -:  949:                              error,
        -:  950:                              "name", &name,
        -:  951:                              NULL))
    #####:  952:        return FALSE;
        -:  953:
       41:  954:      if (name == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  955:        {
    #####:  956:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  957:                          "<limit> element must have a \"name\" attribute");
    #####:  958:          return FALSE;
        -:  959:        }
        -:  960:
       41:  961:      e->d.limit.name = _dbus_strdup (name);
call    0 returned 100%
       41:  962:      if (e->d.limit.name == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -:  963:        {
    #####:  964:          BUS_SET_OOM (error);
call    0 never executed
    #####:  965:          return FALSE;
        -:  966:        }
        -:  967:
       41:  968:      return TRUE;
        -:  969:    }
        1:  970:  else if (strcmp (element_name, "selinux") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -:  971:    {
        1:  972:      if (!check_no_attributes (parser, "selinux", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####:  973:        return FALSE;
        -:  974:
        1:  975:      if (push_element (parser, ELEMENT_SELINUX) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -:  976:        {
    #####:  977:          BUS_SET_OOM (error);
call    0 never executed
    #####:  978:          return FALSE;
        -:  979:        }
        -:  980:
        1:  981:      return TRUE;
        -:  982:    }
        -:  983:  else
        -:  984:    {
    #####:  985:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -:  986:                      "Element <%s> not allowed inside <%s> in configuration file",
        -:  987:                      element_name, "busconfig");
    #####:  988:      return FALSE;
        -:  989:    }
        -:  990:}
        -:  991:
        -:  992:static dbus_bool_t
        -:  993:append_rule_from_element (BusConfigParser   *parser,
        -:  994:                          const char        *element_name,
        -:  995:                          const char       **attribute_names,
        -:  996:                          const char       **attribute_values,
        -:  997:                          dbus_bool_t        allow,
        -:  998:                          DBusError         *error)
function append_rule_from_element called 69 returned 100% blocks executed 75%
       69:  999:{
        -: 1000:  const char *send_interface;
        -: 1001:  const char *send_member;
        -: 1002:  const char *send_error;
        -: 1003:  const char *send_destination;
        -: 1004:  const char *send_path;
        -: 1005:  const char *send_type;
        -: 1006:  const char *receive_interface;
        -: 1007:  const char *receive_member;
        -: 1008:  const char *receive_error;
        -: 1009:  const char *receive_sender;
        -: 1010:  const char *receive_path;
        -: 1011:  const char *receive_type;
        -: 1012:  const char *eavesdrop;
        -: 1013:  const char *send_requested_reply;
        -: 1014:  const char *receive_requested_reply;
        -: 1015:  const char *own;
        -: 1016:  const char *user;
        -: 1017:  const char *group;
        -: 1018:
        -: 1019:  BusPolicyRule *rule;
        -: 1020:  
       69: 1021:  if (!locate_attributes (parser, element_name,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1022:                          attribute_names,
        -: 1023:                          attribute_values,
        -: 1024:                          error,
        -: 1025:                          "send_interface", &send_interface,
        -: 1026:                          "send_member", &send_member,
        -: 1027:                          "send_error", &send_error,
        -: 1028:                          "send_destination", &send_destination,
        -: 1029:                          "send_path", &send_path,
        -: 1030:                          "send_type", &send_type,
        -: 1031:                          "receive_interface", &receive_interface,
        -: 1032:                          "receive_member", &receive_member,
        -: 1033:                          "receive_error", &receive_error,
        -: 1034:                          "receive_sender", &receive_sender,
        -: 1035:                          "receive_path", &receive_path,
        -: 1036:                          "receive_type", &receive_type,
        -: 1037:                          "eavesdrop", &eavesdrop,
        -: 1038:                          "send_requested_reply", &send_requested_reply,
        -: 1039:                          "receive_requested_reply", &receive_requested_reply,
        -: 1040:                          "own", &own,
        -: 1041:                          "user", &user,
        -: 1042:                          "group", &group,
        -: 1043:                          NULL))
    #####: 1044:    return FALSE;
        -: 1045:
       69: 1046:  if (!(send_interface || send_member || send_error || send_destination ||
branch  0 taken 83% (fallthrough)
branch  1 taken 17%
branch  2 taken 96% (fallthrough)
branch  3 taken 4%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
branch  6 taken 91% (fallthrough)
branch  7 taken 9%
branch  8 taken 84% (fallthrough)
branch  9 taken 16%
branch 10 taken 100% (fallthrough)
branch 11 taken 0%
branch 12 taken 81% (fallthrough)
branch 13 taken 19%
branch 14 taken 100% (fallthrough)
branch 15 taken 0%
branch 16 taken 100% (fallthrough)
branch 17 taken 0%
branch 18 taken 91% (fallthrough)
branch 19 taken 9%
branch 20 taken 100% (fallthrough)
branch 21 taken 0%
branch 22 taken 100% (fallthrough)
branch 23 taken 0%
branch 24 taken 94% (fallthrough)
branch 25 taken 6%
branch 26 taken 97% (fallthrough)
branch 27 taken 3%
branch 28 taken 96% (fallthrough)
branch 29 taken 4%
branch 30 taken 63% (fallthrough)
branch 31 taken 37%
branch 32 taken 12% (fallthrough)
branch 33 taken 88%
branch 34 taken 0% (fallthrough)
branch 35 taken 100%
        -: 1047:        send_type || send_path ||
        -: 1048:        receive_interface || receive_member || receive_error || receive_sender ||
        -: 1049:        receive_type || receive_path || eavesdrop ||
        -: 1050:        send_requested_reply || receive_requested_reply ||
        -: 1051:        own || user || group))
        -: 1052:    {
    #####: 1053:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1054:                      "Element <%s> must have one or more attributes",
        -: 1055:                      element_name);
    #####: 1056:      return FALSE;
        -: 1057:    }
        -: 1058:
       69: 1059:  if ((send_member && (send_interface == NULL && send_path == NULL)) ||
branch  0 taken 6% (fallthrough)
branch  1 taken 94%
branch  2 taken 50% (fallthrough)
branch  3 taken 50%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
branch  6 taken 3% (fallthrough)
branch  7 taken 97%
branch  8 taken 0% (fallthrough)
branch  9 taken 100%
branch 10 never executed
branch 11 never executed
        -: 1060:      (receive_member && (receive_interface == NULL && receive_path == NULL)))
        -: 1061:    {
    #####: 1062:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1063:                      "On element <%s>, if you specify a member you must specify an interface or a path. Keep in mind that not all messages have an interface field.",
        -: 1064:                      element_name);
    #####: 1065:      return FALSE;
        -: 1066:    }
        -: 1067:  
        -: 1068:  /* Allowed combinations of elements are:
        -: 1069:   *
        -: 1070:   *   base, must be all send or all receive:
        -: 1071:   *     nothing
        -: 1072:   *     interface
        -: 1073:   *     interface + member
        -: 1074:   *     error
        -: 1075:   * 
        -: 1076:   *   base send_ can combine with send_destination, send_path, send_type, send_requested_reply
        -: 1077:   *   base receive_ with receive_sender, receive_path, receive_type, receive_requested_reply, eavesdrop
        -: 1078:   *
        -: 1079:   *   user, group, own must occur alone
        -: 1080:   *
        -: 1081:   * Pretty sure the below stuff is broken, FIXME think about it more.
        -: 1082:   */
        -: 1083:
       69: 1084:  if (((send_interface && send_error) ||
branch  0 taken 17% (fallthrough)
branch  1 taken 83%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
branch  4 taken 17% (fallthrough)
branch  5 taken 83%
branch  6 taken 100% (fallthrough)
branch  7 taken 0%
branch  8 taken 17% (fallthrough)
branch  9 taken 83%
branch 10 taken 100% (fallthrough)
branch 11 taken 0%
branch 12 taken 17% (fallthrough)
branch 13 taken 83%
branch 14 taken 100% (fallthrough)
branch 15 taken 0%
branch 16 taken 17% (fallthrough)
branch 17 taken 83%
branch 18 taken 100% (fallthrough)
branch 19 taken 0%
branch 20 taken 17% (fallthrough)
branch 21 taken 83%
branch 22 taken 100% (fallthrough)
branch 23 taken 0%
branch 24 taken 17% (fallthrough)
branch 25 taken 83%
branch 26 taken 100% (fallthrough)
branch 27 taken 0%
branch 28 taken 17% (fallthrough)
branch 29 taken 83%
branch 30 taken 100% (fallthrough)
branch 31 taken 0%
branch 32 taken 17% (fallthrough)
branch 33 taken 83%
branch 34 taken 100% (fallthrough)
branch 35 taken 0%
branch 36 taken 17% (fallthrough)
branch 37 taken 83%
branch 38 taken 100% (fallthrough)
branch 39 taken 0%
branch 40 taken 6% (fallthrough)
branch 41 taken 94%
branch 42 taken 100% (fallthrough)
branch 43 taken 0%
branch 44 taken 6% (fallthrough)
branch 45 taken 94%
branch 46 taken 100% (fallthrough)
branch 47 taken 0%
branch 48 taken 6% (fallthrough)
branch 49 taken 94%
branch 50 taken 100% (fallthrough)
branch 51 taken 0%
branch 52 taken 6% (fallthrough)
branch 53 taken 94%
branch 54 taken 100% (fallthrough)
branch 55 taken 0%
branch 56 taken 6% (fallthrough)
branch 57 taken 94%
branch 58 taken 100% (fallthrough)
branch 59 taken 0%
branch 60 taken 6% (fallthrough)
branch 61 taken 94%
branch 62 taken 100% (fallthrough)
branch 63 taken 0%
branch 64 taken 6% (fallthrough)
branch 65 taken 94%
branch 66 taken 100% (fallthrough)
branch 67 taken 0%
branch 68 taken 6% (fallthrough)
branch 69 taken 94%
branch 70 taken 100% (fallthrough)
branch 71 taken 0%
branch 72 taken 6% (fallthrough)
branch 73 taken 94%
branch 74 taken 100% (fallthrough)
branch 75 taken 0%
branch 76 taken 6% (fallthrough)
branch 77 taken 94%
branch 78 taken 100% (fallthrough)
branch 79 taken 0%
branch 80 taken 0% (fallthrough)
branch 81 taken 100%
branch 82 never executed
branch 83 never executed
branch 84 taken 0% (fallthrough)
branch 85 taken 100%
branch 86 never executed
branch 87 never executed
branch 88 taken 0% (fallthrough)
branch 89 taken 100%
branch 90 never executed
branch 91 never executed
branch 92 taken 0% (fallthrough)
branch 93 taken 100%
branch 94 never executed
branch 95 never executed
branch 96 taken 0% (fallthrough)
branch 97 taken 100%
branch 98 never executed
branch 99 never executed
branch 100 taken 0% (fallthrough)
branch 101 taken 100%
branch 102 never executed
branch 103 never executed
branch 104 taken 0% (fallthrough)
branch 105 taken 100%
branch 106 never executed
branch 107 never executed
branch 108 taken 0% (fallthrough)
branch 109 taken 100%
branch 110 never executed
branch 111 never executed
branch 112 taken 0% (fallthrough)
branch 113 taken 100%
branch 114 never executed
branch 115 never executed
branch 116 taken 13% (fallthrough)
branch 117 taken 87%
branch 118 taken 100% (fallthrough)
branch 119 taken 0%
branch 120 taken 13% (fallthrough)
branch 121 taken 87%
branch 122 taken 100% (fallthrough)
branch 123 taken 0%
branch 124 taken 13% (fallthrough)
branch 125 taken 87%
branch 126 taken 100% (fallthrough)
branch 127 taken 0%
branch 128 taken 13% (fallthrough)
branch 129 taken 87%
branch 130 taken 100% (fallthrough)
branch 131 taken 0%
branch 132 taken 13% (fallthrough)
branch 133 taken 87%
branch 134 taken 100% (fallthrough)
branch 135 taken 0%
branch 136 taken 13% (fallthrough)
branch 137 taken 87%
branch 138 taken 100% (fallthrough)
branch 139 taken 0%
branch 140 taken 13% (fallthrough)
branch 141 taken 87%
branch 142 taken 100% (fallthrough)
branch 143 taken 0%
branch 144 taken 13% (fallthrough)
branch 145 taken 87%
branch 146 taken 100% (fallthrough)
branch 147 taken 0%
branch 148 taken 13% (fallthrough)
branch 149 taken 87%
branch 150 taken 100% (fallthrough)
branch 151 taken 0%
branch 152 taken 14% (fallthrough)
branch 153 taken 86%
branch 154 taken 100% (fallthrough)
branch 155 taken 0%
branch 156 taken 14% (fallthrough)
branch 157 taken 86%
branch 158 taken 100% (fallthrough)
branch 159 taken 0%
branch 160 taken 14% (fallthrough)
branch 161 taken 86%
branch 162 taken 100% (fallthrough)
branch 163 taken 0%
branch 164 taken 14% (fallthrough)
branch 165 taken 86%
branch 166 taken 100% (fallthrough)
branch 167 taken 0%
branch 168 taken 14% (fallthrough)
branch 169 taken 86%
branch 170 taken 100% (fallthrough)
branch 171 taken 0%
branch 172 taken 14% (fallthrough)
branch 173 taken 86%
branch 174 taken 100% (fallthrough)
branch 175 taken 0%
branch 176 taken 14% (fallthrough)
branch 177 taken 86%
branch 178 taken 100% (fallthrough)
branch 179 taken 0%
branch 180 taken 14% (fallthrough)
branch 181 taken 86%
branch 182 taken 100% (fallthrough)
branch 183 taken 0%
branch 184 taken 14% (fallthrough)
branch 185 taken 86%
branch 186 taken 100% (fallthrough)
branch 187 taken 0%
branch 188 taken 3% (fallthrough)
branch 189 taken 97%
branch 190 taken 100% (fallthrough)
branch 191 taken 0%
branch 192 taken 3% (fallthrough)
branch 193 taken 97%
branch 194 taken 100% (fallthrough)
branch 195 taken 0%
branch 196 taken 3% (fallthrough)
branch 197 taken 97%
branch 198 taken 100% (fallthrough)
branch 199 taken 0%
branch 200 taken 3% (fallthrough)
branch 201 taken 97%
branch 202 taken 100% (fallthrough)
branch 203 taken 0%
branch 204 taken 3% (fallthrough)
branch 205 taken 97%
branch 206 taken 100% (fallthrough)
branch 207 taken 0%
branch 208 taken 3% (fallthrough)
branch 209 taken 97%
branch 210 taken 100% (fallthrough)
branch 211 taken 0%
branch 212 taken 3% (fallthrough)
branch 213 taken 97%
branch 214 taken 100% (fallthrough)
branch 215 taken 0%
branch 216 taken 3% (fallthrough)
branch 217 taken 97%
branch 218 taken 100% (fallthrough)
branch 219 taken 0%
branch 220 taken 3% (fallthrough)
branch 221 taken 97%
branch 222 taken 100% (fallthrough)
branch 223 taken 0%
branch 224 taken 1% (fallthrough)
branch 225 taken 99%
branch 226 taken 100% (fallthrough)
branch 227 taken 0%
branch 228 taken 1% (fallthrough)
branch 229 taken 99%
branch 230 taken 100% (fallthrough)
branch 231 taken 0%
branch 232 taken 1% (fallthrough)
branch 233 taken 99%
branch 234 taken 100% (fallthrough)
branch 235 taken 0%
branch 236 taken 1% (fallthrough)
branch 237 taken 99%
branch 238 taken 100% (fallthrough)
branch 239 taken 0%
branch 240 taken 1% (fallthrough)
branch 241 taken 99%
branch 242 taken 100% (fallthrough)
branch 243 taken 0%
branch 244 taken 1% (fallthrough)
branch 245 taken 99%
branch 246 taken 100% (fallthrough)
branch 247 taken 0%
branch 248 taken 1% (fallthrough)
branch 249 taken 99%
branch 250 taken 100% (fallthrough)
branch 251 taken 0%
branch 252 taken 1% (fallthrough)
branch 253 taken 99%
branch 254 taken 100% (fallthrough)
branch 255 taken 0%
branch 256 taken 1% (fallthrough)
branch 257 taken 99%
branch 258 taken 100% (fallthrough)
branch 259 taken 0%
branch 260 taken 12% (fallthrough)
branch 261 taken 88%
branch 262 taken 100% (fallthrough)
branch 263 taken 0%
branch 264 taken 12% (fallthrough)
branch 265 taken 88%
branch 266 taken 100% (fallthrough)
branch 267 taken 0%
branch 268 taken 12% (fallthrough)
branch 269 taken 88%
branch 270 taken 100% (fallthrough)
branch 271 taken 0%
branch 272 taken 12% (fallthrough)
branch 273 taken 88%
branch 274 taken 100% (fallthrough)
branch 275 taken 0%
branch 276 taken 3% (fallthrough)
branch 277 taken 97%
branch 278 taken 100% (fallthrough)
branch 279 taken 0%
branch 280 taken 3% (fallthrough)
branch 281 taken 97%
branch 282 taken 100% (fallthrough)
branch 283 taken 0%
branch 284 taken 3% (fallthrough)
branch 285 taken 97%
branch 286 taken 100% (fallthrough)
branch 287 taken 0%
branch 288 taken 3% (fallthrough)
branch 289 taken 97%
branch 290 taken 100% (fallthrough)
branch 291 taken 0%
branch 292 taken 0% (fallthrough)
branch 293 taken 100%
branch 294 never executed
branch 295 never executed
branch 296 taken 0% (fallthrough)
branch 297 taken 100%
branch 298 never executed
branch 299 never executed
branch 300 taken 0% (fallthrough)
branch 301 taken 100%
branch 302 never executed
branch 303 never executed
branch 304 taken 3% (fallthrough)
branch 305 taken 97%
branch 306 taken 100% (fallthrough)
branch 307 taken 0%
branch 308 taken 3% (fallthrough)
branch 309 taken 97%
branch 310 taken 100% (fallthrough)
branch 311 taken 0%
branch 312 taken 3% (fallthrough)
branch 313 taken 97%
branch 314 taken 100% (fallthrough)
branch 315 taken 0%
branch 316 taken 1% (fallthrough)
branch 317 taken 99%
branch 318 taken 100% (fallthrough)
branch 319 taken 0%
branch 320 taken 1% (fallthrough)
branch 321 taken 99%
branch 322 taken 100% (fallthrough)
branch 323 taken 0%
branch 324 taken 1% (fallthrough)
branch 325 taken 99%
branch 326 taken 100% (fallthrough)
branch 327 taken 0%
branch 328 taken 14% (fallthrough)
branch 329 taken 86%
branch 330 taken 100% (fallthrough)
branch 331 taken 0%
branch 332 taken 14% (fallthrough)
branch 333 taken 86%
branch 334 taken 100% (fallthrough)
branch 335 taken 0%
branch 336 taken 22% (fallthrough)
branch 337 taken 78%
branch 338 taken 0% (fallthrough)
branch 339 taken 100%
        -: 1085:       (send_interface && receive_interface) ||
        -: 1086:       (send_interface && receive_member) ||
        -: 1087:       (send_interface && receive_error) ||
        -: 1088:       (send_interface && receive_sender) ||
        -: 1089:       (send_interface && eavesdrop) ||
        -: 1090:       (send_interface && receive_requested_reply) ||
        -: 1091:       (send_interface && own) ||
        -: 1092:       (send_interface && user) ||
        -: 1093:       (send_interface && group)) ||
        -: 1094:
        -: 1095:      ((send_member && send_error) ||
        -: 1096:       (send_member && receive_interface) ||
        -: 1097:       (send_member && receive_member) ||
        -: 1098:       (send_member && receive_error) ||
        -: 1099:       (send_member && receive_sender) ||
        -: 1100:       (send_member && eavesdrop) ||
        -: 1101:       (send_member && receive_requested_reply) ||
        -: 1102:       (send_member && own) ||
        -: 1103:       (send_member && user) ||
        -: 1104:       (send_member && group)) ||
        -: 1105:      
        -: 1106:      ((send_error && receive_interface) ||
        -: 1107:       (send_error && receive_member) ||
        -: 1108:       (send_error && receive_error) ||
        -: 1109:       (send_error && receive_sender) ||
        -: 1110:       (send_error && eavesdrop) ||
        -: 1111:       (send_error && receive_requested_reply) ||
        -: 1112:       (send_error && own) ||
        -: 1113:       (send_error && user) ||
        -: 1114:       (send_error && group)) ||
        -: 1115:
        -: 1116:      ((send_destination && receive_interface) ||
        -: 1117:       (send_destination && receive_member) ||
        -: 1118:       (send_destination && receive_error) ||
        -: 1119:       (send_destination && receive_sender) ||
        -: 1120:       (send_destination && eavesdrop) ||
        -: 1121:       (send_destination && receive_requested_reply) ||
        -: 1122:       (send_destination && own) ||
        -: 1123:       (send_destination && user) ||
        -: 1124:       (send_destination && group)) ||
        -: 1125:
        -: 1126:      ((send_type && receive_interface) ||
        -: 1127:       (send_type && receive_member) ||
        -: 1128:       (send_type && receive_error) ||
        -: 1129:       (send_type && receive_sender) ||
        -: 1130:       (send_type && eavesdrop) ||
        -: 1131:       (send_type && receive_requested_reply) ||
        -: 1132:       (send_type && own) ||
        -: 1133:       (send_type && user) ||
        -: 1134:       (send_type && group)) ||
        -: 1135:
        -: 1136:      ((send_path && receive_interface) ||
        -: 1137:       (send_path && receive_member) ||
        -: 1138:       (send_path && receive_error) ||
        -: 1139:       (send_path && receive_sender) ||
        -: 1140:       (send_path && eavesdrop) ||
        -: 1141:       (send_path && receive_requested_reply) ||
        -: 1142:       (send_path && own) ||
        -: 1143:       (send_path && user) ||
        -: 1144:       (send_path && group)) ||
        -: 1145:
        -: 1146:      ((send_requested_reply && receive_interface) ||
        -: 1147:       (send_requested_reply && receive_member) ||
        -: 1148:       (send_requested_reply && receive_error) ||
        -: 1149:       (send_requested_reply && receive_sender) ||
        -: 1150:       (send_requested_reply && eavesdrop) ||
        -: 1151:       (send_requested_reply && receive_requested_reply) ||
        -: 1152:       (send_requested_reply && own) ||
        -: 1153:       (send_requested_reply && user) ||
        -: 1154:       (send_requested_reply && group)) ||
        -: 1155:      
        -: 1156:      ((receive_interface && receive_error) ||
        -: 1157:       (receive_interface && own) ||
        -: 1158:       (receive_interface && user) ||
        -: 1159:       (receive_interface && group)) ||
        -: 1160:
        -: 1161:      ((receive_member && receive_error) ||
        -: 1162:       (receive_member && own) ||
        -: 1163:       (receive_member && user) ||
        -: 1164:       (receive_member && group)) ||
        -: 1165:      
        -: 1166:      ((receive_error && own) ||
        -: 1167:       (receive_error && user) ||
        -: 1168:       (receive_error && group)) ||
        -: 1169:
        -: 1170:      ((eavesdrop && own) ||
        -: 1171:       (eavesdrop && user) ||
        -: 1172:       (eavesdrop && group)) ||
        -: 1173:
        -: 1174:      ((receive_requested_reply && own) ||
        -: 1175:       (receive_requested_reply && user) ||
        -: 1176:       (receive_requested_reply && group)) ||
        -: 1177:      
        -: 1178:      ((own && user) ||
        -: 1179:       (own && group)) ||
        -: 1180:
        -: 1181:      ((user && group)))
        -: 1182:    {
    #####: 1183:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1184:                      "Invalid combination of attributes on element <%s>",
        -: 1185:                      element_name);
    #####: 1186:      return FALSE;
        -: 1187:    }
        -: 1188:  
       69: 1189:  rule = NULL;
        -: 1190:
        -: 1191:  /* In BusPolicyRule, NULL represents wildcard.
        -: 1192:   * In the config file, '*' represents it.
        -: 1193:   */
        -: 1194:#define IS_WILDCARD(str) ((str) && ((str)[0]) == '*' && ((str)[1]) == '\0')
        -: 1195:
       97: 1196:  if (send_interface || send_member || send_error || send_destination ||
branch  0 taken 83% (fallthrough)
branch  1 taken 17%
branch  2 taken 96% (fallthrough)
branch  3 taken 4%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
branch  6 taken 91% (fallthrough)
branch  7 taken 9%
branch  8 taken 100% (fallthrough)
branch  9 taken 0%
branch 10 taken 84% (fallthrough)
branch 11 taken 16%
branch 12 taken 2% (fallthrough)
branch 13 taken 98%
        -: 1197:      send_path || send_type || send_requested_reply)
        -: 1198:    {
        -: 1199:      int message_type;
        -: 1200:      
       28: 1201:      if (IS_WILDCARD (send_interface))
branch  0 taken 43% (fallthrough)
branch  1 taken 57%
branch  2 taken 42% (fallthrough)
branch  3 taken 58%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
        5: 1202:        send_interface = NULL;
       28: 1203:      if (IS_WILDCARD (send_member))
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
    #####: 1204:        send_member = NULL;
       28: 1205:      if (IS_WILDCARD (send_error))
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
branch  4 never executed
branch  5 never executed
    #####: 1206:        send_error = NULL;
       28: 1207:      if (IS_WILDCARD (send_destination))
branch  0 taken 32% (fallthrough)
branch  1 taken 68%
branch  2 taken 22% (fallthrough)
branch  3 taken 78%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
        2: 1208:        send_destination = NULL;
       28: 1209:      if (IS_WILDCARD (send_path))
branch  0 taken 7% (fallthrough)
branch  1 taken 93%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
    #####: 1210:        send_path = NULL;
       28: 1211:      if (IS_WILDCARD (send_type))
branch  0 taken 36% (fallthrough)
branch  1 taken 64%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
    #####: 1212:        send_type = NULL;
        -: 1213:
       28: 1214:      message_type = DBUS_MESSAGE_TYPE_INVALID;
       28: 1215:      if (send_type != NULL)
branch  0 taken 36% (fallthrough)
branch  1 taken 64%
        -: 1216:        {
       10: 1217:          message_type = dbus_message_type_from_string (send_type);
call    0 returned 100%
       10: 1218:          if (message_type == DBUS_MESSAGE_TYPE_INVALID)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1219:            {
    #####: 1220:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1221:                              "Bad message type \"%s\"",
        -: 1222:                              send_type);
    #####: 1223:              return FALSE;
        -: 1224:            }
        -: 1225:        }
        -: 1226:
       28: 1227:      if (send_requested_reply &&
branch  0 taken 4% (fallthrough)
branch  1 taken 96%
call    2 returned 100%
branch  3 taken 0% (fallthrough)
branch  4 taken 100%
call    5 never executed
branch  6 never executed
branch  7 never executed
        -: 1228:          !(strcmp (send_requested_reply, "true") == 0 ||
        -: 1229:            strcmp (send_requested_reply, "false") == 0))
        -: 1230:        {
    #####: 1231:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1232:                          "Bad value \"%s\" for %s attribute, must be true or false",
        -: 1233:                          "send_requested_reply", send_requested_reply);
    #####: 1234:          return FALSE;
        -: 1235:        }
        -: 1236:      
       28: 1237:      rule = bus_policy_rule_new (BUS_POLICY_RULE_SEND, allow); 
call    0 returned 100%
       28: 1238:      if (rule == NULL)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
    #####: 1239:        goto nomem;
        -: 1240:      
       28: 1241:      if (send_requested_reply)
branch  0 taken 4% (fallthrough)
branch  1 taken 96%
        1: 1242:        rule->d.send.requested_reply = (strcmp (send_requested_reply, "true") == 0);
call    0 returned 100%
        -: 1243:      
       28: 1244:      rule->d.send.message_type = message_type;
       28: 1245:      rule->d.send.path = _dbus_strdup (send_path);
call    0 returned 100%
       28: 1246:      rule->d.send.interface = _dbus_strdup (send_interface);
call    0 returned 100%
       28: 1247:      rule->d.send.member = _dbus_strdup (send_member);
call    0 returned 100%
       28: 1248:      rule->d.send.error = _dbus_strdup (send_error);
call    0 returned 100%
       28: 1249:      rule->d.send.destination = _dbus_strdup (send_destination);
call    0 returned 100%
       28: 1250:      if (send_path && rule->d.send.path == NULL)
branch  0 taken 7% (fallthrough)
branch  1 taken 93%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1251:        goto nomem;
       28: 1252:      if (send_interface && rule->d.send.interface == NULL)
branch  0 taken 25% (fallthrough)
branch  1 taken 75%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1253:        goto nomem;
       28: 1254:      if (send_member && rule->d.send.member == NULL)
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1255:        goto nomem;
       28: 1256:      if (send_error && rule->d.send.error == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
    #####: 1257:        goto nomem;
       28: 1258:      if (send_destination && rule->d.send.destination == NULL)
branch  0 taken 25% (fallthrough)
branch  1 taken 75%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1259:        goto nomem;
        -: 1260:    }
       55: 1261:  else if (receive_interface || receive_member || receive_error || receive_sender ||
branch  0 taken 80% (fallthrough)
branch  1 taken 20%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
branch  6 taken 91% (fallthrough)
branch  7 taken 9%
branch  8 taken 100% (fallthrough)
branch  9 taken 0%
branch 10 taken 100% (fallthrough)
branch 11 taken 0%
branch 12 taken 93% (fallthrough)
branch 13 taken 7%
branch 14 taken 4% (fallthrough)
branch 15 taken 96%
        -: 1262:           receive_path || receive_type || eavesdrop || receive_requested_reply)
        -: 1263:    {
        -: 1264:      int message_type;
        -: 1265:      
       14: 1266:      if (IS_WILDCARD (receive_interface))
branch  0 taken 57% (fallthrough)
branch  1 taken 43%
branch  2 taken 63% (fallthrough)
branch  3 taken 38%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
        5: 1267:        receive_interface = NULL;
       14: 1268:      if (IS_WILDCARD (receive_member))
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
    #####: 1269:        receive_member = NULL;
       14: 1270:      if (IS_WILDCARD (receive_error))
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
branch  4 never executed
branch  5 never executed
    #####: 1271:        receive_error = NULL;
       14: 1272:      if (IS_WILDCARD (receive_sender))
branch  0 taken 29% (fallthrough)
branch  1 taken 71%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
    #####: 1273:        receive_sender = NULL;
       14: 1274:      if (IS_WILDCARD (receive_path))
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
branch  4 never executed
branch  5 never executed
    #####: 1275:        receive_path = NULL;
       14: 1276:      if (IS_WILDCARD (receive_type))
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
branch  4 never executed
branch  5 never executed
    #####: 1277:        receive_type = NULL;
        -: 1278:
       14: 1279:      message_type = DBUS_MESSAGE_TYPE_INVALID;
       14: 1280:      if (receive_type != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1281:        {
    #####: 1282:          message_type = dbus_message_type_from_string (receive_type);
call    0 never executed
    #####: 1283:          if (message_type == DBUS_MESSAGE_TYPE_INVALID)
branch  0 never executed
branch  1 never executed
        -: 1284:            {
    #####: 1285:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1286:                              "Bad message type \"%s\"",
        -: 1287:                              receive_type);
    #####: 1288:              return FALSE;
        -: 1289:            }
        -: 1290:        }
        -: 1291:
        -: 1292:
       14: 1293:      if (eavesdrop &&
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
call    2 returned 100%
branch  3 taken 0% (fallthrough)
branch  4 taken 100%
call    5 never executed
branch  6 never executed
branch  7 never executed
        -: 1294:          !(strcmp (eavesdrop, "true") == 0 ||
        -: 1295:            strcmp (eavesdrop, "false") == 0))
        -: 1296:        {
    #####: 1297:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1298:                          "Bad value \"%s\" for %s attribute, must be true or false",
        -: 1299:                          "eavesdrop", eavesdrop);
    #####: 1300:          return FALSE;
        -: 1301:        }
        -: 1302:
       14: 1303:      if (receive_requested_reply &&
branch  0 taken 7% (fallthrough)
branch  1 taken 93%
call    2 returned 100%
branch  3 taken 0% (fallthrough)
branch  4 taken 100%
call    5 never executed
branch  6 never executed
branch  7 never executed
        -: 1304:          !(strcmp (receive_requested_reply, "true") == 0 ||
        -: 1305:            strcmp (receive_requested_reply, "false") == 0))
        -: 1306:        {
    #####: 1307:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1308:                          "Bad value \"%s\" for %s attribute, must be true or false",
        -: 1309:                          "receive_requested_reply", receive_requested_reply);
    #####: 1310:          return FALSE;
        -: 1311:        }
        -: 1312:      
       14: 1313:      rule = bus_policy_rule_new (BUS_POLICY_RULE_RECEIVE, allow); 
call    0 returned 100%
       14: 1314:      if (rule == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1315:        goto nomem;
        -: 1316:
       14: 1317:      if (eavesdrop)
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
        2: 1318:        rule->d.receive.eavesdrop = (strcmp (eavesdrop, "true") == 0);
call    0 returned 100%
        -: 1319:
       14: 1320:      if (receive_requested_reply)
branch  0 taken 7% (fallthrough)
branch  1 taken 93%
        1: 1321:        rule->d.receive.requested_reply = (strcmp (receive_requested_reply, "true") == 0);
call    0 returned 100%
        -: 1322:      
       14: 1323:      rule->d.receive.message_type = message_type;
       14: 1324:      rule->d.receive.path = _dbus_strdup (receive_path);
call    0 returned 100%
       14: 1325:      rule->d.receive.interface = _dbus_strdup (receive_interface);
call    0 returned 100%
       14: 1326:      rule->d.receive.member = _dbus_strdup (receive_member);
call    0 returned 100%
       14: 1327:      rule->d.receive.error = _dbus_strdup (receive_error);
call    0 returned 100%
       14: 1328:      rule->d.receive.origin = _dbus_strdup (receive_sender);
call    0 returned 100%
        -: 1329:
       14: 1330:      if (receive_path && rule->d.receive.path == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
    #####: 1331:        goto nomem;
       14: 1332:      if (receive_interface && rule->d.receive.interface == NULL)
branch  0 taken 21% (fallthrough)
branch  1 taken 79%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1333:        goto nomem;
       14: 1334:      if (receive_member && rule->d.receive.member == NULL)
branch  0 taken 14% (fallthrough)
branch  1 taken 86%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1335:        goto nomem;
       14: 1336:      if (receive_error && rule->d.receive.error == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
    #####: 1337:        goto nomem;
       14: 1338:      if (receive_sender && rule->d.receive.origin == NULL)
branch  0 taken 29% (fallthrough)
branch  1 taken 71%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1339:        goto nomem;
        -: 1340:    }
       27: 1341:  else if (own)
branch  0 taken 37% (fallthrough)
branch  1 taken 63%
        -: 1342:    {
       10: 1343:      rule = bus_policy_rule_new (BUS_POLICY_RULE_OWN, allow); 
call    0 returned 100%
       10: 1344:      if (rule == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1345:        goto nomem;
        -: 1346:
       10: 1347:      if (IS_WILDCARD (own))
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 70% (fallthrough)
branch  3 taken 30%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
        7: 1348:        own = NULL;
        -: 1349:      
       10: 1350:      rule->d.own.service_name = _dbus_strdup (own);
call    0 returned 100%
       10: 1351:      if (own && rule->d.own.service_name == NULL)
branch  0 taken 30% (fallthrough)
branch  1 taken 70%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
    #####: 1352:        goto nomem;
        -: 1353:    }
       17: 1354:  else if (user)
branch  0 taken 88% (fallthrough)
branch  1 taken 12%
        -: 1355:    {      
       28: 1356:      if (IS_WILDCARD (user))
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 87% (fallthrough)
branch  3 taken 13%
branch  4 taken 100% (fallthrough)
branch  5 taken 0%
        -: 1357:        {
       13: 1358:          rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow); 
call    0 returned 100%
       13: 1359:          if (rule == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1360:            goto nomem;
        -: 1361:
       13: 1362:          rule->d.user.uid = DBUS_UID_UNSET;
        -: 1363:        }
        -: 1364:      else
        -: 1365:        {
        -: 1366:          DBusString username;
        -: 1367:          dbus_uid_t uid;
        -: 1368:          
        2: 1369:          _dbus_string_init_const (&username, user);
call    0 returned 100%
        -: 1370:      
        2: 1371:          if (_dbus_get_user_id (&username, &uid))
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -: 1372:            {
        2: 1373:              rule = bus_policy_rule_new (BUS_POLICY_RULE_USER, allow); 
call    0 returned 100%
        2: 1374:              if (rule == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1375:                goto nomem;
        -: 1376:
        2: 1377:              rule->d.user.uid = uid;
        -: 1378:            }
        -: 1379:          else
        -: 1380:            {
    #####: 1381:              _dbus_warn ("Unknown username \"%s\" on element <%s>\n",
call    0 never executed
        -: 1382:                          user, element_name);
        -: 1383:            }
        -: 1384:        }
        -: 1385:    }
        2: 1386:  else if (group)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        -: 1387:    {
        2: 1388:      if (IS_WILDCARD (group))
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
        -: 1389:        {
    #####: 1390:          rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow); 
call    0 never executed
    #####: 1391:          if (rule == NULL)
branch  0 never executed
branch  1 never executed
    #####: 1392:            goto nomem;
        -: 1393:
    #####: 1394:          rule->d.group.gid = DBUS_GID_UNSET;
        -: 1395:        }
        -: 1396:      else
        -: 1397:        {
        -: 1398:          DBusString groupname;
        -: 1399:          dbus_gid_t gid;
        -: 1400:          
        2: 1401:          _dbus_string_init_const (&groupname, group);
call    0 returned 100%
        -: 1402:          
        2: 1403:          if (_dbus_get_user_id (&groupname, &gid))
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -: 1404:            {
        2: 1405:              rule = bus_policy_rule_new (BUS_POLICY_RULE_GROUP, allow); 
call    0 returned 100%
        2: 1406:              if (rule == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1407:                goto nomem;
        -: 1408:
        2: 1409:              rule->d.group.gid = gid;
        -: 1410:            }
        -: 1411:          else
        -: 1412:            {
    #####: 1413:              _dbus_warn ("Unknown group \"%s\" on element <%s>\n",
call    0 never executed
        -: 1414:                          group, element_name);
        -: 1415:            }
        -: 1416:        }
        -: 1417:    }
        -: 1418:  else
    #####: 1419:    _dbus_assert_not_reached ("Did not handle some combination of attributes on <allow> or <deny>");
call    0 never executed
        -: 1420:
       69: 1421:  if (rule != NULL)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        -: 1422:    {
        -: 1423:      Element *pe;
        -: 1424:      
       69: 1425:      pe = peek_element (parser);      
call    0 returned 100%
       69: 1426:      _dbus_assert (pe != NULL);
call    0 returned 100%
       69: 1427:      _dbus_assert (pe->type == ELEMENT_POLICY);
call    0 returned 100%
        -: 1428:
       69: 1429:      switch (pe->d.policy.type)
branch  0 taken 0%
branch  1 taken 75%
branch  2 taken 22%
branch  3 taken 3%
branch  4 taken 0%
branch  5 taken 0%
branch  6 taken 0%
        -: 1430:        {
        -: 1431:        case POLICY_IGNORED:
        -: 1432:          /* drop the rule on the floor */
    #####: 1433:          break;
        -: 1434:          
        -: 1435:        case POLICY_DEFAULT:
       52: 1436:          if (!bus_policy_append_default_rule (parser->policy, rule))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 1437:            goto nomem;
       52: 1438:          break;
        -: 1439:        case POLICY_MANDATORY:
       15: 1440:          if (!bus_policy_append_mandatory_rule (parser->policy, rule))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 1441:            goto nomem;
       15: 1442:          break;
        -: 1443:        case POLICY_USER:
        2: 1444:          if (!BUS_POLICY_RULE_IS_PER_CLIENT (rule))
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
        -: 1445:            {
    #####: 1446:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1447:                              "<%s> rule cannot be per-user because it has bus-global semantics",
        -: 1448:                              element_name);
    #####: 1449:              goto failed;
        -: 1450:            }
        -: 1451:          
        2: 1452:          if (!bus_policy_append_user_rule (parser->policy, pe->d.policy.gid_uid_or_at_console,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1453:                                            rule))
    #####: 1454:            goto nomem;
        2: 1455:          break;
        -: 1456:        case POLICY_GROUP:
    #####: 1457:          if (!BUS_POLICY_RULE_IS_PER_CLIENT (rule))
branch  0 never executed
branch  1 never executed
branch  2 never executed
branch  3 never executed
        -: 1458:            {
    #####: 1459:              dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1460:                              "<%s> rule cannot be per-group because it has bus-global semantics",
        -: 1461:                              element_name);
    #####: 1462:              goto failed;
        -: 1463:            }
        -: 1464:          
    #####: 1465:          if (!bus_policy_append_group_rule (parser->policy, pe->d.policy.gid_uid_or_at_console,
call    0 never executed
branch  1 never executed
branch  2 never executed
        -: 1466:                                             rule))
    #####: 1467:            goto nomem;
    #####: 1468:          break;
        -: 1469:        
        -: 1470:
        -: 1471:        case POLICY_CONSOLE:
    #####: 1472:          if (!bus_policy_append_console_rule (parser->policy, pe->d.policy.gid_uid_or_at_console,
call    0 never executed
branch  1 never executed
branch  2 never executed
        -: 1473:                                             rule))
    #####: 1474:            goto nomem;
        -: 1475:          break;
        -: 1476:        }
        -: 1477: 
       69: 1478:      bus_policy_rule_unref (rule);
call    0 returned 100%
       69: 1479:      rule = NULL;
        -: 1480:    }
        -: 1481:  
       69: 1482:  return TRUE;
        -: 1483:
    #####: 1484: nomem:
    #####: 1485:  BUS_SET_OOM (error);
call    0 never executed
    #####: 1486: failed:
    #####: 1487:  if (rule)
branch  0 never executed
branch  1 never executed
    #####: 1488:    bus_policy_rule_unref (rule);
call    0 never executed
    #####: 1489:  return FALSE;
        -: 1490:}
        -: 1491:
        -: 1492:static dbus_bool_t
        -: 1493:start_policy_child (BusConfigParser   *parser,
        -: 1494:                    const char        *element_name,
        -: 1495:                    const char       **attribute_names,
        -: 1496:                    const char       **attribute_values,
        -: 1497:                    DBusError         *error)
function start_policy_child called 69 returned 100% blocks executed 65%
       69: 1498:{
       69: 1499:  if (strcmp (element_name, "allow") == 0)
call    0 returned 100%
branch  1 taken 67% (fallthrough)
branch  2 taken 33%
        -: 1500:    {
       46: 1501:      if (!append_rule_from_element (parser, element_name,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1502:                                     attribute_names, attribute_values,
        -: 1503:                                     TRUE, error))
    #####: 1504:        return FALSE;
        -: 1505:      
       46: 1506:      if (push_element (parser, ELEMENT_ALLOW) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1507:        {
    #####: 1508:          BUS_SET_OOM (error);
call    0 never executed
    #####: 1509:          return FALSE;
        -: 1510:        }
        -: 1511:      
       46: 1512:      return TRUE;
        -: 1513:    }
       23: 1514:  else if (strcmp (element_name, "deny") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -: 1515:    {
       23: 1516:      if (!append_rule_from_element (parser, element_name,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1517:                                     attribute_names, attribute_values,
        -: 1518:                                     FALSE, error))
    #####: 1519:        return FALSE;
        -: 1520:      
       23: 1521:      if (push_element (parser, ELEMENT_DENY) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1522:        {
    #####: 1523:          BUS_SET_OOM (error);
call    0 never executed
    #####: 1524:          return FALSE;
        -: 1525:        }
        -: 1526:      
       23: 1527:      return TRUE;
        -: 1528:    }
        -: 1529:  else
        -: 1530:    {
    #####: 1531:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1532:                      "Element <%s> not allowed inside <%s> in configuration file",
        -: 1533:                      element_name, "policy");
    #####: 1534:      return FALSE;
        -: 1535:    }
        -: 1536:}
        -: 1537:
        -: 1538:static dbus_bool_t
        -: 1539:start_selinux_child (BusConfigParser   *parser,
        -: 1540:                     const char        *element_name,
        -: 1541:                     const char       **attribute_names,
        -: 1542:                     const char       **attribute_values,
        -: 1543:                     DBusError         *error)
function start_selinux_child called 2 returned 100% blocks executed 59%
        2: 1544:{
        2: 1545:  if (strcmp (element_name, "associate") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -: 1546:    {
        -: 1547:      const char *own;
        -: 1548:      const char *context;
        -: 1549:      char *own_copy;
        -: 1550:      char *context_copy;
        -: 1551:      
        2: 1552:      if (!locate_attributes (parser, "associate",
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1553:                              attribute_names,
        -: 1554:                              attribute_values,
        -: 1555:                              error,
        -: 1556:                              "own", &own,
        -: 1557:                              "context", &context,
        -: 1558:                              NULL))
    #####: 1559:        return FALSE;
        -: 1560:      
        2: 1561:      if (push_element (parser, ELEMENT_ASSOCIATE) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1562:        {
    #####: 1563:          BUS_SET_OOM (error);
call    0 never executed
    #####: 1564:          return FALSE;
        -: 1565:        }
        -: 1566:
        2: 1567:      if (own == NULL || context == NULL)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
        -: 1568:        {
    #####: 1569:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1570:                          "Element <associate> must have attributes own=\"<servicename>\" and context=\"<selinux context>\"");
    #####: 1571:          return FALSE;
        -: 1572:        }
        -: 1573:
        2: 1574:      own_copy = _dbus_strdup (own);
call    0 returned 100%
        2: 1575:      if (own_copy == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1576:        return FALSE;
        2: 1577:      context_copy = _dbus_strdup (context);
call    0 returned 100%
        2: 1578:      if (context_copy == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 1579:        return FALSE;
        -: 1580:
        2: 1581:      if (!_dbus_hash_table_insert_string (parser->service_context_table,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1582:					   own_copy, context_copy))
        -: 1583:        {
    #####: 1584:          BUS_SET_OOM (error);
call    0 never executed
    #####: 1585:          return FALSE;
        -: 1586:        }
        -: 1587:      
        2: 1588:      return TRUE;
        -: 1589:    }
        -: 1590:  else
        -: 1591:    {
    #####: 1592:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1593:                      "Element <%s> not allowed inside <%s> in configuration file",
        -: 1594:                      element_name, "selinux");
    #####: 1595:      return FALSE;
        -: 1596:    }
        -: 1597:}
        -: 1598:
        -: 1599:dbus_bool_t
        -: 1600:bus_config_parser_start_element (BusConfigParser   *parser,
        -: 1601:                                 const char        *element_name,
        -: 1602:                                 const char       **attribute_names,
        -: 1603:                                 const char       **attribute_values,
        -: 1604:                                 DBusError         *error)
function bus_config_parser_start_element called 290 returned 100% blocks executed 75%
      290: 1605:{
        -: 1606:  ElementType t;
        -: 1607:
      290: 1608:  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
call    5 returned 100%
        -: 1609:
        -: 1610:  /* printf ("START: %s\n", element_name); */
        -: 1611:  
      290: 1612:  t = top_element_type (parser);
call    0 returned 100%
        -: 1613:
      290: 1614:  if (t == ELEMENT_NONE)
branch  0 taken 12% (fallthrough)
branch  1 taken 88%
        -: 1615:    {
       36: 1616:      if (strcmp (element_name, "busconfig") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -: 1617:        {
       36: 1618:          if (!check_no_attributes (parser, "busconfig", attribute_names, attribute_values, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 1619:            return FALSE;
        -: 1620:          
       36: 1621:          if (push_element (parser, ELEMENT_BUSCONFIG) == NULL)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1622:            {
    #####: 1623:              BUS_SET_OOM (error);
call    0 never executed
    #####: 1624:              return FALSE;
        -: 1625:            }
        -: 1626:
       36: 1627:          return TRUE;
        -: 1628:        }
        -: 1629:      else
        -: 1630:        {
    #####: 1631:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1632:                          "Unknown element <%s> at root of configuration file",
        -: 1633:                          element_name);
    #####: 1634:          return FALSE;
        -: 1635:        }
        -: 1636:    }
      254: 1637:  else if (t == ELEMENT_BUSCONFIG)
branch  0 taken 72% (fallthrough)
branch  1 taken 28%
        -: 1638:    {
      183: 1639:      return start_busconfig_child (parser, element_name,
call    0 returned 100%
        -: 1640:                                    attribute_names, attribute_values,
        -: 1641:                                    error);
        -: 1642:    }
       71: 1643:  else if (t == ELEMENT_POLICY)
branch  0 taken 97% (fallthrough)
branch  1 taken 3%
        -: 1644:    {
       69: 1645:      return start_policy_child (parser, element_name,
call    0 returned 100%
        -: 1646:                                 attribute_names, attribute_values,
        -: 1647:                                 error);
        -: 1648:    }
        2: 1649:  else if (t == ELEMENT_SELINUX)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        -: 1650:    {
        2: 1651:      return start_selinux_child (parser, element_name,
call    0 returned 100%
        -: 1652:                                  attribute_names, attribute_values,
        -: 1653:                                  error);
        -: 1654:    }
        -: 1655:  else
        -: 1656:    {
    #####: 1657:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1658:                      "Element <%s> is not allowed in this context",
        -: 1659:                      element_name);
    #####: 1660:      return FALSE;
        -: 1661:    }  
        -: 1662:}
        -: 1663:
        -: 1664:static dbus_bool_t
        -: 1665:set_limit (BusConfigParser *parser,
        -: 1666:           const char      *name,
        -: 1667:           long             value,
        -: 1668:           DBusError       *error)
function set_limit called 41 returned 100% blocks executed 81%
       41: 1669:{
        -: 1670:  dbus_bool_t must_be_positive;
        -: 1671:  dbus_bool_t must_be_int;
        -: 1672:
       41: 1673:  must_be_int = FALSE;
       41: 1674:  must_be_positive = FALSE;
        -: 1675:  
       41: 1676:  if (strcmp (name, "max_incoming_bytes") == 0)
call    0 returned 100%
branch  1 taken 10% (fallthrough)
branch  2 taken 90%
        -: 1677:    {
        4: 1678:      must_be_positive = TRUE;
        4: 1679:      parser->limits.max_incoming_bytes = value;
        -: 1680:    }
       37: 1681:  else if (strcmp (name, "max_outgoing_bytes") == 0)
call    0 returned 100%
branch  1 taken 11% (fallthrough)
branch  2 taken 89%
        -: 1682:    {
        4: 1683:      must_be_positive = TRUE;
        4: 1684:      parser->limits.max_outgoing_bytes = value;
        -: 1685:    }
       33: 1686:  else if (strcmp (name, "max_message_size") == 0)
call    0 returned 100%
branch  1 taken 12% (fallthrough)
branch  2 taken 88%
        -: 1687:    {
        4: 1688:      must_be_positive = TRUE;
        4: 1689:      parser->limits.max_message_size = value;
        -: 1690:    }
       29: 1691:  else if (strcmp (name, "service_start_timeout") == 0)
call    0 returned 100%
branch  1 taken 14% (fallthrough)
branch  2 taken 86%
        -: 1692:    {
        4: 1693:      must_be_positive = TRUE;
        4: 1694:      must_be_int = TRUE;
        4: 1695:      parser->limits.activation_timeout = value;
        -: 1696:    }
       25: 1697:  else if (strcmp (name, "auth_timeout") == 0)
call    0 returned 100%
branch  1 taken 16% (fallthrough)
branch  2 taken 84%
        -: 1698:    {
        4: 1699:      must_be_positive = TRUE;
        4: 1700:      must_be_int = TRUE;
        4: 1701:      parser->limits.auth_timeout = value;
        -: 1702:    }
       21: 1703:  else if (strcmp (name, "reply_timeout") == 0)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1704:    {
    #####: 1705:      must_be_positive = TRUE;
    #####: 1706:      must_be_int = TRUE;
    #####: 1707:      parser->limits.reply_timeout = value;
        -: 1708:    }
       21: 1709:  else if (strcmp (name, "max_completed_connections") == 0)
call    0 returned 100%
branch  1 taken 19% (fallthrough)
branch  2 taken 81%
        -: 1710:    {
        4: 1711:      must_be_positive = TRUE;
        4: 1712:      must_be_int = TRUE;
        4: 1713:      parser->limits.max_completed_connections = value;
        -: 1714:    }
       17: 1715:  else if (strcmp (name, "max_incomplete_connections") == 0)
call    0 returned 100%
branch  1 taken 24% (fallthrough)
branch  2 taken 76%
        -: 1716:    {
        4: 1717:      must_be_positive = TRUE;
        4: 1718:      must_be_int = TRUE;
        4: 1719:      parser->limits.max_incomplete_connections = value;
        -: 1720:    }
       13: 1721:  else if (strcmp (name, "max_connections_per_user") == 0)
call    0 returned 100%
branch  1 taken 31% (fallthrough)
branch  2 taken 69%
        -: 1722:    {
        4: 1723:      must_be_positive = TRUE;
        4: 1724:      must_be_int = TRUE;
        4: 1725:      parser->limits.max_connections_per_user = value;
        -: 1726:    }
        9: 1727:  else if (strcmp (name, "max_pending_service_starts") == 0)
call    0 returned 100%
branch  1 taken 44% (fallthrough)
branch  2 taken 56%
        -: 1728:    {
        4: 1729:      must_be_positive = TRUE;
        4: 1730:      must_be_int = TRUE;
        4: 1731:      parser->limits.max_pending_activations = value;
        -: 1732:    }
        5: 1733:  else if (strcmp (name, "max_names_per_connection") == 0)
call    0 returned 100%
branch  1 taken 80% (fallthrough)
branch  2 taken 20%
        -: 1734:    {
        4: 1735:      must_be_positive = TRUE;
        4: 1736:      must_be_int = TRUE;
        4: 1737:      parser->limits.max_services_per_connection = value;
        -: 1738:    }
        1: 1739:  else if (strcmp (name, "max_match_rules_per_connection") == 0)
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
        -: 1740:    {
        1: 1741:      must_be_positive = TRUE;
        1: 1742:      must_be_int = TRUE;
        1: 1743:      parser->limits.max_match_rules_per_connection = value;
        -: 1744:    }
    #####: 1745:  else if (strcmp (name, "max_replies_per_connection") == 0)
call    0 never executed
branch  1 never executed
branch  2 never executed
        -: 1746:    {
    #####: 1747:      must_be_positive = TRUE;
    #####: 1748:      must_be_int = TRUE;
    #####: 1749:      parser->limits.max_replies_per_connection = value;
        -: 1750:    }
        -: 1751:  else
        -: 1752:    {
    #####: 1753:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1754:                      "There is no limit called \"%s\"\n",
        -: 1755:                      name);
    #####: 1756:      return FALSE;
        -: 1757:    }
        -: 1758:  
       41: 1759:  if (must_be_positive && value < 0)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
        -: 1760:    {
    #####: 1761:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1762:                      "<limit name=\"%s\"> must be a positive number\n",
        -: 1763:                      name);
    #####: 1764:      return FALSE;
        -: 1765:    }
        -: 1766:
       41: 1767:  if (must_be_int &&
branch  0 taken 71% (fallthrough)
branch  1 taken 29%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
branch  4 taken 0% (fallthrough)
branch  5 taken 100%
        -: 1768:      (value < _DBUS_INT_MIN || value > _DBUS_INT_MAX))
        -: 1769:    {
    #####: 1770:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1771:                      "<limit name=\"%s\"> value is too large\n",
        -: 1772:                      name);
    #####: 1773:      return FALSE;
        -: 1774:    }
        -: 1775:
       41: 1776:  return TRUE;  
        -: 1777:}
        -: 1778:
        -: 1779:dbus_bool_t
        -: 1780:bus_config_parser_end_element (BusConfigParser   *parser,
        -: 1781:                               const char        *element_name,
        -: 1782:                               DBusError         *error)
function bus_config_parser_end_element called 252 returned 100% blocks executed 68%
      252: 1783:{
        -: 1784:  ElementType t;
        -: 1785:  const char *n;
        -: 1786:  Element *e;
        -: 1787:
      252: 1788:  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
call    5 returned 100%
        -: 1789:
        -: 1790:  /* printf ("END: %s\n", element_name); */
        -: 1791:  
      252: 1792:  t = top_element_type (parser);
call    0 returned 100%
        -: 1793:
      252: 1794:  if (t == ELEMENT_NONE)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1795:    {
        -: 1796:      /* should probably be an assertion failure but
        -: 1797:       * being paranoid about XML parsers
        -: 1798:       */
    #####: 1799:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1800:                      "XML parser ended element with no element on the stack");
    #####: 1801:      return FALSE;
        -: 1802:    }
        -: 1803:
      252: 1804:  n = element_type_to_name (t);
call    0 returned 100%
      252: 1805:  _dbus_assert (n != NULL);
call    0 returned 100%
      252: 1806:  if (strcmp (n, element_name) != 0)
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1807:    {
        -: 1808:      /* should probably be an assertion failure but
        -: 1809:       * being paranoid about XML parsers
        -: 1810:       */
    #####: 1811:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 1812:                      "XML element <%s> ended but topmost element on the stack was <%s>",
        -: 1813:                      element_name, n);
    #####: 1814:      return FALSE;
        -: 1815:    }
        -: 1816:
      252: 1817:  e = peek_element (parser);
call    0 returned 100%
      252: 1818:  _dbus_assert (e != NULL);
call    0 returned 100%
        -: 1819:
      252: 1820:  switch (e->type)
branch  0 taken 0%
branch  1 taken 58%
branch  2 taken 42%
        -: 1821:    {
        -: 1822:    case ELEMENT_NONE:
    #####: 1823:      _dbus_assert_not_reached ("element in stack has no type");
call    0 never executed
        -: 1824:      break;
        -: 1825:
        -: 1826:    case ELEMENT_INCLUDE:
        -: 1827:    case ELEMENT_USER:
        -: 1828:    case ELEMENT_TYPE:
        -: 1829:    case ELEMENT_LISTEN:
        -: 1830:    case ELEMENT_PIDFILE:
        -: 1831:    case ELEMENT_AUTH:
        -: 1832:    case ELEMENT_SERVICEDIR:
        -: 1833:    case ELEMENT_INCLUDEDIR:
        -: 1834:    case ELEMENT_LIMIT:
      145: 1835:      if (!e->had_content)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 1836:        {
    #####: 1837:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
call    1 never executed
        -: 1838:                          "XML element <%s> was expected to have content inside it",
        -: 1839:                          element_type_to_name (e->type));
    #####: 1840:          return FALSE;
        -: 1841:        }
        -: 1842:
      145: 1843:      if (e->type == ELEMENT_LIMIT)
branch  0 taken 28% (fallthrough)
branch  1 taken 72%
        -: 1844:        {
       41: 1845:          if (!set_limit (parser, e->d.limit.name, e->d.limit.value,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1846:                          error))
    #####: 1847:            return FALSE;
        -: 1848:        }
        -: 1849:      break;
        -: 1850:
        -: 1851:    case ELEMENT_BUSCONFIG:
        -: 1852:    case ELEMENT_POLICY:
        -: 1853:    case ELEMENT_ALLOW:
        -: 1854:    case ELEMENT_DENY:
        -: 1855:    case ELEMENT_FORK:
        -: 1856:    case ELEMENT_SELINUX:
        -: 1857:    case ELEMENT_ASSOCIATE:
        -: 1858:      break;
        -: 1859:    }
        -: 1860:
      252: 1861:  pop_element (parser);
call    0 returned 100%
        -: 1862:
      252: 1863:  return TRUE;
        -: 1864:}
        -: 1865:
        -: 1866:static dbus_bool_t
        -: 1867:all_whitespace (const DBusString *str)
function all_whitespace called 289 returned 100% blocks executed 100%
      289: 1868:{
        -: 1869:  int i;
        -: 1870:
      289: 1871:  _dbus_string_skip_white (str, 0, &i);
call    0 returned 100%
        -: 1872:
      289: 1873:  return i == _dbus_string_get_length (str);
call    0 returned 100%
        -: 1874:}
        -: 1875:
        -: 1876:static dbus_bool_t
        -: 1877:make_full_path (const DBusString *basedir,
        -: 1878:                const DBusString *filename,
        -: 1879:                DBusString       *full_path)
function make_full_path called 50 returned 100% blocks executed 83%
       50: 1880:{
       50: 1881:  if (_dbus_path_is_absolute (filename))
call    0 returned 100%
branch  1 taken 24% (fallthrough)
branch  2 taken 76%
        -: 1882:    {
       12: 1883:      return _dbus_string_copy (filename, 0, full_path, 0);
call    0 returned 100%
        -: 1884:    }
        -: 1885:  else
        -: 1886:    {
       38: 1887:      if (!_dbus_string_copy (basedir, 0, full_path, 0))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 1888:        return FALSE;
        -: 1889:      
       38: 1890:      if (!_dbus_concat_dir_and_file (full_path, filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 1891:        return FALSE;
        -: 1892:
       38: 1893:      return TRUE;
        -: 1894:    }
        -: 1895:}
        -: 1896:
        -: 1897:static dbus_bool_t
        -: 1898:include_file (BusConfigParser   *parser,
        -: 1899:              const DBusString  *filename,
        -: 1900:              dbus_bool_t        ignore_missing,
        -: 1901:              DBusError         *error)
function include_file called 27 returned 100% blocks executed 87%
       27: 1902:{
        -: 1903:  /* FIXME good test case for this would load each config file in the
        -: 1904:   * test suite both alone, and as an include, and check
        -: 1905:   * that the result is the same
        -: 1906:   */
        -: 1907:  BusConfigParser *included;
        -: 1908:  const char *filename_str;
        -: 1909:  DBusError tmp_error;
        -: 1910:        
       27: 1911:  dbus_error_init (&tmp_error);
call    0 returned 100%
        -: 1912:
       27: 1913:  filename_str = _dbus_string_get_const_data (filename);
call    0 returned 100%
        -: 1914:
        -: 1915:  /* Check to make sure this file hasn't already been included. */
       27: 1916:  if (seen_include (parser, filename))
call    0 returned 100%
branch  1 taken 11% (fallthrough)
branch  2 taken 89%
        -: 1917:    {
        3: 1918:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 returned 100%
        -: 1919:		      "Circular inclusion of file '%s'",
        -: 1920:		      filename_str);
        3: 1921:      return FALSE;
        -: 1922:    }
        -: 1923:  
       24: 1924:  if (! _dbus_list_append (&parser->included_files, (void *) filename_str))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1925:    {
    #####: 1926:      BUS_SET_OOM (error);
call    0 never executed
    #####: 1927:      return FALSE;
        -: 1928:    }
        -: 1929:
        -: 1930:  /* Since parser is passed in as the parent, included
        -: 1931:     inherits parser's limits. */
       24: 1932:  included = bus_config_load (filename, FALSE, parser, &tmp_error);
call    0 returned 100%
        -: 1933:
       24: 1934:  _dbus_list_pop_last (&parser->included_files);
call    0 returned 100%
        -: 1935:
       24: 1936:  if (included == NULL)
branch  0 taken 88% (fallthrough)
branch  1 taken 13%
        -: 1937:    {
       21: 1938:      _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
call    0 returned 100%
call    1 returned 100%
        -: 1939:
       21: 1940:      if (dbus_error_has_name (&tmp_error, DBUS_ERROR_FILE_NOT_FOUND) &&
call    0 returned 100%
branch  1 taken 76% (fallthrough)
branch  2 taken 24%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
        -: 1941:          ignore_missing)
        -: 1942:        {
       16: 1943:          dbus_error_free (&tmp_error);
call    0 returned 100%
       16: 1944:          return TRUE;
        -: 1945:        }
        -: 1946:      else
        -: 1947:        {
        5: 1948:          dbus_move_error (&tmp_error, error);
call    0 returned 100%
        5: 1949:          return FALSE;
        -: 1950:        }
        -: 1951:    }
        -: 1952:  else
        -: 1953:    {
        3: 1954:      _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
call    0 returned 100%
call    1 returned 100%
        -: 1955:
        3: 1956:      if (!merge_included (parser, included, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1957:        {
    #####: 1958:          bus_config_parser_unref (included);
call    0 never executed
    #####: 1959:          return FALSE;
        -: 1960:        }
        -: 1961:
        -: 1962:      /* Copy included's limits back to parser. */
        3: 1963:      parser->limits = included->limits;
        -: 1964:
        3: 1965:      bus_config_parser_unref (included);
call    0 returned 100%
        3: 1966:      return TRUE;
        -: 1967:    }
        -: 1968:}
        -: 1969:
        -: 1970:static dbus_bool_t
        -: 1971:include_dir (BusConfigParser   *parser,
        -: 1972:             const DBusString  *dirname,
        -: 1973:             DBusError         *error)
function include_dir called 18 returned 100% blocks executed 63%
       18: 1974:{
        -: 1975:  DBusString filename;
        -: 1976:  dbus_bool_t retval;
        -: 1977:  DBusError tmp_error;
        -: 1978:  DBusDirIter *dir;
        -: 1979:  char *s;
        -: 1980:  
       18: 1981:  if (!_dbus_string_init (&filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 1982:    {
    #####: 1983:      BUS_SET_OOM (error);
call    0 never executed
    #####: 1984:      return FALSE;
        -: 1985:    }
        -: 1986:
       18: 1987:  retval = FALSE;
        -: 1988:  
       18: 1989:  dir = _dbus_directory_open (dirname, error);
call    0 returned 100%
        -: 1990:
       18: 1991:  if (dir == NULL)
branch  0 taken 56% (fallthrough)
branch  1 taken 44%
       10: 1992:    goto failed;
        -: 1993:
        8: 1994:  dbus_error_init (&tmp_error);
call    0 returned 100%
       32: 1995:  while (_dbus_directory_get_next_file (dir, &filename, &tmp_error))
call    0 returned 100%
branch  1 taken 67%
branch  2 taken 33% (fallthrough)
        -: 1996:    {
        -: 1997:      DBusString full_path;
        -: 1998:
       16: 1999:      if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2000:        {
    #####: 2001:          BUS_SET_OOM (error);
call    0 never executed
    #####: 2002:          goto failed;
        -: 2003:        }
        -: 2004:
       16: 2005:      if (!_dbus_string_copy (dirname, 0, &full_path, 0))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2006:        {
    #####: 2007:          BUS_SET_OOM (error);
call    0 never executed
    #####: 2008:          _dbus_string_free (&full_path);
call    0 never executed
    #####: 2009:          goto failed;
        -: 2010:        }      
        -: 2011:
       16: 2012:      if (!_dbus_concat_dir_and_file (&full_path, &filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2013:        {
    #####: 2014:          BUS_SET_OOM (error);
call    0 never executed
    #####: 2015:          _dbus_string_free (&full_path);
call    0 never executed
    #####: 2016:          goto failed;
        -: 2017:        }
        -: 2018:      
       16: 2019:      if (_dbus_string_ends_with_c_str (&full_path, ".conf"))
call    0 returned 100%
branch  1 taken 50% (fallthrough)
branch  2 taken 50%
        -: 2020:        {
        8: 2021:          if (!include_file (parser, &full_path, TRUE, error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2022:            {
    #####: 2023:              _dbus_string_free (&full_path);
call    0 never executed
    #####: 2024:              goto failed;
        -: 2025:            }
        -: 2026:        }
        -: 2027:
       16: 2028:      _dbus_string_free (&full_path);
call    0 returned 100%
        -: 2029:    }
        -: 2030:
        8: 2031:  if (dbus_error_is_set (&tmp_error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2032:    {
    #####: 2033:      dbus_move_error (&tmp_error, error);
call    0 never executed
    #####: 2034:      goto failed;
        -: 2035:    }
        -: 2036:
        -: 2037:
        8: 2038:  if (!_dbus_string_copy_data (dirname, &s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2039:    {
    #####: 2040:      BUS_SET_OOM (error);
call    0 never executed
    #####: 2041:      goto failed;
        -: 2042:    }
        -: 2043:
        8: 2044:  if (!_dbus_list_append (&parser->conf_dirs, s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2045:    {
    #####: 2046:      dbus_free (s);
call    0 never executed
    #####: 2047:      BUS_SET_OOM (error);
call    0 never executed
    #####: 2048:      goto failed;
        -: 2049:    }
        -: 2050:
        8: 2051:  retval = TRUE;
        -: 2052:  
       18: 2053: failed:
       18: 2054:  _dbus_string_free (&filename);
call    0 returned 100%
        -: 2055:  
       18: 2056:  if (dir)
branch  0 taken 44% (fallthrough)
branch  1 taken 56%
        8: 2057:    _dbus_directory_close (dir);
call    0 returned 100%
        -: 2058:
       18: 2059:  return retval;
        -: 2060:}
        -: 2061:
        -: 2062:dbus_bool_t
        -: 2063:bus_config_parser_content (BusConfigParser   *parser,
        -: 2064:                           const DBusString  *content,
        -: 2065:                           DBusError         *error)
function bus_config_parser_content called 452 returned 100% blocks executed 62%
      452: 2066:{
        -: 2067:  Element *e;
        -: 2068:
      452: 2069:  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
call    5 returned 100%
        -: 2070:
        -: 2071:#if 0
        -: 2072:  {
        -: 2073:    const char *c_str;
        -: 2074:    
        -: 2075:    _dbus_string_get_const_data (content, &c_str);
        -: 2076:
        -: 2077:    printf ("CONTENT %d bytes: %s\n", _dbus_string_get_length (content), c_str);
        -: 2078:  }
        -: 2079:#endif
        -: 2080:  
      452: 2081:  e = peek_element (parser);
call    0 returned 100%
      452: 2082:  if (e == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2083:    {
    #####: 2084:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 2085:                      "Text content outside of any XML element in configuration file");
    #####: 2086:      return FALSE;
        -: 2087:    }
      452: 2088:  else if (e->had_content)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2089:    {
    #####: 2090:      _dbus_assert_not_reached ("Element had multiple content blocks");
call    0 never executed
        -: 2091:      return FALSE;
        -: 2092:    }
        -: 2093:
      452: 2094:  switch (top_element_type (parser))
call    0 returned 100%
branch  1 taken 0%
branch  2 taken 64%
branch  3 taken 1%
branch  4 taken 5%
branch  5 taken 4%
branch  6 taken 4%
branch  7 taken 1%
branch  8 taken 10%
branch  9 taken 1%
branch 10 taken 3%
branch 11 taken 9%
branch 12 taken 0%
        -: 2095:    {
        -: 2096:    case ELEMENT_NONE:
    #####: 2097:      _dbus_assert_not_reached ("element at top of stack has no type");
call    0 never executed
        -: 2098:      return FALSE;
        -: 2099:
        -: 2100:    case ELEMENT_BUSCONFIG:
        -: 2101:    case ELEMENT_POLICY:
        -: 2102:    case ELEMENT_ALLOW:
        -: 2103:    case ELEMENT_DENY:
        -: 2104:    case ELEMENT_FORK:
        -: 2105:    case ELEMENT_SELINUX:
        -: 2106:    case ELEMENT_ASSOCIATE:
      289: 2107:      if (all_whitespace (content))
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
      289: 2108:        return TRUE;
        -: 2109:      else
        -: 2110:        {
    #####: 2111:          dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
call    1 never executed
call    2 never executed
        -: 2112:                          "No text content expected inside XML element %s in configuration file",
        -: 2113:                          element_type_to_name (top_element_type (parser)));
    #####: 2114:          return FALSE;
        -: 2115:        }
        -: 2116:
        -: 2117:    case ELEMENT_PIDFILE:
        -: 2118:      {
        -: 2119:        char *s;
        -: 2120:
        1: 2121:        e->had_content = TRUE;
        -: 2122:        
        1: 2123:        if (!_dbus_string_copy_data (content, &s))
call    0 returned 100%
branch  1 taken 100% (fallthrough)
branch  2 taken 0%
    #####: 2124:          goto nomem;
        -: 2125:          
        1: 2126:        dbus_free (parser->pidfile);
call    0 returned 100%
        1: 2127:        parser->pidfile = s;
        -: 2128:      }
        1: 2129:      break;
        -: 2130:
        -: 2131:    case ELEMENT_INCLUDE:
        -: 2132:      {
        -: 2133:        DBusString full_path, selinux_policy_root;
        -: 2134:
       21: 2135:        e->had_content = TRUE;
        -: 2136:
       21: 2137:	if (e->d.include.if_selinux_enabled
branch  0 taken 10% (fallthrough)
branch  1 taken 90%
call    2 returned 100%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
        -: 2138:	    && !bus_selinux_enabled ())
        2: 2139:	  break;
        -: 2140:
       19: 2141:        if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2142:          goto nomem;
        -: 2143:
       19: 2144:        if (e->d.include.selinux_root_relative)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2145:	  {
    #####: 2146:            if (!bus_selinux_get_policy_root ())
call    0 never executed
branch  1 never executed
branch  2 never executed
        -: 2147:	      {
    #####: 2148:		dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 2149:				"Could not determine SELinux policy root for relative inclusion");
    #####: 2150:		_dbus_string_free (&full_path);
call    0 never executed
    #####: 2151:		return FALSE;
        -: 2152:	      }
    #####: 2153:            _dbus_string_init_const (&selinux_policy_root,
call    0 never executed
call    1 never executed
        -: 2154:                                     bus_selinux_get_policy_root ());
    #####: 2155:            if (!make_full_path (&selinux_policy_root, content, &full_path))
call    0 never executed
branch  1 never executed
branch  2 never executed
        -: 2156:              {
    #####: 2157:                _dbus_string_free (&full_path);
call    0 never executed
    #####: 2158:                goto nomem;
        -: 2159:              }
        -: 2160:          }
       19: 2161:        else if (!make_full_path (&parser->basedir, content, &full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2162:          {
    #####: 2163:            _dbus_string_free (&full_path);
call    0 never executed
    #####: 2164:            goto nomem;
        -: 2165:          }
        -: 2166:
       19: 2167:        if (!include_file (parser, &full_path,
call    0 returned 100%
branch  1 taken 42% (fallthrough)
branch  2 taken 58%
        -: 2168:                           e->d.include.ignore_missing, error))
        -: 2169:          {
        8: 2170:            _dbus_string_free (&full_path);
call    0 returned 100%
        8: 2171:            return FALSE;
        -: 2172:          }
        -: 2173:
       11: 2174:        _dbus_string_free (&full_path);
call    0 returned 100%
        -: 2175:      }
       11: 2176:      break;
        -: 2177:
        -: 2178:    case ELEMENT_INCLUDEDIR:
        -: 2179:      {
        -: 2180:        DBusString full_path;
        -: 2181:        
       18: 2182:        e->had_content = TRUE;
        -: 2183:
       18: 2184:        if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2185:          goto nomem;
        -: 2186:        
       18: 2187:        if (!make_full_path (&parser->basedir, content, &full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2188:          {
    #####: 2189:            _dbus_string_free (&full_path);
call    0 never executed
    #####: 2190:            goto nomem;
        -: 2191:          }
        -: 2192:        
       18: 2193:        if (!include_dir (parser, &full_path, error))
call    0 returned 100%
branch  1 taken 56% (fallthrough)
branch  2 taken 44%
        -: 2194:          {
       10: 2195:            _dbus_string_free (&full_path);
call    0 returned 100%
       10: 2196:            return FALSE;
        -: 2197:          }
        -: 2198:
        8: 2199:        _dbus_string_free (&full_path);
call    0 returned 100%
        -: 2200:      }
        8: 2201:      break;
        -: 2202:      
        -: 2203:    case ELEMENT_USER:
        -: 2204:      {
        -: 2205:        char *s;
        -: 2206:
       18: 2207:        e->had_content = TRUE;
        -: 2208:        
       18: 2209:        if (!_dbus_string_copy_data (content, &s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2210:          goto nomem;
        -: 2211:          
       18: 2212:        dbus_free (parser->user);
call    0 returned 100%
       18: 2213:        parser->user = s;
        -: 2214:      }
       18: 2215:      break;
        -: 2216:
        -: 2217:    case ELEMENT_TYPE:
        -: 2218:      {
        -: 2219:        char *s;
        -: 2220:
        3: 2221:        e->had_content = TRUE;
        -: 2222:
        3: 2223:        if (!_dbus_string_copy_data (content, &s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2224:          goto nomem;
        -: 2225:        
        3: 2226:        dbus_free (parser->bus_type);
call    0 returned 100%
        3: 2227:        parser->bus_type = s;
        -: 2228:      }
        3: 2229:      break;
        -: 2230:      
        -: 2231:    case ELEMENT_LISTEN:
        -: 2232:      {
        -: 2233:        char *s;
        -: 2234:
       45: 2235:        e->had_content = TRUE;
        -: 2236:        
       45: 2237:        if (!_dbus_string_copy_data (content, &s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2238:          goto nomem;
        -: 2239:
       45: 2240:        if (!_dbus_list_append (&parser->listen_on,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2241:                                s))
        -: 2242:          {
    #####: 2243:            dbus_free (s);
call    0 never executed
    #####: 2244:            goto nomem;
        -: 2245:          }
        -: 2246:      }
       45: 2247:      break;
        -: 2248:
        -: 2249:    case ELEMENT_AUTH:
        -: 2250:      {
        -: 2251:        char *s;
        -: 2252:        
        3: 2253:        e->had_content = TRUE;
        -: 2254:
        3: 2255:        if (!_dbus_string_copy_data (content, &s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2256:          goto nomem;
        -: 2257:
        3: 2258:        if (!_dbus_list_append (&parser->mechanisms,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2259:                                s))
        -: 2260:          {
    #####: 2261:            dbus_free (s);
call    0 never executed
    #####: 2262:            goto nomem;
        -: 2263:          }
        -: 2264:      }
        3: 2265:      break;
        -: 2266:
        -: 2267:    case ELEMENT_SERVICEDIR:
        -: 2268:      {
        -: 2269:        char *s;
        -: 2270:        DBusString full_path;
        -: 2271:        
       13: 2272:        e->had_content = TRUE;
        -: 2273:
       13: 2274:        if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2275:          goto nomem;
        -: 2276:        
       13: 2277:        if (!make_full_path (&parser->basedir, content, &full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2278:          {
    #####: 2279:            _dbus_string_free (&full_path);
call    0 never executed
    #####: 2280:            goto nomem;
        -: 2281:          }
        -: 2282:        
       13: 2283:        if (!_dbus_string_copy_data (&full_path, &s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2284:          {
    #####: 2285:            _dbus_string_free (&full_path);
call    0 never executed
    #####: 2286:            goto nomem;
        -: 2287:          }
        -: 2288:
       13: 2289:        if (!_dbus_list_append (&parser->service_dirs, s))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2290:          {
    #####: 2291:            _dbus_string_free (&full_path);
call    0 never executed
    #####: 2292:            dbus_free (s);
call    0 never executed
    #####: 2293:            goto nomem;
        -: 2294:          }
        -: 2295:
       13: 2296:        _dbus_string_free (&full_path);
call    0 returned 100%
        -: 2297:      }
       13: 2298:      break;
        -: 2299:
        -: 2300:    case ELEMENT_LIMIT:
        -: 2301:      {
        -: 2302:        long val;
        -: 2303:
       41: 2304:        e->had_content = TRUE;
        -: 2305:
       41: 2306:        val = 0;
       41: 2307:        if (!_dbus_string_parse_int (content, 0, &val, NULL))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2308:          {
    #####: 2309:            dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 2310:                            "<limit name=\"%s\"> element has invalid value (could not parse as integer)",
        -: 2311:                            e->d.limit.name);
    #####: 2312:            return FALSE;
        -: 2313:          }
        -: 2314:
       41: 2315:        e->d.limit.value = val;
        -: 2316:
       41: 2317:        _dbus_verbose ("Loaded value %ld for limit %s\n",
call    0 returned 100%
        -: 2318:                       e->d.limit.value,
        -: 2319:                       e->d.limit.name);
        -: 2320:      }
        -: 2321:      break;
        -: 2322:    }
        -: 2323:
      145: 2324:  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
call    5 returned 100%
      145: 2325:  return TRUE;
        -: 2326:
    #####: 2327: nomem:
    #####: 2328:  BUS_SET_OOM (error);
call    0 never executed
    #####: 2329:  return FALSE;
        -: 2330:}
        -: 2331:
        -: 2332:dbus_bool_t
        -: 2333:bus_config_parser_finished (BusConfigParser   *parser,
        -: 2334:                            DBusError         *error)
function bus_config_parser_finished called 17 returned 100% blocks executed 59%
       17: 2335:{
       17: 2336:  _DBUS_ASSERT_ERROR_IS_CLEAR (error);
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 100% (fallthrough)
branch  4 taken 0%
call    5 returned 100%
        -: 2337:
       17: 2338:  if (parser->stack != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2339:    {
    #####: 2340:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
call    1 never executed
call    2 never executed
        -: 2341:                      "Element <%s> was not closed in configuration file",
        -: 2342:                      element_type_to_name (top_element_type (parser)));
        -: 2343:
    #####: 2344:      return FALSE;
        -: 2345:    }
        -: 2346:
       17: 2347:  if (parser->is_toplevel && parser->listen_on == NULL)
branch  0 taken 82% (fallthrough)
branch  1 taken 18%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
        -: 2348:    {
    #####: 2349:      dbus_set_error (error, DBUS_ERROR_FAILED,
call    0 never executed
        -: 2350:                      "Configuration file needs one or more <listen> elements giving addresses"); 
    #####: 2351:      return FALSE;
        -: 2352:    }
        -: 2353:  
       17: 2354:  return TRUE;
        -: 2355:}
        -: 2356:
        -: 2357:const char*
        -: 2358:bus_config_parser_get_user (BusConfigParser *parser)
function bus_config_parser_get_user called 3 returned 100% blocks executed 100%
        3: 2359:{
        3: 2360:  return parser->user;
        -: 2361:}
        -: 2362:
        -: 2363:const char*
        -: 2364:bus_config_parser_get_type (BusConfigParser *parser)
function bus_config_parser_get_type called 6 returned 100% blocks executed 100%
        6: 2365:{
        6: 2366:  return parser->bus_type;
        -: 2367:}
        -: 2368:
        -: 2369:DBusList**
        -: 2370:bus_config_parser_get_addresses (BusConfigParser *parser)
function bus_config_parser_get_addresses called 3 returned 100% blocks executed 100%
        3: 2371:{
        3: 2372:  return &parser->listen_on;
        -: 2373:}
        -: 2374:
        -: 2375:DBusList**
        -: 2376:bus_config_parser_get_mechanisms (BusConfigParser *parser)
function bus_config_parser_get_mechanisms called 3 returned 100% blocks executed 100%
        3: 2377:{
        3: 2378:  return &parser->mechanisms;
        -: 2379:}
        -: 2380:
        -: 2381:DBusList**
        -: 2382:bus_config_parser_get_service_dirs (BusConfigParser *parser)
function bus_config_parser_get_service_dirs called 3 returned 100% blocks executed 100%
        3: 2383:{
        3: 2384:  return &parser->service_dirs;
        -: 2385:}
        -: 2386:
        -: 2387:DBusList**
        -: 2388:bus_config_parser_get_conf_dirs (BusConfigParser *parser)
function bus_config_parser_get_conf_dirs called 3 returned 100% blocks executed 100%
        3: 2389:{
        3: 2390:  return &parser->conf_dirs;
        -: 2391:}
        -: 2392:
        -: 2393:dbus_bool_t
        -: 2394:bus_config_parser_get_fork (BusConfigParser   *parser)
function bus_config_parser_get_fork called 3 returned 100% blocks executed 100%
        3: 2395:{
        3: 2396:  return parser->fork;
        -: 2397:}
        -: 2398:
        -: 2399:const char *
        -: 2400:bus_config_parser_get_pidfile (BusConfigParser   *parser)
function bus_config_parser_get_pidfile called 3 returned 100% blocks executed 100%
        3: 2401:{
        3: 2402:  return parser->pidfile;
        -: 2403:}
        -: 2404:
        -: 2405:BusPolicy*
        -: 2406:bus_config_parser_steal_policy (BusConfigParser *parser)
function bus_config_parser_steal_policy called 3 returned 100% blocks executed 100%
        3: 2407:{
        -: 2408:  BusPolicy *policy;
        -: 2409:
        3: 2410:  _dbus_assert (parser->policy != NULL); /* can only steal the policy 1 time */
call    0 returned 100%
        -: 2411:  
        3: 2412:  policy = parser->policy;
        -: 2413:
        3: 2414:  parser->policy = NULL;
        -: 2415:
        3: 2416:  return policy;
        -: 2417:}
        -: 2418:
        -: 2419:/* Overwrite any limits that were set in the configuration file */
        -: 2420:void
        -: 2421:bus_config_parser_get_limits (BusConfigParser *parser,
        -: 2422:                              BusLimits       *limits)
function bus_config_parser_get_limits called 3 returned 100% blocks executed 100%
        3: 2423:{
        3: 2424:  *limits = parser->limits;
        3: 2425:}
        -: 2426:
        -: 2427:DBusHashTable*
        -: 2428:bus_config_parser_steal_service_context_table (BusConfigParser *parser)
function bus_config_parser_steal_service_context_table called 3 returned 100% blocks executed 100%
        3: 2429:{
        -: 2430:  DBusHashTable *table;
        -: 2431:
        3: 2432:  _dbus_assert (parser->service_context_table != NULL); /* can only steal once */
call    0 returned 100%
        -: 2433:
        3: 2434:  table = parser->service_context_table;
        -: 2435:
        3: 2436:  parser->service_context_table = NULL;
        -: 2437:
        3: 2438:  return table;
        -: 2439:}
        -: 2440:
        -: 2441:#ifdef DBUS_BUILD_TESTS
        -: 2442:#include <stdio.h>
        -: 2443:
        -: 2444:typedef enum
        -: 2445:{
        -: 2446:  VALID,
        -: 2447:  INVALID,
        -: 2448:  UNKNOWN
        -: 2449:} Validity;
        -: 2450:
        -: 2451:static dbus_bool_t
        -: 2452:do_load (const DBusString *full_path,
        -: 2453:         Validity          validity,
        -: 2454:         dbus_bool_t       oom_possible)
function do_load called 14 returned 100% blocks executed 68%
       14: 2455:{
        -: 2456:  BusConfigParser *parser;
        -: 2457:  DBusError error;
        -: 2458:
       14: 2459:  dbus_error_init (&error);
call    0 returned 100%
        -: 2460:
       14: 2461:  parser = bus_config_load (full_path, TRUE, NULL, &error);
call    0 returned 100%
       14: 2462:  if (parser == NULL)
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
        -: 2463:    {
        7: 2464:      _DBUS_ASSERT_ERROR_IS_SET (&error);
call    0 returned 100%
call    1 returned 100%
        -: 2465:
        7: 2466:      if (oom_possible &&
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 0% (fallthrough)
branch  4 taken 100%
        -: 2467:          dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
        -: 2468:        {
    #####: 2469:          _dbus_verbose ("Failed to load valid file due to OOM\n");
call    0 never executed
    #####: 2470:          dbus_error_free (&error);
call    0 never executed
    #####: 2471:          return TRUE;
        -: 2472:        }
        7: 2473:      else if (validity == VALID)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2474:        {
    #####: 2475:          _dbus_warn ("Failed to load valid file but still had memory: %s\n",
call    0 never executed
        -: 2476:                      error.message);
        -: 2477:
    #####: 2478:          dbus_error_free (&error);
call    0 never executed
    #####: 2479:          return FALSE;
        -: 2480:        }
        -: 2481:      else
        -: 2482:        {
        7: 2483:          dbus_error_free (&error);
call    0 returned 100%
        7: 2484:          return TRUE;
        -: 2485:        }
        -: 2486:    }
        -: 2487:  else
        -: 2488:    {
        7: 2489:      _DBUS_ASSERT_ERROR_IS_CLEAR (&error);
call    0 returned 100%
call    1 returned 100%
        -: 2490:
        7: 2491:      bus_config_parser_unref (parser);
call    0 returned 100%
        -: 2492:
        7: 2493:      if (validity == INVALID)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2494:        {
    #####: 2495:          _dbus_warn ("Accepted invalid file\n");
call    0 never executed
    #####: 2496:          return FALSE;
        -: 2497:        }
        -: 2498:
        7: 2499:      return TRUE;
        -: 2500:    }
        -: 2501:}
        -: 2502:
        -: 2503:typedef struct
        -: 2504:{
        -: 2505:  const DBusString *full_path;
        -: 2506:  Validity          validity;
        -: 2507:} LoaderOomData;
        -: 2508:
        -: 2509:static dbus_bool_t
        -: 2510:check_loader_oom_func (void *data)
function check_loader_oom_func called 14 returned 100% blocks executed 100%
       14: 2511:{
       14: 2512:  LoaderOomData *d = data;
        -: 2513:
       14: 2514:  return do_load (d->full_path, d->validity, TRUE);
call    0 returned 100%
        -: 2515:}
        -: 2516:
        -: 2517:static dbus_bool_t
        -: 2518:process_test_valid_subdir (const DBusString *test_base_dir,
        -: 2519:                           const char       *subdir,
        -: 2520:                           Validity          validity)
function process_test_valid_subdir called 2 returned 100% blocks executed 71%
        2: 2521:{
        -: 2522:  DBusString test_directory;
        -: 2523:  DBusString filename;
        -: 2524:  DBusDirIter *dir;
        -: 2525:  dbus_bool_t retval;
        -: 2526:  DBusError error;
        -: 2527:
        2: 2528:  retval = FALSE;
        2: 2529:  dir = NULL;
        -: 2530:
        2: 2531:  if (!_dbus_string_init (&test_directory))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2532:    _dbus_assert_not_reached ("didn't allocate test_directory\n");
call    0 never executed
        -: 2533:
        2: 2534:  _dbus_string_init_const (&filename, subdir);
call    0 returned 100%
        -: 2535:
        2: 2536:  if (!_dbus_string_copy (test_base_dir, 0,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2537:                          &test_directory, 0))
    #####: 2538:    _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
call    0 never executed
        -: 2539:
        2: 2540:  if (!_dbus_concat_dir_and_file (&test_directory, &filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2541:    _dbus_assert_not_reached ("couldn't allocate full path");
call    0 never executed
        -: 2542:
        2: 2543:  _dbus_string_free (&filename);
call    0 returned 100%
        2: 2544:  if (!_dbus_string_init (&filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2545:    _dbus_assert_not_reached ("didn't allocate filename string\n");
call    0 never executed
        -: 2546:
        2: 2547:  dbus_error_init (&error);
call    0 returned 100%
        2: 2548:  dir = _dbus_directory_open (&test_directory, &error);
call    0 returned 100%
        2: 2549:  if (dir == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2550:    {
    #####: 2551:      _dbus_warn ("Could not open %s: %s\n",
call    0 never executed
call    1 never executed
        -: 2552:                  _dbus_string_get_const_data (&test_directory),
        -: 2553:                  error.message);
    #####: 2554:      dbus_error_free (&error);
call    0 never executed
    #####: 2555:      goto failed;
        -: 2556:    }
        -: 2557:
        2: 2558:  if (validity == VALID)
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
        1: 2559:    printf ("Testing valid files:\n");
call    0 returned 100%
        1: 2560:  else if (validity == INVALID)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        1: 2561:    printf ("Testing invalid files:\n");
call    0 returned 100%
        -: 2562:  else
    #####: 2563:    printf ("Testing unknown files:\n");
call    0 never executed
        -: 2564:
        9: 2565: next:
       32: 2566:  while (_dbus_directory_get_next_file (dir, &filename, &error))
call    0 returned 100%
branch  1 taken 91%
branch  2 taken 9% (fallthrough)
        -: 2567:    {
        -: 2568:      DBusString full_path;
        -: 2569:      LoaderOomData d;
        -: 2570:
       21: 2571:      if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2572:        _dbus_assert_not_reached ("couldn't init string");
call    0 never executed
        -: 2573:
       21: 2574:      if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2575:        _dbus_assert_not_reached ("couldn't copy dir to full_path");
call    0 never executed
        -: 2576:
       21: 2577:      if (!_dbus_concat_dir_and_file (&full_path, &filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2578:        _dbus_assert_not_reached ("couldn't concat file to dir");
call    0 never executed
        -: 2579:
       21: 2580:      if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
call    0 returned 100%
branch  1 taken 33% (fallthrough)
branch  2 taken 67%
        -: 2581:        {
        7: 2582:          _dbus_verbose ("Skipping non-.conf file %s\n",
call    0 returned 100%
call    1 returned 100%
        -: 2583:                         _dbus_string_get_const_data (&filename));
        7: 2584:          _dbus_string_free (&full_path);
call    0 returned 100%
        7: 2585:          goto next;
        -: 2586:        }
        -: 2587:
       14: 2588:      printf ("    %s\n", _dbus_string_get_const_data (&filename));
call    0 returned 100%
call    1 returned 100%
        -: 2589:
       14: 2590:      _dbus_verbose (" expecting %s\n",
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
branch  4 never executed
branch  5 never executed
call    6 returned 100%
        -: 2591:                     validity == VALID ? "valid" :
        -: 2592:                     (validity == INVALID ? "invalid" :
        -: 2593:                      (validity == UNKNOWN ? "unknown" : "???")));
        -: 2594:
       14: 2595:      d.full_path = &full_path;
       14: 2596:      d.validity = validity;
        -: 2597:
        -: 2598:      /* FIXME hackaround for an expat problem, see
        -: 2599:       * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124747
        -: 2600:       * http://freedesktop.org/pipermail/dbus/2004-May/001153.html
        -: 2601:       */
        -: 2602:      /* if (!_dbus_test_oom_handling ("config-loader", check_loader_oom_func, &d)) */
       14: 2603:      if (!check_loader_oom_func (&d))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2604:        _dbus_assert_not_reached ("test failed");
call    0 never executed
        -: 2605:      
       14: 2606:      _dbus_string_free (&full_path);
call    0 returned 100%
        -: 2607:    }
        -: 2608:
        2: 2609:  if (dbus_error_is_set (&error))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2610:    {
    #####: 2611:      _dbus_warn ("Could not get next file in %s: %s\n",
call    0 never executed
call    1 never executed
        -: 2612:                  _dbus_string_get_const_data (&test_directory),
        -: 2613:                  error.message);
    #####: 2614:      dbus_error_free (&error);
call    0 never executed
    #####: 2615:      goto failed;
        -: 2616:    }
        -: 2617:
        2: 2618:  retval = TRUE;
        -: 2619:
        2: 2620: failed:
        -: 2621:
        2: 2622:  if (dir)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        2: 2623:    _dbus_directory_close (dir);
call    0 returned 100%
        2: 2624:  _dbus_string_free (&test_directory);
call    0 returned 100%
        2: 2625:  _dbus_string_free (&filename);
call    0 returned 100%
        -: 2626:
        2: 2627:  return retval;
        -: 2628:}
        -: 2629:
        -: 2630:static dbus_bool_t
        -: 2631:bools_equal (dbus_bool_t a,
        -: 2632:	     dbus_bool_t b)
function bools_equal called 4 returned 100% blocks executed 100%
        4: 2633:{
        4: 2634:  return a ? b : !b;
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
        -: 2635:}
        -: 2636:
        -: 2637:static dbus_bool_t
        -: 2638:strings_equal_or_both_null (const char *a,
        -: 2639:                            const char *b)
function strings_equal_or_both_null called 4 returned 100% blocks executed 100%
        4: 2640:{
        4: 2641:  if (a == NULL || b == NULL)
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
branch  2 taken 0% (fallthrough)
branch  3 taken 100%
        2: 2642:    return a == b;
        -: 2643:  else
        2: 2644:    return !strcmp (a, b);
call    0 returned 100%
        -: 2645:}
        -: 2646:
        -: 2647:static dbus_bool_t
        -: 2648:elements_equal (const Element *a,
        -: 2649:		const Element *b)
function elements_equal called 0 returned 0% blocks executed 0%
    #####: 2650:{
    #####: 2651:  if (a->type != b->type)
branch  0 never executed
branch  1 never executed
    #####: 2652:    return FALSE;
        -: 2653:
    #####: 2654:  if (!bools_equal (a->had_content, b->had_content))
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####: 2655:    return FALSE;
        -: 2656:
    #####: 2657:  switch (a->type)
branch  0 never executed
branch  1 never executed
branch  2 never executed
branch  3 never executed
        -: 2658:    {
        -: 2659:
        -: 2660:    case ELEMENT_INCLUDE:
    #####: 2661:      if (!bools_equal (a->d.include.ignore_missing,
call    0 never executed
branch  1 never executed
branch  2 never executed
        -: 2662:			b->d.include.ignore_missing))
    #####: 2663:	return FALSE;
    #####: 2664:      break;
        -: 2665:
        -: 2666:    case ELEMENT_POLICY:
    #####: 2667:      if (a->d.policy.type != b->d.policy.type)
branch  0 never executed
branch  1 never executed
    #####: 2668:	return FALSE;
    #####: 2669:      if (a->d.policy.gid_uid_or_at_console != b->d.policy.gid_uid_or_at_console)
branch  0 never executed
branch  1 never executed
    #####: 2670:	return FALSE;
    #####: 2671:      break;
        -: 2672:
        -: 2673:    case ELEMENT_LIMIT:
    #####: 2674:      if (strcmp (a->d.limit.name, b->d.limit.name))
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####: 2675:	return FALSE;
    #####: 2676:      if (a->d.limit.value != b->d.limit.value)
branch  0 never executed
branch  1 never executed
    #####: 2677:	return FALSE;
        -: 2678:      break;
        -: 2679:
        -: 2680:    default:
        -: 2681:      /* do nothing */
        -: 2682:      break;
        -: 2683:    }
        -: 2684:
    #####: 2685:  return TRUE;
        -: 2686:
        -: 2687:}
        -: 2688:
        -: 2689:static dbus_bool_t
        -: 2690:lists_of_elements_equal (DBusList *a,
        -: 2691:			 DBusList *b)
function lists_of_elements_equal called 2 returned 100% blocks executed 37%
        2: 2692:{
        -: 2693:  DBusList *ia;
        -: 2694:  DBusList *ib;
        -: 2695:
        2: 2696:  ia = a;
        2: 2697:  ib = b;
        -: 2698:  
        4: 2699:  while (ia != NULL && ib != NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
        -: 2700:    {
    #####: 2701:      if (elements_equal (ia->data, ib->data))
call    0 never executed
branch  1 never executed
branch  2 never executed
    #####: 2702:	return FALSE;
    #####: 2703:      ia = _dbus_list_get_next_link (&a, ia);
branch  0 never executed
branch  1 never executed
    #####: 2704:      ib = _dbus_list_get_next_link (&b, ib);
branch  0 never executed
branch  1 never executed
        -: 2705:    }
        -: 2706:
        2: 2707:  return ia == NULL && ib == NULL;
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
        -: 2708:}
        -: 2709:
        -: 2710:static dbus_bool_t
        -: 2711:lists_of_c_strings_equal (DBusList *a,
        -: 2712:			  DBusList *b)
function lists_of_c_strings_equal called 6 returned 100% blocks executed 89%
        6: 2713:{
        -: 2714:  DBusList *ia;
        -: 2715:  DBusList *ib;
        -: 2716:
        6: 2717:  ia = a;
        6: 2718:  ib = b;
        -: 2719:  
       18: 2720:  while (ia != NULL && ib != NULL)
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
branch  2 taken 100%
branch  3 taken 0% (fallthrough)
        -: 2721:    {
        6: 2722:      if (strcmp (ia->data, ib->data))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2723:	return FALSE;
        6: 2724:      ia = _dbus_list_get_next_link (&a, ia);
branch  0 taken 33% (fallthrough)
branch  1 taken 67%
        6: 2725:      ib = _dbus_list_get_next_link (&b, ib);
branch  0 taken 33% (fallthrough)
branch  1 taken 67%
        -: 2726:    }
        -: 2727:
        6: 2728:  return ia == NULL && ib == NULL;
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
branch  2 taken 100% (fallthrough)
branch  3 taken 0%
        -: 2729:}
        -: 2730:
        -: 2731:static dbus_bool_t
        -: 2732:limits_equal (const BusLimits *a,
        -: 2733:	      const BusLimits *b)
function limits_equal called 2 returned 100% blocks executed 19%
        2: 2734:{
        2: 2735:  return
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
branch  2 never executed
branch  3 never executed
branch  4 never executed
branch  5 never executed
branch  6 never executed
branch  7 never executed
branch  8 never executed
branch  9 never executed
branch 10 never executed
branch 11 never executed
branch 12 never executed
branch 13 never executed
branch 14 never executed
branch 15 never executed
branch 16 never executed
branch 17 never executed
branch 18 never executed
branch 19 never executed
branch 20 never executed
branch 21 never executed
branch 22 never executed
branch 23 never executed
branch 24 never executed
branch 25 never executed
        -: 2736:    (a->max_incoming_bytes == b->max_incoming_bytes
        -: 2737:     || a->max_outgoing_bytes == b->max_outgoing_bytes
        -: 2738:     || a->max_message_size == b->max_message_size
        -: 2739:     || a->activation_timeout == b->activation_timeout
        -: 2740:     || a->auth_timeout == b->auth_timeout
        -: 2741:     || a->max_completed_connections == b->max_completed_connections
        -: 2742:     || a->max_incomplete_connections == b->max_incomplete_connections
        -: 2743:     || a->max_connections_per_user == b->max_connections_per_user
        -: 2744:     || a->max_pending_activations == b->max_pending_activations
        -: 2745:     || a->max_services_per_connection == b->max_services_per_connection
        -: 2746:     || a->max_match_rules_per_connection == b->max_match_rules_per_connection
        -: 2747:     || a->max_replies_per_connection == b->max_replies_per_connection
        -: 2748:     || a->reply_timeout == b->reply_timeout);
        -: 2749:}
        -: 2750:
        -: 2751:static dbus_bool_t
        -: 2752:config_parsers_equal (const BusConfigParser *a,
        -: 2753:                      const BusConfigParser *b)
function config_parsers_equal called 2 returned 100% blocks executed 69%
        2: 2754:{
        2: 2755:  if (!_dbus_string_equal (&a->basedir, &b->basedir))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2756:    return FALSE;
        -: 2757:
        2: 2758:  if (!lists_of_elements_equal (a->stack, b->stack))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2759:    return FALSE;
        -: 2760:
        2: 2761:  if (!strings_equal_or_both_null (a->user, b->user))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2762:    return FALSE;
        -: 2763:
        2: 2764:  if (!lists_of_c_strings_equal (a->listen_on, b->listen_on))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2765:    return FALSE;
        -: 2766:
        2: 2767:  if (!lists_of_c_strings_equal (a->mechanisms, b->mechanisms))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2768:    return FALSE;
        -: 2769:
        2: 2770:  if (!lists_of_c_strings_equal (a->service_dirs, b->service_dirs))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2771:    return FALSE;
        -: 2772:  
        -: 2773:  /* FIXME: compare policy */
        -: 2774:
        -: 2775:  /* FIXME: compare service selinux ID table */
        -: 2776:
        2: 2777:  if (! limits_equal (&a->limits, &b->limits))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2778:    return FALSE;
        -: 2779:
        2: 2780:  if (!strings_equal_or_both_null (a->pidfile, b->pidfile))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2781:    return FALSE;
        -: 2782:
        2: 2783:  if (! bools_equal (a->fork, b->fork))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2784:    return FALSE;
        -: 2785:
        2: 2786:  if (! bools_equal (a->is_toplevel, b->is_toplevel))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2787:    return FALSE;
        -: 2788:
        2: 2789:  return TRUE;
        -: 2790:}
        -: 2791:
        -: 2792:static dbus_bool_t
        -: 2793:all_are_equiv (const DBusString *target_directory)
function all_are_equiv called 2 returned 100% blocks executed 74%
        2: 2794:{
        -: 2795:  DBusString filename;
        -: 2796:  DBusDirIter *dir;
        -: 2797:  BusConfigParser *first_parser;
        -: 2798:  BusConfigParser *parser;
        -: 2799:  DBusError error;
        -: 2800:  dbus_bool_t equal;
        -: 2801:  dbus_bool_t retval;
        -: 2802:
        2: 2803:  dir = NULL;
        2: 2804:  first_parser = NULL;
        2: 2805:  parser = NULL;
        2: 2806:  retval = FALSE;
        -: 2807:
        2: 2808:  if (!_dbus_string_init (&filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2809:    _dbus_assert_not_reached ("didn't allocate filename string");
call    0 never executed
        -: 2810:
        2: 2811:  dbus_error_init (&error);
call    0 returned 100%
        2: 2812:  dir = _dbus_directory_open (target_directory, &error);
call    0 returned 100%
        2: 2813:  if (dir == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2814:    {
    #####: 2815:      _dbus_warn ("Could not open %s: %s\n",
call    0 never executed
call    1 never executed
        -: 2816:		  _dbus_string_get_const_data (target_directory),
        -: 2817:		  error.message);
    #####: 2818:      dbus_error_free (&error);
call    0 never executed
    #####: 2819:      goto finished;
        -: 2820:    }
        -: 2821:
        2: 2822:  printf ("Comparing equivalent files:\n");
call    0 returned 100%
        -: 2823:
        6: 2824: next:
       16: 2825:  while (_dbus_directory_get_next_file (dir, &filename, &error))
call    0 returned 100%
branch  1 taken 80%
branch  2 taken 20% (fallthrough)
        -: 2826:    {
        -: 2827:      DBusString full_path;
        -: 2828:
        8: 2829:      if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2830:	_dbus_assert_not_reached ("couldn't init string");
call    0 never executed
        -: 2831:
        8: 2832:      if (!_dbus_string_copy (target_directory, 0, &full_path, 0))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2833:        _dbus_assert_not_reached ("couldn't copy dir to full_path");
call    0 never executed
        -: 2834:
        8: 2835:      if (!_dbus_concat_dir_and_file (&full_path, &filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2836:        _dbus_assert_not_reached ("couldn't concat file to dir");
call    0 never executed
        -: 2837:
        8: 2838:      if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
call    0 returned 100%
branch  1 taken 50% (fallthrough)
branch  2 taken 50%
        -: 2839:        {
        4: 2840:          _dbus_verbose ("Skipping non-.conf file %s\n",
call    0 returned 100%
call    1 returned 100%
        -: 2841:                         _dbus_string_get_const_data (&filename));
        4: 2842:	  _dbus_string_free (&full_path);
call    0 returned 100%
        4: 2843:          goto next;
        -: 2844:        }
        -: 2845:
        4: 2846:      printf ("    %s\n", _dbus_string_get_const_data (&filename));
call    0 returned 100%
call    1 returned 100%
        -: 2847:
        4: 2848:      parser = bus_config_load (&full_path, TRUE, NULL, &error);
call    0 returned 100%
        -: 2849:
        4: 2850:      if (parser == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2851:	{
    #####: 2852:	  _dbus_warn ("Could not load file %s: %s\n",
call    0 never executed
call    1 never executed
        -: 2853:		      _dbus_string_get_const_data (&full_path),
        -: 2854:		      error.message);
    #####: 2855:          _dbus_string_free (&full_path);
call    0 never executed
    #####: 2856:	  dbus_error_free (&error);
call    0 never executed
    #####: 2857:	  goto finished;
        -: 2858:	}
        4: 2859:      else if (first_parser == NULL)
branch  0 taken 50% (fallthrough)
branch  1 taken 50%
        -: 2860:	{
        2: 2861:          _dbus_string_free (&full_path);
call    0 returned 100%
        2: 2862:	  first_parser = parser;
        -: 2863:	}
        -: 2864:      else
        -: 2865:	{
        2: 2866:          _dbus_string_free (&full_path);
call    0 returned 100%
        2: 2867:	  equal = config_parsers_equal (first_parser, parser);
call    0 returned 100%
        2: 2868:	  bus_config_parser_unref (parser);
call    0 returned 100%
        2: 2869:	  if (! equal)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 2870:	    goto finished;
        -: 2871:	}
        -: 2872:    }
        -: 2873:
        2: 2874:  retval = TRUE;
        -: 2875:
        2: 2876: finished:
        2: 2877:  _dbus_string_free (&filename);
call    0 returned 100%
        2: 2878:  if (first_parser)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        2: 2879:    bus_config_parser_unref (first_parser);
call    0 returned 100%
        2: 2880:  if (dir)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        2: 2881:    _dbus_directory_close (dir);
call    0 returned 100%
        -: 2882:
        2: 2883:  return retval;
        -: 2884:  
        -: 2885:}
        -: 2886:
        -: 2887:static dbus_bool_t
        -: 2888:process_test_equiv_subdir (const DBusString *test_base_dir,
        -: 2889:			   const char       *subdir)
function process_test_equiv_subdir called 1 returned 100% blocks executed 74%
        1: 2890:{
        -: 2891:  DBusString test_directory;
        -: 2892:  DBusString filename;
        -: 2893:  DBusDirIter *dir;
        -: 2894:  DBusError error;
        -: 2895:  dbus_bool_t equal;
        -: 2896:  dbus_bool_t retval;
        -: 2897:
        1: 2898:  dir = NULL;
        1: 2899:  retval = FALSE;
        -: 2900:
        1: 2901:  if (!_dbus_string_init (&test_directory))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2902:    _dbus_assert_not_reached ("didn't allocate test_directory");
call    0 never executed
        -: 2903:
        1: 2904:  _dbus_string_init_const (&filename, subdir);
call    0 returned 100%
        -: 2905:
        1: 2906:  if (!_dbus_string_copy (test_base_dir, 0,
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
        -: 2907:			  &test_directory, 0))
    #####: 2908:    _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
call    0 never executed
        -: 2909:
        1: 2910:  if (!_dbus_concat_dir_and_file (&test_directory, &filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2911:    _dbus_assert_not_reached ("couldn't allocate full path");
call    0 never executed
        -: 2912:
        1: 2913:  _dbus_string_free (&filename);
call    0 returned 100%
        1: 2914:  if (!_dbus_string_init (&filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2915:    _dbus_assert_not_reached ("didn't allocate filename string");
call    0 never executed
        -: 2916:
        1: 2917:  dbus_error_init (&error);
call    0 returned 100%
        1: 2918:  dir = _dbus_directory_open (&test_directory, &error);
call    0 returned 100%
        1: 2919:  if (dir == NULL)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
        -: 2920:    {
    #####: 2921:      _dbus_warn ("Could not open %s: %s\n",
call    0 never executed
call    1 never executed
        -: 2922:		  _dbus_string_get_const_data (&test_directory),
        -: 2923:		  error.message);
    #####: 2924:      dbus_error_free (&error);
call    0 never executed
    #####: 2925:      goto finished;
        -: 2926:    }
        -: 2927:
        5: 2928:  while (_dbus_directory_get_next_file (dir, &filename, &error))
call    0 returned 100%
branch  1 taken 75%
branch  2 taken 25% (fallthrough)
        -: 2929:    {
        -: 2930:      DBusString full_path;
        -: 2931:
        -: 2932:      /* Skip CVS's magic directories! */
        3: 2933:      if (_dbus_string_equal_c_str (&filename, "CVS"))
call    0 returned 100%
branch  1 taken 33% (fallthrough)
branch  2 taken 67%
        1: 2934:	continue;
        -: 2935:
        2: 2936:      if (!_dbus_string_init (&full_path))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2937:	_dbus_assert_not_reached ("couldn't init string");
call    0 never executed
        -: 2938:
        2: 2939:      if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2940:        _dbus_assert_not_reached ("couldn't copy dir to full_path");
call    0 never executed
        -: 2941:
        2: 2942:      if (!_dbus_concat_dir_and_file (&full_path, &filename))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2943:        _dbus_assert_not_reached ("couldn't concat file to dir");
call    0 never executed
        -: 2944:      
        2: 2945:      equal = all_are_equiv (&full_path);
call    0 returned 100%
        2: 2946:      _dbus_string_free (&full_path);
call    0 returned 100%
        -: 2947:
        2: 2948:      if (!equal)
branch  0 taken 0% (fallthrough)
branch  1 taken 100%
    #####: 2949:	goto finished;
        -: 2950:    }
        -: 2951:
        1: 2952:  retval = TRUE;
        -: 2953:
        1: 2954: finished:
        1: 2955:  _dbus_string_free (&test_directory);
call    0 returned 100%
        1: 2956:  _dbus_string_free (&filename);
call    0 returned 100%
        1: 2957:  if (dir)
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
        1: 2958:    _dbus_directory_close (dir);
call    0 returned 100%
        -: 2959:
        1: 2960:  return retval;
        -: 2961:  
        -: 2962:}
        -: 2963:			   
        -: 2964:dbus_bool_t
        -: 2965:bus_config_parser_test (const DBusString *test_data_dir)
function bus_config_parser_test called 1 returned 100% blocks executed 69%
        1: 2966:{
        1: 2967:  if (test_data_dir == NULL ||
branch  0 taken 100% (fallthrough)
branch  1 taken 0%
call    2 returned 100%
branch  3 taken 0% (fallthrough)
branch  4 taken 100%
        -: 2968:      _dbus_string_get_length (test_data_dir) == 0)
        -: 2969:    {
    #####: 2970:      printf ("No test data\n");
call    0 never executed
    #####: 2971:      return TRUE;
        -: 2972:    }
        -: 2973:
        1: 2974:  if (!process_test_valid_subdir (test_data_dir, "valid-config-files", VALID))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2975:    return FALSE;
        -: 2976:
        1: 2977:  if (!process_test_valid_subdir (test_data_dir, "invalid-config-files", INVALID))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2978:    return FALSE;
        -: 2979:
        1: 2980:  if (!process_test_equiv_subdir (test_data_dir, "equiv-config-files"))
call    0 returned 100%
branch  1 taken 0% (fallthrough)
branch  2 taken 100%
    #####: 2981:    return FALSE;
        -: 2982:
        1: 2983:  return TRUE;
        -: 2984:}
        -: 2985:
        -: 2986:#endif /* DBUS_BUILD_TESTS */
        -: 2987: