#2680 /etc/sssd/sssd.conf: allowing comments not only in 1st column
Closed: wontfix 7 years ago Opened 8 years ago by tomschi.

Hello

I've just installed sssd:

sssd/trusty,now 1.11.5-1ubuntu3 amd64 [installed]
sssd-ad/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-ad-common/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-common/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-ipa/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-krb5/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-krb5-common/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-ldap/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]
sssd-proxy/trusty,now 1.11.5-1ubuntu3 amd64 [installed,automatic]

If I have this config, line 18 is the one with #:

[domain/xxx]
        id_provider = ad
        access_provider = ad

        # Use this if users are being logged in at /.

If I check the config, I get this error:
Error (5) on line 18: Equal sign is missing.

# sssd -i -d 0xffff
(Tue Jun 16 16:35:45:559857 2015) [sssd] [check_file] (0x0400): lstat for [/var/run/nscd/socket] failed: [2][No such file or directory].
(Tue Jun 16 16:35:45:596072 2015) [sssd] [ldb] (0x0400): server_sort:Unable to register control with rootdse!
'''(Tue Jun 16 16:35:45:596518 2015) [sssd] [sss_ini_get_config] (0x0010): Failed to parse configuration. Error 5.
(Tue Jun 16 16:35:45:596686 2015) [sssd] [sss_ini_get_config] (0x0010): Errors detected while parsing: /etc/sssd/sssd.conf
(Tue Jun 16 16:35:45:596863 2015) [sssd] [sss_ini_config_print_errors] (0x0020): Error (5) on line 18: Equal sign is missing.
'''(Tue Jun 16 16:35:45:597018 2015) [sssd] [confdb_init_db] (0x0010): Failed to load configuration
(Tue Jun 16 16:35:45:597207 2015) [sssd] [load_configuration] (0x0010): ConfDB initialization has failed [Input/output error]
(Tue Jun 16 16:35:45:597445 2015) [sssd] [main] (0x0020): SSSD couldn't load the configuration database.
root@basfs004:~#

Now I move the # to the 1st column:

[domain/xxx]
        id_provider = ad
        access_provider = ad

# Use this if users are being logged in at /.

and everything is OK.

It would be great if Comments can start everywhere and white spaces (space & tab) are allowed before # :-)

For me it's a major problem, because users do not expect this kind of error.

Kind regards,
Tom


The issue is actually in ding-libs.

See static int handle_space(struct parser_obj po, uint32_t action) in ini_parse.c

This is the place to make changes. AFAIR sssd calls ding-libs with INI_PARSE_NOWRAP meaning that it does not expect sssd to have lines wrapped. So the fix would be around top two ifs to check if the line is actually a comment or not before assuming it is a KVP.

Fields changed

milestone: NEEDS_TRIAGE => SSSD Deferred

I am willing to help anyone looking to fix this issue but I promised not to code any more myself. :-)

Fields changed

rhbz: => todo

Metadata Update from @tomschi:
- Issue set to the milestone: SSSD Patches welcome

7 years ago

Hello,
Assign to me. I will code it.

Metadata Update from @sbose:
- Custom field design_review reset
- Custom field mark reset
- Custom field patch reset
- Custom field review reset
- Custom field sensitive reset
- Custom field testsupdated reset
- Issue assigned to amitkumar25nov
- Issue close_status updated to: None

7 years ago

FYI: it is not supported in ding-libs

        /* We do not allow spaces in front of comments
         * so we expect the comment to start right away.
         */
        if ((buffer[0] == '\0') ||
            (buffer[0] == ';') ||
            (buffer[0] == '#')) {
            is_comment = 1;
        }

Firstly, such feature need to be implemented in dong-libs https://pagure.io/SSSD/ding-libs

Metadata Update from @lslebodn:
- Custom field design_review reset
- Custom field mark reset
- Custom field patch reset
- Custom field review reset
- Custom field sensitive reset
- Custom field testsupdated reset

7 years ago

Hi,

I would also add, that such feature in ding-libs would collide with the multi-line values that need to begin with single space.

I think the limitation to allow comments only at the beginning of the line is reasonable and would prefer to close this as wontfix.

Metadata Update from @mzidek:
- Custom field component reset
- Custom field design_review reset
- Custom field keywords reset
- Custom field mark reset
- Custom field patch reset
- Custom field review reset
- Custom field rhbz reset
- Custom field sensitive reset
- Custom field testsupdated reset
- Custom field type reset
- Custom field version reset
- Issue set to the milestone: None (was: SSSD Patches welcome)

7 years ago

Metadata Update from @sbose:
- Custom field design_review reset
- Custom field mark reset
- Custom field patch reset
- Custom field review reset
- Custom field sensitive reset
- Custom field testsupdated reset

7 years ago

Closing as per the previous comment.

Metadata Update from @jhrozek:
- Custom field design_review reset (from false)
- Custom field mark reset (from false)
- Custom field patch reset (from false)
- Custom field review reset (from false)
- Custom field sensitive reset (from false)
- Custom field testsupdated reset (from false)
- Issue close_status updated to: wontfix
- Issue status updated to: Closed (was: Open)

7 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/3721

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