chiark / gitweb /
finalise 2.0.0
[authbind.git] / libauthbind.c
index 183a206b25eb611193a0b574fd9443ccdba0b11c..a685ce3fe200c957a5f686a90eaf3e19811fb66b 100644 (file)
@@ -31,8 +31,6 @@
 #include <sys/wait.h>
 #include <netinet/in.h>
 
-static const char *rcsid="$Id$";
-
 #include "authbind.h"
 
 typedef void anyfn_type(void);
@@ -166,7 +164,7 @@ int bind(int fd, const struct sockaddr *addr, socklen_t addrlen) {
     goto bail;
   }
 
-  if (!geteuid() || portval == 0 || portval >= IPPORT_RESERVED) {
+  if (!geteuid() || portval == 0 || ntohs(portval) >= IPPORT_RESERVED) {
   bail:
     return old_bind(fd,addr,addrlen);
   }
@@ -205,9 +203,7 @@ int bind(int fd, const struct sockaddr *addr, socklen_t addrlen) {
     execl(HELPER,HELPER,addrarg,portarg,afarg,(char*)0);
     status= errno > 0 && errno < 127 ? errno : 127;
     STDERRSTR_CONST("libauthbind: possible installation problem - "
-                   "could not invoke " HELPER " (");
-    STDERRSTR_STRING(rcsid);
-    STDERRSTR_CONST(")\n");
+                   "could not invoke " HELPER "\n");
     exiterrno(status);
   }