diff options
author | Ed Maste <emaste@FreeBSD.org> | 2023-03-31 16:57:15 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2023-04-14 12:10:37 +0000 |
commit | 67870816419a35256d989874a6370a412fe92b7e (patch) | |
tree | 8be5ca182d3f00225823c407295d5bae81b7e8db | |
parent | ac8ec8c7cc42cdd7288352f2bea08af811857479 (diff) | |
download | src-67870816419a35256d989874a6370a412fe92b7e.tar.gz src-67870816419a35256d989874a6370a412fe92b7e.zip |
makefs: remove CD9660MAXPATH #define
It was used only in constructing the host path that contains file
content, which is not related to anything CD9660-specific. PATH_MAX is
the appropriate limit. See OpenBSD commit 299d8950f319.
Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 2f11df63374d279238e4836125a81fa2c5234730)
-rw-r--r-- | usr.sbin/makefs/cd9660.c | 4 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660.h | 2 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660/cd9660_write.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 40b2488e99e5..4159e08c8210 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1582,10 +1582,10 @@ cd9660_compute_full_filename(cd9660node *node, char *buf) { int len; - len = CD9660MAXPATH + 1; + len = PATH_MAX; len = snprintf(buf, len, "%s/%s/%s", node->node->root, node->node->path, node->node->name); - if (len > CD9660MAXPATH) + if (len >= PATH_MAX) errx(EXIT_FAILURE, "Pathname too long."); } diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index d854429a24bf..80b49f86ecf8 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -65,8 +65,6 @@ #define INODE_WARNX(__x) #endif /* DEBUG */ -#define CD9660MAXPATH 4096 - #define ISO_STRING_FILTER_NONE = 0x00 #define ISO_STRING_FILTER_DCHARS = 0x01 #define ISO_STRING_FILTER_ACHARS = 0x02 diff --git a/usr.sbin/makefs/cd9660/cd9660_write.c b/usr.sbin/makefs/cd9660/cd9660_write.c index c77ba2b5f198..6716c2f98704 100644 --- a/usr.sbin/makefs/cd9660/cd9660_write.c +++ b/usr.sbin/makefs/cd9660/cd9660_write.c @@ -273,7 +273,7 @@ cd9660_write_file(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode) /* Todo : clean up variables */ - temp_file_name = ecalloc(CD9660MAXPATH + 1, 1); + temp_file_name = ecalloc(PATH_MAX, 1); buf = emalloc(diskStructure->sectorSize); if ((writenode->level != 0) && !(writenode->node->type & S_IFDIR)) { |