Subject: pkg/10478: pkg tripwire
To: None <gnats-bugs@gnats.netbsd.org>
From: None <root@gcc.ansic.net>
List: netbsd-bugs
Date: 06/29/2000 14:34:15
>Number:         10478
>Category:       pkg
>Synopsis:       Tripwire seg fualts on NetBSD/SPARC-Fix included
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 29 14:35:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     System Administrator, LeRoy Miller
>Release:        1.4.2
>Organization:
ANSIC Networks
	
>Environment:
System: NetBSD gcc 1.4.2 NetBSD 1.4.2 (GCC) #0: Fri Jun 16 22:37:29 EDT 2000 root@gcc:/usr/src/sys/arch/sparc/compile/GCC sparc


>Description:
	Tripwire pkg segfaults on sparc systems. tw assumes st_size is 32 bits
	when it's 64bit (off_t) when it calls the printf() statement in the
	patch it try's to dereferance the second half of the st_size field on
	the stack as a string (for teh %s) changing %7d to %7lld fixes this
	from utils.c printf(" %-9.9s %7d %s", owner, statbuf.st_size, 
	a_time + 4);
>How-To-Repeat:
	Try to run tripwire on a sparc/NetBSD machine
>Fix:
	diff -c format
	*** utils.c     Thu Jun 29 16:24:07 2000
	--- /usr/pkgsrc/security/tripwire/work.sparc/tripwire-1.2/src/utils.c.orig      Mon Jul 25 12:23:16 1994
	***************
	*** 697,703 ****
  
	        print_perm((uint32)statbuf.st_mode);
  
	!       (void) printf(" %-9.9s %7lld %s", owner, statbuf.st_size,
                                                a_time + 4);
		printf(" %s\n", name);
  
	--- 697,703 ----
  
	print_perm((uint32)statbuf.st_mode);
  
	!       (void) printf(" %-9.9s %7d %s", owner, statbuf.st_size,
                                                a_time + 4);
        	printf(" %s\n", name);

>Release-Note:
>Audit-Trail:
>Unformatted: