Subject: pkg/14755: kcontrol's info/partitions page seg faults with nfs partitions
To: None <gnats-bugs@gnats.netbsd.org>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: netbsd-bugs
Date: 11/28/2001 14:05:07
>Number:         14755
>Category:       pkg
>Synopsis:       kcontrol's info/partitions page seg faults with nfs partitions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 27 17:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mark Davies
>Release:        NetBSD 1.5Y
>Organization:
Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand.
>Environment:
	
	
System: NetBSD turakirae.mcs.vuw.ac.nz 1.5Y NetBSD 1.5Y (MCS_WORKSTATION) #1: Tue Oct 30 22:54:21 NZDT 2001 mark@turakirae.mcs.vuw.ac.nz:/src/work/src/sys/arch/i386/compile/MCS_WORKSTATION i386
Architecture: i386
Machine: i386
>Description:
	kcontrol in the kdebase2 package seg faults when you visit the
	Information:Partitions page with an nfs filesystem mounted with
	no mount options.

	This is because /sbin/mount doesn't give a bracketed list of flags
	in this case eg:

city-art% /sbin/mount
/dev/wd0a on / type ffs (local)
	[...]
pid206@city-art:/u/staff on /u/staff type nfs (unknown flag 0x100000)
rialto:/am/rialto/home on /am/rialto/home type nfs

and kcontrol expects the bracketed bit to always be there.

	
>How-To-Repeat:
	
>Fix:
	Following patch to kdebase2/patches/patch-an fixes.

Index: patch-an
===================================================================
RCS file: /src/cvs/netbsd/pkgsrc/x11/kdebase2/patches/patch-an,v
retrieving revision 1.2
diff -u -r1.2 patch-an
--- patch-an	2001/10/15 22:46:00	1.2
+++ patch-an	2001/11/27 09:34:16
@@ -206,7 +206,7 @@
  
  		device = strsep(&line, " ");
  
-@@ -286,10 +303,28 @@
+@@ -286,10 +303,32 @@
  		(void) strsep(&line, " "); // consume word "type"
  		type = strsep(&line, " ");
  
@@ -215,8 +215,12 @@
 -		olditem = new QListViewItem(lbox, olditem, device, mountpoint,
 -					type, flags);
 +		// Skip leading '(' and trailing ')'
-+		line++;
-+		flags = strsep(&line, ")");
++		if (line != NULL) {
++			line++;
++			flags = strsep(&line, ")");
++		} else {
++			flags = "";
++		}
 +
 +		if (statfs(mountpoint, &sfs) == 0) {
 +			tsz = ((1LL * sfs.f_blocks * sfs.f_bsize / 1024) + 513)


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