Subject: pkg/14073: statfs() compatibility function bug in zoularis' libbsdcompat
To: None <gnats-bugs@gnats.netbsd.org>
From: Stoned Elipot <seb@script.jussieu.fr>
List: netbsd-bugs
Date: 09/26/2001 14:10:08
>Number:         14073
>Category:       pkg
>Synopsis:       statfs() compatibility function bug in zoularis' libbsdcompat
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 26 05:11:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stoned Elipot
>Release:        current
>Organization:
SCRIPT, Paris VII University, France
>Environment:
System: SunOS deep-space-9 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-60
>Description:
The compatibility function statfs() in Zoularis' ilibbsdcompat misuse
solaris' struct statvfs f_bsize member. This lead to false warning
from pkg_add while checking if enought disk space is avalaible for
extracting.
>How-To-Repeat:
Try to pkg_add a somewhat big binary package on Solaris/Zoularis, it may/will?
ask to set PKG_TMPDIR to a pathname on a FS with enough space left even if
default tempdir (/var/tmp) has already enough.

This is closely related to PR kern/2779, A similar fix was submitted in it.
Besides this PR's description is much more complete than this one :)
>Fix:

Index: lib/libbsdcompat/statfs.c
===================================================================
RCS file: /cvsroot/othersrc/zoularis/bsd/lib/libbsdcompat/statfs.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 statfs.c
--- statfs.c	1999/04/12 07:43:21	1.1.1.1
+++ statfs.c	2001/09/26 11:58:11
@@ -55,8 +55,8 @@
 		sfs->f_flags |= MNT_RDONLY;
 	if (vfs->f_flag & ST_NOSUID)	
 		sfs->f_flags |= MNT_NOSUID;
-	sfs->f_bsize = vfs->f_bsize;
-	sfs->f_iosize = 8192;		/* XXX: fake */
+	sfs->f_bsize = vfs->f_frsize;
+	sfs->f_iosize = vfs->f_bsize;
 	sfs->f_blocks = vfs->f_blocks;
 	sfs->f_bfree = vfs->f_bfree;
 	sfs->f_bavail = vfs->f_bavail;
>Release-Note:
>Audit-Trail:
>Unformatted: