Package: ppp-udeb Version: 2.4.4rel-10.1 Severity: important
approximate patch included. 1. if cycle breaks by timeout, second pass (with -U) not started at all. 2. at first pass variable $P contains " " (space), hence the condition [ -z "$P" ] returns false, that does not correspond to the logic. 3. if cycle breaks by timeout, function ppp_concentrator_on returns 0, which is wrong.
diff -Naur ppp-2.4.4rel.save/debian/ppp-udeb.postinst ppp-2.4.4rel/debian/ppp-udeb.postinst --- ppp-2.4.4rel.save/debian/ppp-udeb.postinst 2010-05-17 19:21:14.000000000 +0000 +++ ppp-2.4.4rel/debian/ppp-udeb.postinst 2010-05-17 19:24:39.000000000 +0000 @@ -29,7 +29,7 @@ R=0 rm -f /tmp/probe-finished /tmp/ppp-errors db_progress START 0 $TOTWAIT ppp/detect_progress - for P in " " "-U" ; do + for P in "" "-U" ; do ( R=$(/usr/sbin/pppoe-discovery -A $P -I $1 2>/tmp/ppp-errors | \ grep AC | wc -l) echo $R > /tmp/probe-finished ) & @@ -42,11 +42,11 @@ db_progress STEP 1 WAIT=$(($WAIT + 1)) if [ $WAIT -ge $MAXWAIT ]; then - touch /tmp/probe-finished + echo 0 > /tmp/probe-finished fi TO=$(grep Timeout /tmp/ppp-errors 2>/dev/null | wc -l || true) if [ $TO -eq 1 ]; then - touch /tmp/probe-finished + echo 0 > /tmp/probe-finished break fi log "pppoe probe output size: $(cat /tmp/probe-finished 2> /dev/null)" @@ -55,6 +55,10 @@ sleep $IW db_progress STEP $IW fi + R=$(cat /tmp/probe-finished 2>/dev/null) || true + if [ 1$R -ne 10 ]; then + break + fi done PROCESS=$(ps -A | grep pppoe-discovery | sed s:^[[:space:]]::g | \