URL:
https://github.com/SSSD/sssd/pull/326
Title: #326: IPA: check if IPA hostname is a FQDN
fidencio commented:
"""
@amitkumar50: I've tested the patch, it works, but I'll request some changes in
it.
Let me write you here a few general recommendations based on a few different parts of the
code:
- Commit message: Although the commit message itself is good, please, don't use more
than 72 characters in the body (please, see
https://github.com/SSSD/sssd/blob/master/.git-commit-template)
- Coding style:
- Instead of doing `if(!ipa_check_fqdn(ipa_hostname)){ `, please, do `if
(!ipa_check_fqdn(ipa_hostname)) {`;
- Be careful about the alignment. So, instead of doing:
```
DEBUG(SSSDBG_CRIT_FAILURE,
"ipa_hostname is not Fully Qualified Domain Name.\n");
```
please, do:
```
DEBUG(SSSDBG_CRIT_FAILURE,
"ipa_hostname is not Fully Qualified Domain Name.\n");
```
- Only use implicit checks against bool. For instance, instead of `if(ret){`, please, do
`if (ret != NULL) {`
And last but not least, I do believe this function could be an internal one inside
src/providers/ipa/ipa_init.c as I do believe the check could be done only in the
ipa_init_server_mode() function.
Thanks a lot for the patch and I'm setting the "Changes Requested" label as
per this review.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/326#issuecomment-318405884