Even though msdosfs never truncates file names it advertises _PC_NO_TRUNC

as zero.  Make it advertise one (no_trunc == true).

Names longer than NAME_MAX (255) will never pass namei() btw.

Fixes PR #43670 (msdosfs claims support for filenames longer than {NAME_MAX},
                 but fails)
This commit is contained in:
hannken 2011-07-20 11:52:00 +00:00
parent d1b2ece17f
commit 9f9c02f1cd
2 changed files with 4 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_vnops.c,v 1.77 2011/06/16 09:21:02 hannken Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.78 2011/07/20 11:52:00 hannken Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.77 2011/06/16 09:21:02 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.78 2011/07/20 11:52:00 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1771,7 +1771,7 @@ msdosfs_pathconf(void *v)
*ap->a_retval = 1;
return (0);
case _PC_NO_TRUNC:
*ap->a_retval = 0;
*ap->a_retval = 1;
return (0);
case _PC_SYNC_IO:
*ap->a_retval = 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_vnops.c,v 1.24 2011/05/30 13:10:38 martin Exp $ */
/* $NetBSD: t_vnops.c,v 1.25 2011/07/20 11:52:00 hannken Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -439,8 +439,6 @@ create_nametoolong(const atf_tc_t *tc, const char *mp)
if (val == -1)
atf_tc_fail_errno("pathconf");
if (FSTYPE_MSDOS(tc))
atf_tc_expect_fail("PR kern/43670");
fd = rump_sys_open(name, O_RDWR|O_CREAT, 0666);
if (val != 0 && (fd != -1 || errno != ENAMETOOLONG))
atf_tc_fail_errno("open");
@ -511,8 +509,6 @@ rename_nametoolong(const atf_tc_t *tc, const char *mp)
if (val == -1)
atf_tc_fail_errno("pathconf");
if (FSTYPE_MSDOS(tc))
atf_tc_expect_fail("PR kern/43670");
res = rump_sys_rename("dummy", name);
if (val != 0 && (res != -1 || errno != ENAMETOOLONG))
atf_tc_fail_errno("rename");