I do not think this is a good patch - systematically.
Maybe better approach is to rather use gethostbyname() than gethostname().
My 2 cents.
O.
-----Original Message-----
From: Joakim Tjernlund [mailto:Joakim.Tjernlund@infinera.com]
Sent: Monday, August 22, 2016 10:42 AM
To: sssd-users(a)lists.fedorahosted.org
Subject: [SSSD-users] Re: DDNS not working due to non FQDN hostname
On Mon, 2016-08-22 at 10:23 +0200, Jakub Hrozek wrote:
On Mon, Aug 22, 2016 at 08:16:36AM +0000, Ondrej Valousek wrote:
>
> Ok, so you Jakub say that /etc/hostname should rather contain FQDN right?
No, I'm saying that gethostname()/hostname should return a FQDN.
You're likely to run into all kinds of issues anyway if your system is
configured with shortnames.
Seems to be different "standards", each distribution seems to have selected some
variant.
I think claiming that "gethostname()/hostname should return a FQDN" is THE
standard will not hold, but some dists has adopted this to make life easier in some
areas.
I added this short patch to sssd which will at least try to do the right thing:
---
sssd-1.13.1/src/providers/ad/ad_common.c.org 2016-08-21 17:47:09.501079617 +0200
+++ sssd-1.13.1/src/providers/ad/ad_common.c 2016-08-21 17:52:13.059669848 +0200
@@ -397,6 +397,11 @@
goto done;
}
hostname[HOST_NAME_MAX] = '\0';
+ /* If hostname is non FQDN, add ad_domain */
+ if (strchr(hostname,'.') == NULL) {
+ strncat(hostname, ".", HOST_NAME_MAX - 1);
+ strncat(hostname, domain, HOST_NAME_MAX - 1);
+ }
DEBUG(SSSDBG_CONF_SETTINGS,
"Setting ad_hostname to [%s].\n", hostname);
ret = dp_opt_set_string(opts->basic, AD_HOSTNAME, hostname);
>
> I was not sure what RedHat says in terms of "best practices" here.
This is upstream list, the fact that my address ends with .redhat.com
is irrelevant.
>
>
> But I agree the from the admin prospective, we ideally need to have
> the same configuration in sssd.conf being shared by all hosts.
> Ondrej
_______________________________________________
sssd-users mailing list
sssd-users(a)lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/sssd-users@lists.fedorahost
ed.org
_______________________________________________
sssd-users mailing list
sssd-users(a)lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/sssd-users@lists.fedorahosted.org
-----
The information contained in this e-mail and in any attachments is confidential and is
designated solely for the attention of the intended recipient(s). If you are not an
intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or
any part thereof. If you have received this e-mail in error, please notify the sender by
return e-mail and delete all copies of this e-mail from your computer system(s). Please
direct any additional queries to: communications(a)s3group.com. Thank You. Silicon and
Software Systems Limited (S3 Group). Registered in Ireland no. 378073. Registered Office:
South County Business Park, Leopardstown, Dublin 18.