From loyer@quickstep.ensta.fr  Sat Jan  9 01:47:33 1999
Received: from ensta.ensta.fr (ensta.ensta.fr [147.250.1.1])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA05289
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 9 Jan 1999 01:47:31 -0800 (PST)
          (envelope-from loyer@quickstep.ensta.fr)
Received: from quickstep.ensta.fr (quickstep.ensta.fr [147.250.61.100])
	by ensta.ensta.fr (8.8.5/8.8.5) with ESMTP id KAA29867
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 9 Jan 1999 10:46:58 +0100 (MET)
Received: (from loyer@localhost)
	by quickstep.ensta.fr (8.9.1/8.8.5) id XAA18447;
	Fri, 8 Jan 1999 23:57:52 +0100 (CET)
Message-Id: <199901082257.XAA18447@quickstep.ensta.fr>
Date: Fri, 8 Jan 1999 23:57:52 +0100 (CET)
From: loyer@ensta.fr
Reply-To: loyer@ensta.fr
To: FreeBSD-gnats-submit@freebsd.org
Subject: ppp exit on signal 11 by PPP because alias.log not opened
X-Send-Pr-Version: 3.2

>Number:         9403
>Category:       bin
>Synopsis:       ppp exit on signal 11 by PPP because alias.log not opened
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan  9 01:50:00 PST 1999
>Closed-Date:    Sat Jan 9 18:07:08 PST 1999
>Last-Modified:  Sat Jan  9 18:07:30 PST 1999
>Originator:     Frederic LOYER
>Release:        FreeBSD 3.0-RELEASE i386
>Organization:
ENSTA
>Environment:

This bug is caused by PPP launched by non-root user with folowing options:
 alias enable yes
 alias log yes

>Description:

ppp exit on signal 11 when trying to log aliasing activities but the
/var/log/alias.log file couln't be opened.

Adding some "printf" in alias_bd.c show that when InitPacketAliasLog
doesn't manage to open /var/log/alias.log, it doesn't set the
PKT_ALIAS_LOG bit, but the caller (PacketAliasSetMode) does.

Afterward, ShowAliasStats() will try to use the monitorFile FILE pointer
with fprintf and cause a segmentation fault since monitorFile==NULL.

>How-To-Repeat:

Setting ppp with `alias enable yes' and `alias log yes' options.

Running it by an allowed non root user, with "-auto <a_label>" arguments.

Send a packet which trigger the dial and aliasing process
(telnet <an_Internet_addr>)

>Fix:
	
In /usr/src/lib/libalias, modifying alias_db.c with the following patch.
NB: The same shouldn't be made with NO_FW_PUNCH (InitPunchFW doesn't
touch packetAliasMode).

*** alias_db.c.orig     Fri Jan  8 23:30:13 1999
--- alias_db.c  Fri Jan  8 23:33:21 1999
***************
*** 2036,2041 ****
--- 2036,2042 ----
      if (~flags & mask & PKT_ALIAS_LOG) {
          UninitPacketAliasLog();
      }
+     mask &= ~PKT_ALIAS_LOG;
  
  #ifndef NO_FW_PUNCH
  /* Start punching holes in the firewall? */

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Sat Jan 9 18:07:08 PST 1999 
State-Changed-Why:  
Fixed in -current & -stable 
. 
>Unformatted:
