From 12ee5f9c3a67471ef6ebf510f5b30b98037b9b61 Mon Sep 17 00:00:00 2001 From: yamt Date: Fri, 28 Jan 2005 10:12:23 +0000 Subject: [PATCH] nfs_namei: return EACCES for empty filenames as rfc1813 says. --- sys/nfs/nfs_subs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 13f3e224282f..91fff68446e3 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_subs.c,v 1.146 2005/01/28 10:11:31 yamt Exp $ */ +/* $NetBSD: nfs_subs.c,v 1.147 2005/01/28 10:12:23 yamt Exp $ */ /* * Copyright (c) 1989, 1993 @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.146 2005/01/28 10:11:31 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.147 2005/01/28 10:12:23 yamt Exp $"); #include "fs_nfs.h" #include "opt_nfs.h" @@ -2104,6 +2104,8 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) if ((len + 1) > MAXPATHLEN) return (ENAMETOOLONG); + if (len == 0) + return (EACCES); cnp->cn_pnbuf = PNBUF_GET(); /*