Commit Graph

371 Commits

Author SHA1 Message Date
hgutch 0d7f3d7673 Make sure daddr_t is a 64 bit type when building tools.
(see also PR sw-bug/56742 ).
2022-03-06 08:31:54 +00:00
hannken 514b0270dd A component name is a counted string (cn_nameptr, cn_namelen),
not a zero terminated string cn_nameptr.

Change the following operations to work with counted strings:

v7fs_file_lookup_by_name()
v7fs_file_allocate()
v7fs_file_deallocate()
v7fs_directory_add_entry()
v7fs_directory_remove_entry()
v7fs_file_rename()
v7fs_file_link()
v7fs_dirent_filename()

Adapt all vnode operations with component names as argument.
2022-02-11 10:55:15 +00:00
andvar 427b92d9af s/filname/filename/ 2021-12-21 21:28:31 +00:00
reinoud 2e7f29dcb8 Explain cd9660 and udf exceptions on the rule that the default sectorsize is
512.
2021-11-12 07:41:55 +00:00
thorpej 8086f46e37 Sanitize the symbol namespace. NFC. 2021-10-23 16:58:17 +00:00
hannken 25fae635e5 Factor out the lookup results from struct denode.
No functional change.
2021-10-23 07:38:33 +00:00
andvar 16e91b5f21 s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recommended/ 2021-08-21 09:59:45 +00:00
simonb ba42c78d37 Add a -L option to follow all symbolic links. Useful if you have symlinks
in a makefs directory tree but want to refer to the actual file.
2021-04-03 14:10:56 +00:00
jmcneill 8ab169f5c2 Add "efi" as a supported boot image type and derive the platform ID for
the validation entry from the default boot image instead of hard-coding
X86.
2020-11-15 00:18:48 +00:00
reinoud 551fa9b117 rock_ridge_move_count is only incremented and can never be negative so change
%08i to %08u.
This removes a warning when compiling with tools outside ./build.sh
2020-11-10 20:48:29 +00:00
mrg cb93b81028 add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
2020-09-06 07:20:26 +00:00
martin 05a291731f Remove unused variable (to fix the build) 2020-04-18 12:25:01 +00:00
reinoud 93d5858ef9 Believe the datablocks predictor when determining if data on a node gets
stored internal or not. Also make a note that the datablocks predictor takes
NO extended attributes stored in the node into account

In rare cases it could lead to confusion where the predictor would say it
wouldn't fit internally when it could just have fitted. This would trigger the
assertion. Now it will on rare accasions create a datablock even though it
might have fitted.
2020-04-18 09:45:45 +00:00
reinoud 22a7e85942 Indent the makefs(8) options for UDF like the other filesystems described. 2020-04-04 13:44:57 +00:00
kre 1083ca28cc Fix the build, use %jd and (intmax_t) cast for big numbers, off_t
and ptrdiff_t aren't always the same size.
2020-03-26 04:25:28 +00:00
christos bc2a90737a improve error messages. 2020-03-25 20:17:48 +00:00
christos 5d36819ed2 Correct documentation of -m and -M.
From Ed Maste @ FreeBSD
2019-11-06 21:04:22 +00:00
msaitoh c56890eeef s/initalize/initialize/ in comment or printf message. 2019-10-18 04:09:01 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
nonaka 68b0b1ed57 Correctly mark the last El Torito section header.
Pointed out by Benno Rice via DM.
2018-03-28 06:48:55 +00:00
sevan afa0bbc877 Need strings.h for ffs() 2018-01-27 02:07:33 +00:00
christos 743f435a2d PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggy
makefs(8) emulates UFS2 in performing lazy initialization of inode
blocks when allocating and writing inodes. However, it only ever
initializes one inode block at a time, which may be insufficient.
If so, a later initialization may clobber an inode, resulting in
an inconsistent filesystem.

I committed a minimal fix for the problem to FreeBSD:
https://svnweb.freebsd.org/changeset/base/326912
2017-12-16 23:08:40 +00:00
nonaka c7f80e628d Initialize boot_catalog_entry's entry_type properly.
This had been missing but the type was used in cd9660_setup_boot().

From OpenBSD usr.sbin/makefs/cd9660/cd9660_eltorito.c r1.10.
2017-11-09 01:28:05 +00:00
christos 3bf4d13e2d leave the size alone and set the create_size to include the offset. It
does not matter anyway, but it makes more sense this way.
2017-04-14 15:40:35 +00:00
wiz 0d97bd8ae2 Whitespace fixes. 2017-04-14 07:09:43 +00:00
christos c02e58cd9e Explain the 's' image size better. 2017-04-13 17:21:29 +00:00
christos e919fde2d0 for consistency with ffs, don't count the offset into the size. 2017-04-13 17:20:59 +00:00
christos 820702f055 Fix error handling; msdosfs_wfile is supposed to return errno. 2017-04-13 17:10:12 +00:00
christos c8429e33e6 Change duplicate 'D' option to 'm'. From Ed Maste @ FreeBSD 2017-03-15 15:33:54 +00:00
christos 375072cc9c allow 0 timestamp 2017-02-16 22:44:06 +00:00
christos d372863cc1 need <sys/stat.h> 2017-02-16 22:10:50 +00:00
christos 639cd04dc3 fix msdos reproducible builds! 2017-02-16 19:11:13 +00:00
christos e93222b74e start fixing msdosfs for reproducible builds; does not work yet. 2017-02-16 18:50:04 +00:00
wiz 5ef8e05441 file system police. 2017-02-12 14:45:09 +00:00
christos 49c3d03fa6 untorture language. 2017-02-11 16:04:59 +00:00
christos 2bb798b1d6 mention timezone change for -T timestamp 2017-02-11 15:32:51 +00:00
kre 0368fad281 Revert the part of mkfs.c 1.36 that "gutted the const" (while
retaining the part that added a different one).

That is, re-constipate makefs (well, just a bit, no real pain here.)
2017-02-09 04:42:53 +00:00
christos 683c28c5f2 If we are using a timestamp from the command line, don't pay attention to
the user timezone, use UTC instead (for reproducible builds).
2017-02-08 21:33:12 +00:00
christos f9f791fd0d stampst.st_ion consistent treatment (non-zero vs zero instead of testing == 1) 2017-02-08 21:27:26 +00:00
christos b4ccad3ff2 gut const for now. 2017-02-08 16:00:30 +00:00
christos db38a065ef Don't store random (from ASLR) pointers into the superblock. Should be the
last (famous last words) problem with reproducible builds!
2017-02-08 04:08:53 +00:00
christos 7450df85ed no, this is wrong. 2017-02-08 02:23:45 +00:00
christos 86c77ab60f zero out the superblock so that it does not contain random stuff in the
spare fields.
2017-02-08 02:20:35 +00:00
nonaka d01ec60946 makefs(8): add cd9660 eltorito-alt-boot option for EFI boot. 2017-01-24 11:22:43 +00:00
wiz c747e8df7d Document msdos-specific options directly.
From jmc@OpenBSD.

Bump date.
2017-01-11 13:47:27 +00:00
wiz 38d4f70efc Some changes and sorting based on diff sent from jmc@OpenBSD. 2017-01-11 13:44:24 +00:00
joerg f9c2736326 Disable a couple of warnings until further investigation. 2017-01-11 12:19:43 +00:00
kamil 1eec2c6197 Include missing header <unistd.h> for write(2) read(2) close(2)
These functions are undefined after switch to new zlib.
2017-01-10 04:27:02 +00:00