9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio Fabiano Fidêncio <fidencio@redhat.com>
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio Copyright (C) 2017 Red Hat
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio This program is free software; you can redistribute it and/or modify
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio it under the terms of the GNU General Public License as published by
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio the Free Software Foundation; either version 3 of the License, or
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio (at your option) any later version.
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio This program is distributed in the hope that it will be useful,
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio but WITHOUT ANY WARRANTY; without even the implied warranty of
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio GNU General Public License for more details.
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio You should have received a copy of the GNU General Public License
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio along with this program. If not, see <http://www.gnu.org/licenses/>.
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidênciostatic errno_t check_socket_activated_responder(const char *responder)
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio struct ini_cfgobj *modified_ini_config = NULL;
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio const char *patterns[] = { "^[^\\.].*\\.conf$", NULL };
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio DEBUG(SSSDBG_CRIT_FAILURE, "ini_config_create() failed [%d][%s]\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio ret = ini_config_file_open(SSSD_CONFIG_FILE, 0, &file_ctx);
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio DEBUG(SSSDBG_CRIT_FAILURE, "ini_config_file_open() failed [%d][%s]\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio /* Using the same flags used by sss_ini_get_config(), which is used to
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio * load the config file ... */
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio DEBUG(SSSDBG_CRIT_FAILURE, "ini_config_parse() failed [%d][%s]\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio /* And also check the snippets ... */
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio snip_check.mask = ALLPERMS & ~(S_IWUSR | S_IXUSR);
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio DEBUG(SSSDBG_CRIT_FAILURE, "ini_config_augment failed [%d][%s]\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio ret = ini_get_config_valueobj("sssd", "services", ini_config,
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "ini_get_config_valueobj() failed [%d][%s]\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio /* In case there's no services' line at all, just return EOK. */
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio services = ini_get_string_config_value(vobj, &ret);
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "ini_get_string_config_value() failed [%d][%s]\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio {"responders", 'r', POPT_ARG_STRING, &responder, 0,
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio _("The name of the responder to be checked"), NULL},
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio pc = poptGetContext(argv[0], argc, argv, long_options, 0);
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio fprintf(stderr, "\nInvalid option %s: %s\n\n",
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio ret = check_socket_activated_responder(responder);
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "Misconfiguration found for the %s responder.\n"
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "The %s responder has been configured to be socket-activated "
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "but it's still mentioned in the services' line in %s.\n"
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "Please, consider either adjusting your services' line in %s "
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "or disabling the %s's socket by calling:\n"
9c0c83eecf963416effee67dab55711234373fdeFabiano Fidêncio "\"systemctl disable sssd-%s.socket\"",