summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-22 00:48:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:00 -0500
commite948458a79462bd99ef7c02b4d7ec22c6554a163 (patch)
tree29edf635292a7faaa4479cbb5cdd9d4d0d4607e2 /source3/lib
parent5a889c9d7bd3d66d6bbb5d31eb320f2e2f555d60 (diff)
downloadsamba-e948458a79462bd99ef7c02b4d7ec22c6554a163.tar.gz
samba-e948458a79462bd99ef7c02b4d7ec22c6554a163.tar.bz2
samba-e948458a79462bd99ef7c02b4d7ec22c6554a163.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c15
1 files changed, 15 insertions, 0 deletions
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__