chiark / gitweb /
do not shift by 32 debian/2.0.1
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 Jun 2012 00:53:16 +0000 (01:53 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 Jun 2012 00:53:16 +0000 (01:53 +0100)
debian/changelog
helper.c

index dc958fa22bc984f36b6aabac7157a2f372a362a7..c9fa8bc2401e26133803047dce3d9645206582f2 100644 (file)
@@ -1,3 +1,12 @@
+authbind (2.0.1) unstable; urgency=low
+
+  Bugfix:
+  * 0-length ipv4 address masks (ie, 0.0.0.0/0) in byuid files wouldn't
+    work because they would attempt a 32-bit shift.  This was reported
+    against Ubuntu in Launchpad but the but is here too.  LP: #514278.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Sun, 03 Jun 2012 01:50:13 +0100
+
 authbind (2.0.0) unstable; urgency=medium
 
   Important new functionality:
 authbind (2.0.0) unstable; urgency=medium
 
   Important new functionality:
index 0841cd2f89f2083acff44e5669b5e5ca9c8a7089..db815c11a322606d6081189b3893e673d24671aa 100644 (file)
--- a/helper.c
+++ b/helper.c
@@ -187,7 +187,7 @@ int main(int argc, const char *const *argv) {
 
       unsigned long thaddr, thmask;
       thaddr= (a1<<24)|(a2<<16)|(a3<<8)|(a4);
 
       unsigned long thaddr, thmask;
       thaddr= (a1<<24)|(a2<<16)|(a3<<8)|(a4);
-      thmask= 0x0ffffffffUL<<(32-alen);
+      thmask= alen ? 0x0ffffffffUL<<(32-alen) : 0;
       if ((haddr4&thmask) != thaddr) continue;
 
     } else {
       if ((haddr4&thmask) != thaddr) continue;
 
     } else {