NetBSD Problem Report #13425

Received: (qmail 23652 invoked from network); 10 Jul 2001 14:06:52 -0000
Message-Id: <200107101410.f6AEA0L08725@zelz26.zel.kfa-juelich.de>
Date: Tue, 10 Jul 2001 16:10:00 +0200 (MEST)
From: M.Drochner@fz-juelich.de
Reply-To: M.Drochner@fz-juelich.de
To: gnats-bugs@gnats.netbsd.org
Subject: pathconf(_PC_PATH_MAX) doesn't work on NFS
X-Send-Pr-Version: 3.95

>Number:         13425
>Category:       kern
>Synopsis:       pathconf(_PC_PATH_MAX) doesn't work on NFS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 10 14:07:00 +0000 2001
>Closed-Date:    
>Last-Modified:  
>Originator:     M.Drochner
>Release:        NetBSD 1.5.1
>Organization:

>Environment:
	NetBSD-1.5.1, should be present on -current too
System: NetBSD zelz26 1.5.1 NetBSD 1.5.1 (CSC) #15: Mon Jun 18 12:29:43 MEST 2001 drochner@zelz26:/home/drochner/netbsd-1.5/sys/arch/i386/compile/CSC i386


>Description:
	pathconf(<path>, _PC_PATH_MAX) fails with EINVAL if <path> is NFS
mounted. Inspection of sys/nfs/nfs_vnops.c:nfs_pathconf() shows that the
_PC_PATH_MAX case isn't handled.
Applications relying on this to allocate temporary storage fail horribly.

>How-To-Repeat:
Try the following on a diskless machine or with an NFS mounted
directory given as command line argument:

#include <stdio.h>
#include <unistd.h>
#include <err.h>

int
main(int argc, char **argv)
{
        char *p;
        int pm;

        if (argc > 1)
                p = argv[1];
        else
                p = "/";
        pm = pathconf (p, _PC_PATH_MAX);
        if (pm < 0)
                err(1, "pm");
        printf("pm=%d\n", pm);
        return (0);
}

>Fix:
	Don't know. Does NFSv3 have this? If not, perhaps use _PC_NAME_MAX
which should not be smaller at least...
>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.