1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* config-parser.c XML-library-agnostic configuration file parser
4 * Copyright (C) 2003 Red Hat, Inc.
6 * Licensed under the Academic Free License version 1.2
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.
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.
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
23 #include "config-parser.h"
27 #include <dbus/dbus-list.h>
28 #include <dbus/dbus-internals.h>
54 unsigned int had_content : 1;
60 unsigned int ignore_missing : 1;
80 struct BusConfigParser
84 DBusString basedir; /**< Directory we resolve paths relative to */
86 DBusList *stack; /**< stack of Element */
88 char *user; /**< user to run as */
90 char *bus_type; /**< Message bus type */
92 DBusList *listen_on; /**< List of addresses to listen to */
94 DBusList *mechanisms; /**< Auth mechanisms */
96 DBusList *service_dirs; /**< Directories to look for services in */
98 BusPolicy *policy; /**< Security policy */
100 unsigned int fork : 1; /**< TRUE to fork into daemon mode */
106 element_type_to_name (ElementType type)
112 case ELEMENT_BUSCONFIG:
114 case ELEMENT_INCLUDE:
132 case ELEMENT_PIDFILE:
134 case ELEMENT_SERVICEDIR:
136 case ELEMENT_INCLUDEDIR:
142 _dbus_assert_not_reached ("bad element type");
148 push_element (BusConfigParser *parser,
153 _dbus_assert (type != ELEMENT_NONE);
155 e = dbus_new0 (Element, 1);
159 if (!_dbus_list_append (&parser->stack, e))
171 element_free (Element *e)
178 pop_element (BusConfigParser *parser)
182 e = _dbus_list_pop_last (&parser->stack);
188 peek_element (BusConfigParser *parser)
192 e = _dbus_list_get_last (&parser->stack);
198 top_element_type (BusConfigParser *parser)
202 e = _dbus_list_get_last (&parser->stack);
211 merge_included (BusConfigParser *parser,
212 BusConfigParser *included,
217 if (included->user != NULL)
219 dbus_free (parser->user);
220 parser->user = included->user;
221 included->user = NULL;
224 if (included->bus_type != NULL)
226 dbus_free (parser->bus_type);
227 parser->bus_type = included->bus_type;
228 included->bus_type = NULL;
234 if (included->pidfile != NULL)
236 dbus_free (parser->pidfile);
237 parser->pidfile = included->pidfile;
238 included->pidfile = NULL;
241 while ((link = _dbus_list_pop_first_link (&included->listen_on)))
242 _dbus_list_append_link (&parser->listen_on, link);
244 while ((link = _dbus_list_pop_first_link (&included->mechanisms)))
245 _dbus_list_append_link (&parser->mechanisms, link);
247 while ((link = _dbus_list_pop_first_link (&included->service_dirs)))
248 _dbus_list_append_link (&parser->service_dirs, link);
254 bus_config_parser_new (const DBusString *basedir)
256 BusConfigParser *parser;
258 parser = dbus_new0 (BusConfigParser, 1);
262 if (!_dbus_string_init (&parser->basedir))
268 if (((parser->policy = bus_policy_new ()) == NULL) ||
269 !_dbus_string_copy (basedir, 0, &parser->basedir, 0))
271 _dbus_string_free (&parser->basedir);
276 parser->refcount = 1;
282 bus_config_parser_ref (BusConfigParser *parser)
284 _dbus_assert (parser->refcount > 0);
286 parser->refcount += 1;
290 bus_config_parser_unref (BusConfigParser *parser)
292 _dbus_assert (parser->refcount > 0);
294 parser->refcount -= 1;
296 if (parser->refcount == 0)
298 while (parser->stack != NULL)
299 pop_element (parser);
301 dbus_free (parser->user);
302 dbus_free (parser->bus_type);
303 dbus_free (parser->pidfile);
305 _dbus_list_foreach (&parser->listen_on,
306 (DBusForeachFunction) dbus_free,
309 _dbus_list_clear (&parser->listen_on);
311 _dbus_list_foreach (&parser->service_dirs,
312 (DBusForeachFunction) dbus_free,
315 _dbus_list_clear (&parser->service_dirs);
317 _dbus_list_foreach (&parser->mechanisms,
318 (DBusForeachFunction) dbus_free,
321 _dbus_list_clear (&parser->mechanisms);
323 _dbus_string_free (&parser->basedir);
326 bus_policy_unref (parser->policy);
333 bus_config_parser_check_doctype (BusConfigParser *parser,
337 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
339 if (strcmp (doctype, "busconfig") != 0)
341 dbus_set_error (error,
343 "Configuration file has the wrong document type %s",
358 locate_attributes (BusConfigParser *parser,
359 const char *element_name,
360 const char **attribute_names,
361 const char **attribute_values,
363 const char *first_attribute_name,
364 const char **first_attribute_retloc,
372 LocateAttr attrs[MAX_ATTRS];
376 _dbus_assert (first_attribute_name != NULL);
377 _dbus_assert (first_attribute_retloc != NULL);
382 attrs[0].name = first_attribute_name;
383 attrs[0].retloc = first_attribute_retloc;
384 *first_attribute_retloc = NULL;
386 va_start (args, first_attribute_retloc);
388 name = va_arg (args, const char*);
389 retloc = va_arg (args, const char**);
393 _dbus_assert (retloc != NULL);
394 _dbus_assert (n_attrs < MAX_ATTRS);
396 attrs[n_attrs].name = name;
397 attrs[n_attrs].retloc = retloc;
401 name = va_arg (args, const char*);
402 retloc = va_arg (args, const char**);
411 while (attribute_names[i])
420 if (strcmp (attrs[j].name, attribute_names[i]) == 0)
422 retloc = attrs[j].retloc;
426 dbus_set_error (error, DBUS_ERROR_FAILED,
427 "Attribute \"%s\" repeated twice on the same <%s> element",
428 attrs[j].name, element_name);
433 *retloc = attribute_values[i];
442 dbus_set_error (error, DBUS_ERROR_FAILED,
443 "Attribute \"%s\" is invalid on <%s> element in this context",
444 attribute_names[i], element_name);
457 check_no_attributes (BusConfigParser *parser,
458 const char *element_name,
459 const char **attribute_names,
460 const char **attribute_values,
463 if (attribute_names[0] != NULL)
465 dbus_set_error (error, DBUS_ERROR_FAILED,
466 "Attribute \"%s\" is invalid on <%s> element in this context",
467 attribute_names[0], element_name);
475 start_busconfig_child (BusConfigParser *parser,
476 const char *element_name,
477 const char **attribute_names,
478 const char **attribute_values,
481 if (strcmp (element_name, "user") == 0)
483 if (!check_no_attributes (parser, "user", attribute_names, attribute_values, error))
486 if (push_element (parser, ELEMENT_USER) == NULL)
494 else if (strcmp (element_name, "type") == 0)
496 if (!check_no_attributes (parser, "type", attribute_names, attribute_values, error))
499 if (push_element (parser, ELEMENT_TYPE) == NULL)
507 else if (strcmp (element_name, "fork") == 0)
509 if (!check_no_attributes (parser, "fork", attribute_names, attribute_values, error))
512 if (push_element (parser, ELEMENT_FORK) == NULL)
522 else if (strcmp (element_name, "pidfile") == 0)
524 if (!check_no_attributes (parser, "pidfile", attribute_names, attribute_values, error))
527 if (push_element (parser, ELEMENT_PIDFILE) == NULL)
535 else if (strcmp (element_name, "listen") == 0)
537 if (!check_no_attributes (parser, "listen", attribute_names, attribute_values, error))
540 if (push_element (parser, ELEMENT_LISTEN) == NULL)
548 else if (strcmp (element_name, "auth") == 0)
550 if (!check_no_attributes (parser, "auth", attribute_names, attribute_values, error))
553 if (push_element (parser, ELEMENT_AUTH) == NULL)
561 else if (strcmp (element_name, "includedir") == 0)
563 if (!check_no_attributes (parser, "includedir", attribute_names, attribute_values, error))
566 if (push_element (parser, ELEMENT_INCLUDEDIR) == NULL)
574 else if (strcmp (element_name, "servicedir") == 0)
576 if (!check_no_attributes (parser, "servicedir", attribute_names, attribute_values, error))
579 if (push_element (parser, ELEMENT_SERVICEDIR) == NULL)
587 else if (strcmp (element_name, "include") == 0)
590 const char *ignore_missing;
592 if ((e = push_element (parser, ELEMENT_INCLUDE)) == NULL)
598 e->d.include.ignore_missing = FALSE;
600 if (!locate_attributes (parser, "include",
604 "ignore_missing", &ignore_missing,
608 if (ignore_missing != NULL)
610 if (strcmp (ignore_missing, "yes") == 0)
611 e->d.include.ignore_missing = TRUE;
612 else if (strcmp (ignore_missing, "no") == 0)
613 e->d.include.ignore_missing = FALSE;
616 dbus_set_error (error, DBUS_ERROR_FAILED,
617 "ignore_missing attribute must have value \"yes\" or \"no\"");
624 else if (strcmp (element_name, "policy") == 0)
631 if ((e = push_element (parser, ELEMENT_POLICY)) == NULL)
637 if (!locate_attributes (parser, "policy",
647 if (((context && user) ||
648 (context && group)) ||
650 !(context || user || group))
652 dbus_set_error (error, DBUS_ERROR_FAILED,
653 "<policy> element must have exactly one of (context|user|group) attributes");
659 if (strcmp (context, "default") == 0)
663 else if (strcmp (context, "mandatory") == 0)
669 dbus_set_error (error, DBUS_ERROR_FAILED,
670 "context attribute on <policy> must have the value \"default\" or \"mandatory\", not \"%s\"",
678 else if (user != NULL)
683 else if (group != NULL)
690 _dbus_assert_not_reached ("all <policy> attributes null and we didn't set error");
697 dbus_set_error (error, DBUS_ERROR_FAILED,
698 "Element <%s> not allowed inside <%s> in configuration file",
699 element_name, "busconfig");
705 start_policy_child (BusConfigParser *parser,
706 const char *element_name,
707 const char **attribute_names,
708 const char **attribute_values,
711 if (strcmp (element_name, "allow") == 0)
713 if (push_element (parser, ELEMENT_ALLOW) == NULL)
721 else if (strcmp (element_name, "deny") == 0)
723 if (push_element (parser, ELEMENT_DENY) == NULL)
733 dbus_set_error (error, DBUS_ERROR_FAILED,
734 "Element <%s> not allowed inside <%s> in configuration file",
735 element_name, "policy");
741 bus_config_parser_start_element (BusConfigParser *parser,
742 const char *element_name,
743 const char **attribute_names,
744 const char **attribute_values,
749 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
751 /* printf ("START: %s\n", element_name); */
753 t = top_element_type (parser);
755 if (t == ELEMENT_NONE)
757 if (strcmp (element_name, "busconfig") == 0)
759 if (!check_no_attributes (parser, "busconfig", attribute_names, attribute_values, error))
762 if (push_element (parser, ELEMENT_BUSCONFIG) == NULL)
772 dbus_set_error (error, DBUS_ERROR_FAILED,
773 "Unknown element <%s> at root of configuration file",
778 else if (t == ELEMENT_BUSCONFIG)
780 return start_busconfig_child (parser, element_name,
781 attribute_names, attribute_values,
784 else if (t == ELEMENT_POLICY)
786 return start_policy_child (parser, element_name,
787 attribute_names, attribute_values,
792 dbus_set_error (error, DBUS_ERROR_FAILED,
793 "Element <%s> is not allowed in this context",
800 bus_config_parser_end_element (BusConfigParser *parser,
801 const char *element_name,
808 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
810 /* printf ("END: %s\n", element_name); */
812 t = top_element_type (parser);
814 if (t == ELEMENT_NONE)
816 /* should probably be an assertion failure but
817 * being paranoid about XML parsers
819 dbus_set_error (error, DBUS_ERROR_FAILED,
820 "XML parser ended element with no element on the stack");
824 n = element_type_to_name (t);
825 _dbus_assert (n != NULL);
826 if (strcmp (n, element_name) != 0)
828 /* should probably be an assertion failure but
829 * being paranoid about XML parsers
831 dbus_set_error (error, DBUS_ERROR_FAILED,
832 "XML element <%s> ended but topmost element on the stack was <%s>",
837 e = peek_element (parser);
838 _dbus_assert (e != NULL);
843 _dbus_assert_not_reached ("element in stack has no type");
846 case ELEMENT_INCLUDE:
850 case ELEMENT_PIDFILE:
852 case ELEMENT_SERVICEDIR:
853 case ELEMENT_INCLUDEDIR:
856 dbus_set_error (error, DBUS_ERROR_FAILED,
857 "XML element <%s> was expected to have content inside it",
858 element_type_to_name (e->type));
863 case ELEMENT_BUSCONFIG:
872 pop_element (parser);
878 all_whitespace (const DBusString *str)
882 _dbus_string_skip_white (str, 0, &i);
884 return i == _dbus_string_get_length (str);
888 make_full_path (const DBusString *basedir,
889 const DBusString *filename,
890 DBusString *full_path)
892 if (_dbus_path_is_absolute (filename))
894 return _dbus_string_copy (filename, 0, full_path, 0);
898 if (!_dbus_string_copy (basedir, 0, full_path, 0))
901 if (!_dbus_concat_dir_and_file (full_path, filename))
909 include_file (BusConfigParser *parser,
910 const DBusString *filename,
911 dbus_bool_t ignore_missing,
914 /* FIXME good test case for this would load each config file in the
915 * test suite both alone, and as an include, and check
916 * that the result is the same
918 BusConfigParser *included;
921 dbus_error_init (&tmp_error);
922 included = bus_config_load (filename, &tmp_error);
923 if (included == NULL)
925 _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
927 if (dbus_error_has_name (&tmp_error, DBUS_ERROR_FILE_NOT_FOUND) &&
930 dbus_error_free (&tmp_error);
935 dbus_move_error (&tmp_error, error);
941 _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
943 if (!merge_included (parser, included, error))
945 bus_config_parser_unref (included);
949 bus_config_parser_unref (included);
955 include_dir (BusConfigParser *parser,
956 const DBusString *dirname,
964 if (!_dbus_string_init (&filename))
972 dir = _dbus_directory_open (dirname, error);
977 dbus_error_init (&tmp_error);
978 while (_dbus_directory_get_next_file (dir, &filename, &tmp_error))
980 DBusString full_path;
982 if (!_dbus_string_init (&full_path))
988 if (!_dbus_string_copy (dirname, 0, &full_path, 0))
991 _dbus_string_free (&full_path);
995 if (!_dbus_concat_dir_and_file (&full_path, &filename))
998 _dbus_string_free (&full_path);
1002 if (_dbus_string_ends_with_c_str (&full_path, ".conf"))
1004 if (!include_file (parser, &full_path, TRUE, error))
1006 _dbus_string_free (&full_path);
1011 _dbus_string_free (&full_path);
1014 if (dbus_error_is_set (&tmp_error))
1016 dbus_move_error (&tmp_error, error);
1023 _dbus_string_free (&filename);
1026 _dbus_directory_close (dir);
1032 bus_config_parser_content (BusConfigParser *parser,
1033 const DBusString *content,
1038 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
1044 _dbus_string_get_const_data (content, &c_str);
1046 printf ("CONTENT %d bytes: %s\n", _dbus_string_get_length (content), c_str);
1050 e = peek_element (parser);
1053 dbus_set_error (error, DBUS_ERROR_FAILED,
1054 "Text content outside of any XML element in configuration file");
1057 else if (e->had_content)
1059 _dbus_assert_not_reached ("Element had multiple content blocks");
1063 switch (top_element_type (parser))
1066 _dbus_assert_not_reached ("element at top of stack has no type");
1069 case ELEMENT_BUSCONFIG:
1070 case ELEMENT_POLICY:
1075 if (all_whitespace (content))
1079 dbus_set_error (error, DBUS_ERROR_FAILED,
1080 "No text content expected inside XML element %s in configuration file",
1081 element_type_to_name (top_element_type (parser)));
1085 case ELEMENT_PIDFILE:
1089 e->had_content = TRUE;
1091 if (!_dbus_string_copy_data (content, &s))
1094 dbus_free (parser->pidfile);
1095 parser->pidfile = s;
1099 case ELEMENT_INCLUDE:
1101 DBusString full_path;
1103 e->had_content = TRUE;
1105 if (!_dbus_string_init (&full_path))
1108 if (!make_full_path (&parser->basedir, content, &full_path))
1110 _dbus_string_free (&full_path);
1114 if (!include_file (parser, &full_path,
1115 e->d.include.ignore_missing, error))
1117 _dbus_string_free (&full_path);
1121 _dbus_string_free (&full_path);
1125 case ELEMENT_INCLUDEDIR:
1127 DBusString full_path;
1129 e->had_content = TRUE;
1131 if (!_dbus_string_init (&full_path))
1134 if (!make_full_path (&parser->basedir, content, &full_path))
1136 _dbus_string_free (&full_path);
1140 if (!include_dir (parser, &full_path, error))
1142 _dbus_string_free (&full_path);
1146 _dbus_string_free (&full_path);
1154 e->had_content = TRUE;
1156 if (!_dbus_string_copy_data (content, &s))
1159 dbus_free (parser->user);
1168 e->had_content = TRUE;
1170 if (!_dbus_string_copy_data (content, &s))
1173 dbus_free (parser->bus_type);
1174 parser->bus_type = s;
1178 case ELEMENT_LISTEN:
1182 e->had_content = TRUE;
1184 if (!_dbus_string_copy_data (content, &s))
1187 if (!_dbus_list_append (&parser->listen_on,
1200 e->had_content = TRUE;
1202 if (!_dbus_string_copy_data (content, &s))
1205 if (!_dbus_list_append (&parser->mechanisms,
1214 case ELEMENT_SERVICEDIR:
1217 DBusString full_path;
1219 e->had_content = TRUE;
1221 if (!_dbus_string_init (&full_path))
1224 if (!make_full_path (&parser->basedir, content, &full_path))
1226 _dbus_string_free (&full_path);
1230 if (!_dbus_string_copy_data (&full_path, &s))
1232 _dbus_string_free (&full_path);
1236 if (!_dbus_list_append (&parser->service_dirs, s))
1238 _dbus_string_free (&full_path);
1243 _dbus_string_free (&full_path);
1248 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
1252 BUS_SET_OOM (error);
1257 bus_config_parser_finished (BusConfigParser *parser,
1260 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
1262 if (parser->stack != NULL)
1264 dbus_set_error (error, DBUS_ERROR_FAILED,
1265 "Element <%s> was not closed in configuration file",
1266 element_type_to_name (top_element_type (parser)));
1271 if (parser->listen_on == NULL)
1273 dbus_set_error (error, DBUS_ERROR_FAILED,
1274 "Configuration file needs one or more <listen> elements giving addresses");
1282 bus_config_parser_get_user (BusConfigParser *parser)
1284 return parser->user;
1288 bus_config_parser_get_type (BusConfigParser *parser)
1290 return parser->bus_type;
1294 bus_config_parser_get_addresses (BusConfigParser *parser)
1296 return &parser->listen_on;
1300 bus_config_parser_get_mechanisms (BusConfigParser *parser)
1302 return &parser->mechanisms;
1306 bus_config_parser_get_service_dirs (BusConfigParser *parser)
1308 return &parser->service_dirs;
1312 bus_config_parser_get_fork (BusConfigParser *parser)
1314 return parser->fork;
1318 bus_config_parser_get_pidfile (BusConfigParser *parser)
1320 return parser->pidfile;
1324 bus_config_parser_steal_policy (BusConfigParser *parser)
1328 _dbus_assert (parser->policy != NULL); /* can only steal the policy 1 time */
1330 policy = parser->policy;
1332 parser->policy = NULL;
1337 #ifdef DBUS_BUILD_TESTS
1348 do_load (const DBusString *full_path,
1350 dbus_bool_t oom_possible)
1352 BusConfigParser *parser;
1355 dbus_error_init (&error);
1357 parser = bus_config_load (full_path, &error);
1360 _DBUS_ASSERT_ERROR_IS_SET (&error);
1363 dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY))
1365 _dbus_verbose ("Failed to load valid file due to OOM\n");
1366 dbus_error_free (&error);
1369 else if (validity == VALID)
1371 _dbus_warn ("Failed to load valid file but still had memory: %s\n",
1374 dbus_error_free (&error);
1379 dbus_error_free (&error);
1385 _DBUS_ASSERT_ERROR_IS_CLEAR (&error);
1387 bus_config_parser_unref (parser);
1389 if (validity == INVALID)
1391 _dbus_warn ("Accepted invalid file\n");
1401 const DBusString *full_path;
1406 check_loader_oom_func (void *data)
1408 LoaderOomData *d = data;
1410 return do_load (d->full_path, d->validity, TRUE);
1414 process_test_subdir (const DBusString *test_base_dir,
1418 DBusString test_directory;
1419 DBusString filename;
1427 if (!_dbus_string_init (&test_directory))
1428 _dbus_assert_not_reached ("didn't allocate test_directory\n");
1430 _dbus_string_init_const (&filename, subdir);
1432 if (!_dbus_string_copy (test_base_dir, 0,
1433 &test_directory, 0))
1434 _dbus_assert_not_reached ("couldn't copy test_base_dir to test_directory");
1436 if (!_dbus_concat_dir_and_file (&test_directory, &filename))
1437 _dbus_assert_not_reached ("couldn't allocate full path");
1439 _dbus_string_free (&filename);
1440 if (!_dbus_string_init (&filename))
1441 _dbus_assert_not_reached ("didn't allocate filename string\n");
1443 dbus_error_init (&error);
1444 dir = _dbus_directory_open (&test_directory, &error);
1447 _dbus_warn ("Could not open %s: %s\n",
1448 _dbus_string_get_const_data (&test_directory),
1450 dbus_error_free (&error);
1454 printf ("Testing:\n");
1457 while (_dbus_directory_get_next_file (dir, &filename, &error))
1459 DBusString full_path;
1462 if (!_dbus_string_init (&full_path))
1463 _dbus_assert_not_reached ("couldn't init string");
1465 if (!_dbus_string_copy (&test_directory, 0, &full_path, 0))
1466 _dbus_assert_not_reached ("couldn't copy dir to full_path");
1468 if (!_dbus_concat_dir_and_file (&full_path, &filename))
1469 _dbus_assert_not_reached ("couldn't concat file to dir");
1471 if (!_dbus_string_ends_with_c_str (&full_path, ".conf"))
1473 _dbus_verbose ("Skipping non-.conf file %s\n",
1474 _dbus_string_get_const_data (&filename));
1475 _dbus_string_free (&full_path);
1479 printf (" %s\n", _dbus_string_get_const_data (&filename));
1481 _dbus_verbose (" expecting %s\n",
1482 validity == VALID ? "valid" :
1483 (validity == INVALID ? "invalid" :
1484 (validity == UNKNOWN ? "unknown" : "???")));
1486 d.full_path = &full_path;
1487 d.validity = validity;
1488 if (!_dbus_test_oom_handling ("config-loader", check_loader_oom_func, &d))
1489 _dbus_assert_not_reached ("test failed");
1491 _dbus_string_free (&full_path);
1494 if (dbus_error_is_set (&error))
1496 _dbus_warn ("Could not get next file in %s: %s\n",
1497 _dbus_string_get_const_data (&test_directory),
1499 dbus_error_free (&error);
1508 _dbus_directory_close (dir);
1509 _dbus_string_free (&test_directory);
1510 _dbus_string_free (&filename);
1516 bus_config_parser_test (const DBusString *test_data_dir)
1518 if (test_data_dir == NULL ||
1519 _dbus_string_get_length (test_data_dir) == 0)
1521 printf ("No test data\n");
1525 if (!process_test_subdir (test_data_dir, "valid-config-files", VALID))
1531 #endif /* DBUS_BUILD_TESTS */