diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2014-06-06 19:22:38 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2014-06-06 19:42:39 +0200 |
commit | abb2452f3a64691b1867cc18278b63b7c4aeefac (patch) | |
tree | 8f78819acc7f767ab7d1bff625e3af4a765280ca | |
parent | b977d3f27c3d4ed544d4f56f814361af9f24d13d (diff) |
Return correct port number on Solaris
This is a small fix for when using nscd (which still does not seem to
work completely). The port is stored in network byte order but should be
printed in host byte order.
-rw-r--r-- | nss/services.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nss/services.c b/nss/services.c index a2df9cb..aa2c5b7 100644 --- a/nss/services.c +++ b/nss/services.c @@ -2,7 +2,7 @@ service.c - NSS lookup functions for services database Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong + Copyright (C) 2006-2014 Arthur de Jong Copyright (C) 2010 Symas Corporation This library is free software; you can redistribute it and/or @@ -104,7 +104,7 @@ nss_status_t _nss_ldap_endservent(void) static char *servent2str(struct servent *result, char *buffer, size_t buflen) { int res, i; - res = snprintf(buffer, buflen, "%s %d/%s", result->s_name, result->s_port, + res = snprintf(buffer, buflen, "%s %d/%s", result->s_name, ntohs(result->s_port), result->s_proto); if ((res < 0) || (res >= (int)buflen)) return NULL; |