Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153688009
D9500.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D9500.id.diff
View Options
Index: head/lib/libstand/ufs.c
===================================================================
--- head/lib/libstand/ufs.c
+++ head/lib/libstand/ufs.c
@@ -586,7 +586,7 @@
ncp = cp;
while ((c = *cp) != '\0' && c != '/') {
- if (++len > MAXNAMLEN) {
+ if (++len > UFS_MAXNAMLEN) {
rc = ENOENT;
goto out;
}
Index: head/sbin/fsck_ffs/fsutil.c
===================================================================
--- head/sbin/fsck_ffs/fsutil.c
+++ head/sbin/fsck_ffs/fsutil.c
@@ -889,7 +889,7 @@
cp -= len;
memmove(cp, namebuf, (size_t)len);
*--cp = '/';
- if (cp < &namebuf[MAXNAMLEN])
+ if (cp < &namebuf[UFS_MAXNAMLEN])
break;
ino = idesc.id_number;
}
Index: head/sbin/fsck_ffs/pass3.c
===================================================================
--- head/sbin/fsck_ffs/pass3.c
+++ head/sbin/fsck_ffs/pass3.c
@@ -52,7 +52,7 @@
int loopcnt, inpindex, state;
ino_t orphan;
struct inodesc idesc;
- char namebuf[MAXNAMLEN+1];
+ char namebuf[UFS_MAXNAMLEN+1];
for (inpindex = inplast - 1; inpindex >= 0; inpindex--) {
if (got_siginfo) {
Index: head/sys/ufs/ufs/dir.h
===================================================================
--- head/sys/ufs/ufs/dir.h
+++ head/sys/ufs/ufs/dir.h
@@ -57,7 +57,7 @@
* the length of the entry, and the length of the name contained in
* the entry. These are followed by the name padded to a 4 byte boundary
* with null bytes. All names are guaranteed null terminated.
- * The maximum length of a name in a directory is MAXNAMLEN.
+ * The maximum length of a name in a directory is UFS_MAXNAMLEN.
*
* The macro DIRSIZ(fmt, dp) gives the amount of space required to represent
* a directory entry. Free space in a directory is represented by
@@ -72,14 +72,15 @@
* dp->d_ino set to 0.
*/
#define DIRBLKSIZ DEV_BSIZE
-#define MAXNAMLEN 255
+#define UFS_MAXNAMLEN 255
struct direct {
u_int32_t d_ino; /* inode number of entry */
u_int16_t d_reclen; /* length of this record */
u_int8_t d_type; /* file type, see below */
u_int8_t d_namlen; /* length of string in d_name */
- char d_name[MAXNAMLEN + 1];/* name with length <= MAXNAMLEN */
+ char d_name[UFS_MAXNAMLEN + 1];
+ /* name with length <= UFS_MAXNAMLEN */
};
/*
@@ -124,7 +125,7 @@
/*
* Template for manipulating directories. Should use struct direct's,
- * but the name field is MAXNAMLEN - 1, and this just won't do.
+ * but the name field is UFS_MAXNAMLEN - 1, and this just won't do.
*/
struct dirtemplate {
u_int32_t dot_ino;
Index: head/sys/ufs/ufs/dirhash.h
===================================================================
--- head/sys/ufs/ufs/dirhash.h
+++ head/sys/ufs/ufs/dirhash.h
@@ -48,7 +48,7 @@
#define DIRHASH_DEL (-2) /* deleted entry; may be part of chain */
#define DIRALIGN 4
-#define DH_NFSTATS (DIRECTSIZ(MAXNAMLEN + 1) / DIRALIGN)
+#define DH_NFSTATS (DIRECTSIZ(UFS_MAXNAMLEN + 1) / DIRALIGN)
/* max DIRALIGN words in a directory entry */
/*
Index: head/sys/ufs/ufs/ufs_lookup.c
===================================================================
--- head/sys/ufs/ufs/ufs_lookup.c
+++ head/sys/ufs/ufs/ufs_lookup.c
@@ -771,7 +771,7 @@
* record length must be multiple of 4
* entry must fit in rest of its DIRBLKSIZ block
* record must be large enough to contain entry
- * name is not longer than MAXNAMLEN
+ * name is not longer than UFS_MAXNAMLEN
* name must be as long as advertised, and null terminated
*/
int
@@ -792,7 +792,7 @@
# endif
if ((ep->d_reclen & 0x3) != 0 ||
ep->d_reclen > DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1)) ||
- ep->d_reclen < DIRSIZ(OFSFMT(dp), ep) || namlen > MAXNAMLEN) {
+ ep->d_reclen < DIRSIZ(OFSFMT(dp), ep) || namlen > UFS_MAXNAMLEN) {
/*return (1); */
printf("First bad\n");
goto bad;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 23, 10:39 PM (40 m, 8 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32049034
Default Alt Text
D9500.id.diff (3 KB)
Attached To
Mode
D9500: ufs: Use a UFS_MAXNAMLEN constant
Attached
Detach File
Event Timeline
Log In to Comment