diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2013-03-23 08:13:22 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2013-03-25 10:09:11 -0400 |
commit | 128bca853fc6df20a87d4d3dfe12c1b77204d673 (patch) | |
tree | 7e06da7028c6c2e2999a783b06f69dd3a4e06459 | |
parent | 8239ec6587ce103d7bcb4b37c680c0c10ef5b37c (diff) | |
download | nfs-utils-128bca853fc6df20a87d4d3dfe12c1b77204d673.tar.gz nfs-utils-128bca853fc6df20a87d4d3dfe12c1b77204d673.tar.xz nfs-utils-128bca853fc6df20a87d4d3dfe12c1b77204d673.zip |
gssd: gethostname(3) returns zero or -1, not an errno
According to "man gethostname," gssd is handling the return value of
gethostname(3) incorrectly. It looks like other gethostname(3) call
sites in nfs-utils are already correct.
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/gssd/krb5_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 4df840e..20b55b3 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -810,8 +810,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname, goto out; /* Get full local hostname */ - retval = gethostname(myhostname, sizeof(myhostname)); - if (retval) { + if (gethostname(myhostname, sizeof(myhostname)) == -1) { + retval = errno; k5err = gssd_k5_err_msg(context, retval); printerr(1, "%s while getting local hostname\n", k5err); goto out; |