Bug#1002685: bullseye-pu: package prips/1.1.1-3+deb11u1

2022-02-19 Thread Adam D. Barratt
Control: tags -1 + confirmed

On Mon, 2021-12-27 at 13:21 +0200, Peter Pentchev wrote:
> This is a future unblock request before I upload prips-1.1.1-
> 3+deb11u1
> to fix two upstream bugs that affect the base functionality of the
> program:
> an infinite loop if it is asked to print the addresses in a block
> that
> ends at the last IPv4 address (255.255.255.255), and incorrect output
> if
> asked to combine two very different IP addresses (e.g. 1.1.1.1 and
> 230.120.1.1) into a single CIDR block.
> 

Please go ahead; sorry for the delay.

Regards,

Adam



Bug#1002685: bullseye-pu: package prips/1.1.1-3+deb11u1

2021-12-27 Thread Peter Pentchev
Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian@packages.debian.org
Usertags: pu
X-Debbugs-Cc: r...@ringlet.net

Hi,

First of all, thanks for all your work on Debian!

[ Reason ]
This is a future unblock request before I upload prips-1.1.1-3+deb11u1
to fix two upstream bugs that affect the base functionality of the program:
an infinite loop if it is asked to print the addresses in a block that
ends at the last IPv4 address (255.255.255.255), and incorrect output if
asked to combine two very different IP addresses (e.g. 1.1.1.1 and
230.120.1.1) into a single CIDR block.

[ Impact ]
Incorrect operation of the prips tool with certain input data.

[ Tests ]
The fix for the 255.255.255.255 address handling includes a test added
to the appropriate file in the test suite. The fix for the CIDR output
mode includes a new file in the test suite that tests CIDR output;
it was not possible to only include the single new test, since this file
did not exist in the prips-1.1.1 test suite in bullseye.

[ Risks ]
The fixes are almost trivial, given familiarity with the C language.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
- add a test for a block that ends at 255.255.255.255
- fix the operation of prips for such a block
- add a couple of tests for the CIDR mode output
- fix the prips CIDR output for certain input data

[ Other info ]

Thanks in advance, and keep up the great work!
diff -Nru prips-1.1.1/debian/changelog prips-1.1.1/debian/changelog
--- prips-1.1.1/debian/changelog2020-05-10 18:58:46.0 +0300
+++ prips-1.1.1/debian/changelog2021-12-26 23:15:45.0 +0200
@@ -1,3 +1,13 @@
+prips (1.1.1-3+deb11u1) bullseye; urgency=medium
+
+  * Add two patches from the 1.2.0 upstream version:
+- stop-at-last-address: stop at 255.255.255.255 instead of wrapping
+  over to 0.0.0.0 and going on forever. Closes: #1001923
+- fix-different-cidr: fix the CIDR (-c) output when the addresses
+  differ in their very first bit. Closes: #1001924
+
+ -- Peter Pentchev   Sun, 26 Dec 2021 23:15:45 +0200
+
 prips (1.1.1-3) unstable; urgency=medium
 
   * Declare compliance with Debian Policy 4.5.0 with no changes.
diff -Nru prips-1.1.1/debian/patches/fix-different-cidr.patch 
prips-1.1.1/debian/patches/fix-different-cidr.patch
--- prips-1.1.1/debian/patches/fix-different-cidr.patch 1970-01-01 
02:00:00.0 +0200
+++ prips-1.1.1/debian/patches/fix-different-cidr.patch 2021-12-26 
23:15:45.0 +0200
@@ -0,0 +1,106 @@
+Description: CIDR mode: handle "totally different" correctly.
+ If the addresses differ in their very first bit, report "0.0.0.0/0"
+ instead of the incorrect "x.y.z.t/32".
+Bug-Debian: https://bugs.debian.org/1001924
+Origin: upstream, 
https://gitlab.com/prips/prips/-/commit/1afd3e6976f946317f3ac9980685549b5216a6f5
+Author: Peter Pentchev 
+Last-Updated: 2021-12-26
+
+--- /dev/null
 b/t/06-cidrize.t
+@@ -0,0 +1,74 @@
++#!/bin/sh
++#
++# Copyright (c) 2021  Peter Pentchev
++# All rights reserved.
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions
++# are met:
++# 1. Redistributions of source code must retain the above copyright
++#notice, this list of conditions and the following disclaimer.
++# 2. Redistributions in binary form must reproduce the above copyright
++#notice, this list of conditions and the following disclaimer in the
++#documentation and/or other materials provided with the distribution.
++#
++# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++# SUCH DAMAGE.
++
++if [ -f 'tap-functions.sh' ]; then
++  . tap-functions.sh
++elif [ -f 't/tap-functions.sh' ]; then
++  . t/tap-functions.sh
++else
++  echo 'Bail out! Could not find tap-functions.sh'
++  exit 99
++fi
++
++[ -z "$PRIPS" ] && PRIPS='./prips'
++
++plan_ 12
++
++v=`$PRIPS -c 127.0.0.0 127.0.0.7 2>/dev/null`
++res="$?"
++exp='127.0.0.0/29'
++if [ "$res" = 0 ]; then ok_; else not_ok_ "exit code $res"; fi
++if [ "$v" = "$exp" ]; then ok_; else not_ok_