diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-08-30 07:38:02 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-08-30 07:38:02 +1000 |
commit | e82f2187325274d728ec7470990f971e7b3db13c (patch) | |
tree | 25ce940a5b2a57c6191265664fad0e70aee951fa /source4/heimdal/lib/krb5/principal.c | |
parent | 9817f3d785ceb67819a9def0e8030272e4ba9e14 (diff) | |
parent | 81dcc99e9acb9a7e4c2358e5e44998e4718dc658 (diff) | |
download | samba-e82f2187325274d728ec7470990f971e7b3db13c.tar.gz samba-e82f2187325274d728ec7470990f971e7b3db13c.tar.bz2 samba-e82f2187325274d728ec7470990f971e7b3db13c.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit f008c3b6ee324056fd9b63f6151ad6849640c959)
Diffstat (limited to 'source4/heimdal/lib/krb5/principal.c')
-rw-r--r-- | source4/heimdal/lib/krb5/principal.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/heimdal/lib/krb5/principal.c b/source4/heimdal/lib/krb5/principal.c index 0d6d72dbcf..3a1d184c3d 100644 --- a/source4/heimdal/lib/krb5/principal.c +++ b/source4/heimdal/lib/krb5/principal.c @@ -57,7 +57,7 @@ host/admin@H5L.ORG #include <fnmatch.h> #include "resolve.h" -RCSID("$Id: principal.c 23316 2008-06-23 04:32:32Z lha $"); +RCSID("$Id$"); #define princ_num_comp(P) ((P)->name.name_string.len) #define princ_type(P) ((P)->name.name_type) @@ -1259,7 +1259,14 @@ krb5_sname_to_principal (krb5_context context, return KRB5_SNAME_UNSUPP_NAMETYPE; } if(hostname == NULL) { - gethostname(localhost, sizeof(localhost)); + ret = gethostname(localhost, sizeof(localhost) - 1); + if (ret != 0) { + ret = errno; + krb5_set_error_message(context, ret, + "Failed to get local hostname"); + return ret; + } + localhost[sizeof(localhost) - 1] = '\0'; hostname = localhost; } if(sname == NULL) |