diff options
author | scottl <scottl@FreeBSD.org> | 2005-01-14 16:35:34 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2005-01-14 16:35:34 +0000 |
commit | 6f4f1f3f1d5f8742b967ea2889eba7ca828c9c24 (patch) | |
tree | 3ec9d935743b878afb18172c249b599fb6cf6170 | |
parent | 049337abcfd6fbc4c05f4fbcf3b2b96d8ea0c4e3 (diff) | |
download | FreeBSD-src-6f4f1f3f1d5f8742b967ea2889eba7ca828c9c24.zip FreeBSD-src-6f4f1f3f1d5f8742b967ea2889eba7ca828c9c24.tar.gz |
NULL-terminate the . and .. directory entries. Apparently some tools ignore
d_namlen and assume that d_name is null-terminated.
Submitted by: Andriy Gapon
-rw-r--r-- | sys/fs/udf/udf_vnops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 0fb714c..b0ce23a 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -762,6 +762,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_fileno = node->hash_id; dir.d_type = DT_DIR; dir.d_name[0] = '.'; + dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); uiodir.dirent = &dir; @@ -773,6 +774,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = DT_DIR; dir.d_name[0] = '.'; dir.d_name[1] = '.'; + dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); uiodir.dirent = &dir; |