#4129 sssctl config-check command does not give proper error messages with line numbers
Closed: Fixed 4 years ago by mzidek. Opened 4 years ago by thalman.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 8): Bug 1781728

Description of problem:
sssctl config-check command does not give proper error messages with line
numbers while checking starting and ending square brackets in domain, sssd and
service sections.


Version-Release number of selected component (if applicable):
# rpm -qa sssd sssd-tools
sssd-tools-2.2.3-3.el8.x86_64
sssd-2.2.3-3.el8.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Add sssd.conf with missing ending square brackets for sssd section.
2. # cat /etc/sssd/sssd.conf
[sssd
config_file_version = 2
services = nss, pam
domains = example1

[domain/example1]
ldap_search_base = dc=example,dc=test
id_provider = ldap
auth_provider = ldap
ldap_user_home_directory = /home/%u
ldap_uri = ldaps://ci-vm-10-0-153-162.hosted.upshift.rdu2.redhat.com
ldap_tls_cacert = /etc/openldap/cacerts/cacert.pem
use_fully_qualified_names = True
debug_level = 9

3. Run # sssctl config-check

Actual results:
Not showing the exact error message with a line number.

# sssctl config-check
(Tue Dec 10 08:49:12:721419 2019) [sssd] [sss_ini_parse] (0x0010): Failed to
parse configuration. Error 5.
(Tue Dec 10 08:49:12:721468 2019) [sssd] [sss_ini_parse] (0x0010): Errors
detected while parsing: /etc/sssd/sssd.conf
(Tue Dec 10 08:49:12:721481 2019) [sssd] [sss_ini_read_sssd_conf] (0x0010):
Failed to parse configuration.
Failed to load configuration configuration from /etc/sssd/sssd.conf.


Expected results:
In expected error messages, we should get line number/s with proper error
messages like no closing bracket.

[root@vm-idm-002 ~]# sssctl config-check
(Tue Dec 10 19:21:12:300456 2019) [sssd] [sss_ini_get_config] (0x0010): Failed
to parse configuration. Error 5.
(Tue Dec 10 19:21:12:300625 2019) [sssd] [sss_ini_get_config] (0x0010): Errors
detected while parsing: /etc/sssd/sssd.conf
(Tue Dec 10 19:21:12:300689 2019) [sssd] [sss_ini_config_print_errors]
(0x0010): Error (2) on line 1: No closing bracket.
(Tue Dec 10 19:21:12:300731 2019) [sssd] [sssctl_config_check] (0x0010): Failed
to load configuration


Additional info:
Expect error message with the line number for missing starting bracket for any
section.

Metadata Update from @thalman:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1781728

4 years ago

Metadata Update from @mzidek:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

4 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/5090

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata