e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek Michal Židek <mzidek@redhat.com>
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek Copyright (C) 2016 Red Hat
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek This program is free software; you can redistribute it and/or modify
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek it under the terms of the GNU General Public License as published by
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek the Free Software Foundation; either version 3 of the License, or
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek (at your option) any later version.
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek This program is distributed in the hope that it will be useful,
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek but WITHOUT ANY WARRANTY; without even the implied warranty of
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek GNU General Public License for more details.
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek You should have received a copy of the GNU General Public License
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek along with this program. If not, see <http://www.gnu.org/licenses/>.
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židekerrno_t sssctl_config_check(struct sss_cmdline *cmdline,
55857e924977dbc66958f8033c6b38d6262ee631Michal Židek ret = sss_tool_popt(cmdline, NULL, SSS_TOOL_OPT_OPTIONAL, NULL, NULL);
55857e924977dbc66958f8033c6b38d6262ee631Michal Židek DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse command arguments\n");
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory.\n");
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek /* Open config file */
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek ret = sss_ini_config_file_open(init_data, SSSD_CONFIG_FILE);
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek "sss_ini_config_file_open failed: %s [%d]\n",
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek /* Check the file permissions */
9dc66cb6b96a885f7272a3c4aa6a44d60cdce82cMichal Židek printf(_("File ownership and permissions check failed. "
9dc66cb6b96a885f7272a3c4aa6a44d60cdce82cMichal Židek "Expected root:root and 0600.\n"));
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek DEBUG(SSSDBG_FATAL_FAILURE, "Failed to load configuration\n");
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek /* Read rules */
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek ret = sss_ini_call_validators_strs(tmp_ctx, init_data,
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek /* Output from validators */
cca5695e6cab64def52c009afc8f055a85f1fde4Lukas Slebodnik printf(_("Issues identified by validators: %zu\n"), num_errors);
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek for (i = 0; i < num_errors; i++) {
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek /* Merging issues */
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek printf(_("Messages generated during configuration merging: %zu\n"),
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek /* Used snippet files */
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek printf(_("Used configuration snippet files: %u\n"),
e088912418fd4db750f2097dfde8ef9b77303f05Michal Židek#endif /* HAVE_LIBINI_CONFIG_V1_3 */