diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h index e0e5da4d60c5..fb00f5bfd9c1 100644 --- a/sys/sys/dirent.h +++ b/sys/sys/dirent.h @@ -1,4 +1,4 @@ -/* $NetBSD: dirent.h,v 1.27 2011/08/09 20:05:04 dholland Exp $ */ +/* $NetBSD: dirent.h,v 1.28 2011/09/27 01:40:32 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -52,7 +52,7 @@ struct dirent { uint16_t d_namlen; /* length of string in d_name */ uint8_t d_type; /* file type, see below */ #if defined(_NETBSD_SOURCE) -#define MAXNAMLEN 511 +#define MAXNAMLEN 511 /* must be kept in sync with NAME_MAX */ char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ #else char d_name[511 + 1]; /* name must be no longer than this */ diff --git a/sys/sys/extattr.h b/sys/sys/extattr.h index 9734b8ecdc60..48a84757471f 100644 --- a/sys/sys/extattr.h +++ b/sys/sys/extattr.h @@ -1,4 +1,4 @@ -/* $NetBSD: extattr.h,v 1.7 2011/08/03 04:11:17 manu Exp $ */ +/* $NetBSD: extattr.h,v 1.8 2011/09/27 01:40:32 christos Exp $ */ /*- * Copyright (c) 1999-2001 Robert N. M. Watson @@ -52,12 +52,12 @@ #ifdef _KERNEL -#include +#include /* VOP_LISTEXTATTR flags */ #define EXTATTR_LIST_LENPREFIX 1 /* names with length prefix */ -#define EXTATTR_MAXNAMELEN NAME_MAX +#define EXTATTR_MAXNAMELEN KERNEL_NAME_MAX struct lwp; struct vnode; int extattr_check_cred(struct vnode *, int, kauth_cred_t, diff --git a/sys/sys/mqueue.h b/sys/sys/mqueue.h index 26731618c90b..7cba65f3ad8e 100644 --- a/sys/sys/mqueue.h +++ b/sys/sys/mqueue.h @@ -1,4 +1,4 @@ -/* $NetBSD: mqueue.h,v 1.13 2011/04/24 20:17:53 rmind Exp $ */ +/* $NetBSD: mqueue.h,v 1.14 2011/09/27 01:40:32 christos Exp $ */ /* * Copyright (c) 2007-2009 Mindaugas Rasiukevicius @@ -50,6 +50,7 @@ struct mq_attr { #include #include #include +#include /* * Flags below are used in mq_flags for internal purposes. @@ -62,7 +63,7 @@ struct mq_attr { #define MQ_RECEIVE 0x20000000 /* Maximal length of mqueue name */ -#define MQ_NAMELEN (NAME_MAX + 1) +#define MQ_NAMELEN (KERNEL_NAME_MAX + 1) /* Default size of the message */ #define MQ_DEF_MSGSIZE 1024 diff --git a/sys/sys/param.h b/sys/sys/param.h index 29aae29a31d9..44f0fbfb5ba5 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.393 2011/09/23 14:47:41 christos Exp $ */ +/* $NetBSD: param.h,v 1.394 2011/09/27 01:40:32 christos Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -323,6 +323,15 @@ #define MAXPATHLEN PATH_MAX #define MAXSYMLINKS 32 +/* + * This is the maximum individual filename component length enforced by + * namei. Filesystems cannot exceed this limit. The upper bound for that + * limit is NAME_MAX. We don't bump it for now, for compatibility with + * old binaries during the time where MAXPATHLEN was 511 and NAME_MAX was + * 255 + */ +#define KERNEL_NAME_MAX 255 + /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) diff --git a/sys/sys/syslimits.h b/sys/sys/syslimits.h index 34b14fff5a06..57ed4a18e688 100644 --- a/sys/sys/syslimits.h +++ b/sys/sys/syslimits.h @@ -1,4 +1,4 @@ -/* $NetBSD: syslimits.h,v 1.24 2008/02/25 17:29:13 ad Exp $ */ +/* $NetBSD: syslimits.h,v 1.25 2011/09/27 01:40:32 christos Exp $ */ /* * Copyright (c) 1988, 1993 @@ -46,7 +46,8 @@ #define LINK_MAX 32767 /* max file link count */ #define MAX_CANON 255 /* max bytes in term canon input line */ #define MAX_INPUT 255 /* max bytes in terminal input */ -#define NAME_MAX 255 /* max bytes in a file name */ +#define NAME_MAX 511 /* max bytes in a file name, must be + /* kept in sync with MAXPATHLEN */ #define NGROUPS_MAX 16 /* max supplemental group id's */ #define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */ #ifndef OPEN_MAX diff --git a/sys/sys/xattr.h b/sys/sys/xattr.h index df011ea5ed20..5b8165c737e5 100644 --- a/sys/sys/xattr.h +++ b/sys/sys/xattr.h @@ -1,4 +1,4 @@ -/* $NetBSD: xattr.h,v 1.4 2011/07/18 11:28:24 drochner Exp $ */ +/* $NetBSD: xattr.h,v 1.5 2011/09/27 01:40:32 christos Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -41,13 +41,13 @@ #define _SYS_XATTR_H_ #include -#include +#include /* * This is compatible with EXTATTR_MAXNAMELEN, and also happens to be * the same as Linux (255). */ -#define XATTR_NAME_MAX NAME_MAX +#define XATTR_NAME_MAX KERNEL_NAME_MAX #define XATTR_SIZE_MAX 65536 /* NetBSD does not enforce this */