From e948458a79462bd99ef7c02b4d7ec22c6554a163 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Jun 2004 00:48:59 +0000 Subject: r1215: Intermediate checkin of the new keytab code. I need to make sure I haven't broken krb5 ticket verification in the mainline code path, also need to check with valgrind. Everything now compiles (MIT, need to also check Heimdal) and the "net keytab" utility code will follow. Jeremy. (This used to be commit f0f2e28958cb9abfed216c71f291f19ea346d630) --- source3/lib/util.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util.c b/source3/lib/util.c index 54cbc36772..554f5ee79d 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2435,6 +2435,21 @@ BOOL unix_wild_match(const char *pattern, const char *string) return unix_do_match(p2, s2) == 0; } +/********************************************************************** + Converts a name to a fully qalified domain name. +***********************************************************************/ + +void name_to_fqdn(fstring fqdn, const char *name) +{ + struct hostent *hp = sys_gethostbyname(name); + if ( hp && hp->h_name && *hp->h_name ) { + DEBUG(10,("name_to_fqdn: lookup for %s -> %s.\n", name, hp->h_name)); + fstrcpy(fqdn,hp->h_name); + } else { + DEBUG(10,("name_to_fqdn: lookup for %s failed.\n", name)); + fstrcpy(fqdn, name); + } +} #ifdef __INSURE__ -- cgit