[krb5] Enable pyrad-based tests
Nalin Dahyabhai
nalin at fedoraproject.org
Thu Dec 19 16:24:57 UTC 2013
commit 45d93c6d1c2373ba9bc93382ca801e4713d39f6d
Author: Nalin Dahyabhai <nalin at dahyabhai.net>
Date: Thu Dec 19 11:16:19 2013 -0500
Enable pyrad-based tests
- update a test wrapper to properly handle things that the new libkrad does,
and add python-pyrad as a build requirement so that we can run its tests
krb5.spec | 7 +++++++
noport.c | 32 ++++++++++++++++++--------------
2 files changed, 25 insertions(+), 14 deletions(-)
---
diff --git a/krb5.spec b/krb5.spec
index c329e88..8eef584 100644
--- a/krb5.spec
+++ b/krb5.spec
@@ -144,6 +144,9 @@ BuildRequires: net-tools, rpcbind
BuildRequires: hostname
BuildRequires: iproute
%endif
+%if 0%{?fedora} >= 9
+BuildRequires: python-pyrad
+%endif
%if %{WITH_LDAP}
BuildRequires: openldap-devel
@@ -964,6 +967,10 @@ exit 0
%{_sbindir}/uuserver
%changelog
+* Thu Dec 19 2013 Nalin Dahyabhai <nalin at redhat.com>
+- update a test wrapper to properly handle things that the new libkrad does,
+ and add python-pyrad as a build requirement so that we can run its tests
+
* Wed Dec 18 2013 Nalin Dahyabhai <nalin at redhat.com> - 1.12-4
- revise previous patch to initialize one more element
diff --git a/noport.c b/noport.c
index c7a0c01..22088eb 100644
--- a/noport.c
+++ b/noport.c
@@ -87,21 +87,25 @@ sendto(int sockfd, const void *buf, size_t len, int flags,
return next_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}
- switch (dest_addr->sa_family) {
- case AF_INET:
- port = ntohs(((struct sockaddr_in *)dest_addr)->sin_port);
- if (port_is_okay(port) != 0) {
- return -1;
- }
- break;
- case AF_INET6:
- port = ntohs(((struct sockaddr_in6 *)dest_addr)->sin6_port);
- if (port_is_okay(port) != 0) {
- return -1;
+ if (dest_addr != NULL) {
+ switch (dest_addr->sa_family) {
+ case AF_INET:
+ port = ((struct sockaddr_in *)dest_addr)->sin_port;
+ port = ntohs(port);
+ if (port_is_okay(port) != 0) {
+ return -1;
+ }
+ break;
+ case AF_INET6:
+ port = ((struct sockaddr_in6 *)dest_addr)->sin6_port;
+ port = ntohs(port);
+ if (port_is_okay(port) != 0) {
+ return -1;
+ }
+ break;
+ default:
+ break;
}
- break;
- default:
- break;
}
return next_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}
More information about the scm-commits
mailing list