293e6a7280e118897374c3dcc54170570d5c59c9
Build: add --enable-warnings (-Wall -Wextra); the tree is now warning-free with it, so distributions can opt in without risking a surprise -Werror breakage from a future compiler. Real bugs fixed (each verified by a reproducer): - lib/io.c: open_rollback_file() read 28 bytes into char[28] with no NUL and then strcmp()'d it against a 28-character magic, reading one byte past the array. The condition was also inverted, so a *valid* rollback file was rejected -- but only sometimes: the missing NUL made the result depend on stack garbage (verified: -O0 rejects, -O2 accepts). The whole --save-rollback/--rollback-changes path was unreliable. Now the buffer is sized for the terminator, zeroed, and the comparison is `!= 0`. Verified end to end: save -> reopen -> restore reports "2 blocks restored, 0 skipped"; a random file is rejected. - reiserfscore/reiserfslib.c, reiserfscore/journal.c: asprintf() was called with &fs->fs_file_name / &fs->fs_j_file_name, but those fields are `char *`, not `char **`. Passing a `char **` where `char *` is expected wrote through the wrong pointer -- silent memory corruption on any allocation. Fixed by using the new checked helper. - reiserfscore/node_formats.c: `code < 0` on an unsigned parameter was dead code; the guard never fired. - resize_reiserfs: missing `break` after -j made -j fall into -f, so "-j dev" silently also forced the operation. Sign-compare on the count_blocks() ternary and on count + blocks. - lib/misc.c: strncat with bound == strlen(src) (equivalent to strcat) into char[256] from a char[256] dirent name -- up to 261 bytes. Replaced with snprintf plus an explicit fit check. - lib/misc.c: die() used vsprintf into a fixed 1024-byte buffer. - strncpy with bound == destination size (mkreiserfs, tune, progbar) never terminated; replaced with snprintf. Allocator: drop the homegrown magic-header allocator. It wrote "_mem_begin_" / "mem_end" through strcpy inside the allocation, kept the size in an `int`, and its only safety check (checkmem) was never called -- every call site is commented out. Replaced with a size_t header that is over-aligned via max_align_t, so malloc alignment guarantees still hold. expandmem() now takes the old size from the header instead of a caller-supplied value that could disagree with it. Warnings: annotate the deliberate fallthroughs (fsck pass cascade, unit suffix parsing, percentage parsing), fix the remaining sign-compare and missing-field-initializer sites, and compute addresses of packed members via char* + offsetof instead of &member. Portability: asm/types.h -> linux/types.h, malloc.h and sys/vfs.h dropped from includes.h (nothing used them), sys/vfs.h -> sys/statfs.h for statfs(2). Version: reiserfsprogs.spec said 3.6.23 while configure.ac said 3.6.25. Remove the dead `#if 0` main() from hashes.c. Add .github/workflows/build.yml: gcc, clang, --enable-warnings and --enable-io-failure-emulation, each followed by a format/check/inspect smoke test on a real image. Verified: ./autogen.sh && ./configure --enable-warnings && make is clean from scratch (0 warnings, 51 compile/link steps). mkreiserfs, reiserfsck --check, debugreiserfs -S, reiserfstune -l and a real resize_reiserfs 128M -> 256M all succeed, and fsck reports the resized image clean.
Reiserfs is a file system based on balanced tree algorithms, which is described at www.namesys.com. [LICENSING] ReiserFSprogs is hereby licensed under the GNU General Public License version 2 but with the following "Anti-Plagiarism" modification: You may not remove any credits or brand marks, or cause them to not display, unless you are an end user (that is, you are not redistributing to others). Yes, there really are people with the nerve to remove credits from software they did not write, or only wrote a small part of, and they are even frequently occurring sad to say. Credits are not ads, credits describe someone's contribution to the project (e.g. labor or money) whereas an ad says something else. Source code files that contain the phrase "licensing governed by reiserfsprogs/README" are "governed files" throughout that file. Governed files are licensed under this license. The portions of them owned by Hans Reiser, or authorized to be licensed by him, have been in the past, and likely will be in the future, licensed to other parties under other licenses. If you add your code to governed files, and don't want it to be owned by Hans Reiser, put your copyright label on that code so we can keep things straight. It will be a kindness if you identify whether Hans Reiser is allowed to license code labeled as owned by you on your behalf other than under this license, because he wants to know if it is okay to do so and put a check in the mail to you (for non-trivial improvements) when he makes his next sale. He makes no guarantees as to the amount if any, though he feels motivated to motivate contributors, and you can surely discuss this with him before or after contributing. You have the right to decline to allow him to license your code contribution other than under this license or the GPL. Further licensing options are available for commercial and/or other interests directly from reiser@namesys.com<P> [END LICENSING] Send bug reports to reiserfs-devel@vger.kernel.org. Hideous Commercial Pitch: Spread your development costs across other OS vendors. Select from the best in the world, not the best in your building, by buying from third party OS component suppliers. Leverage the software component development power of the internet. Be the most aggressive in taking advantage of the commercial possibilities of decentralized internet development, and add value through your branded integration that you sell as an operating system. Let your competitors be the ones to compete against the entire internet by themselves. Be hip, get with the new economic trend, before your competitors do. Send email to reiser@namesys.com. To understand the code, after reading the website, start reading the code by reading reiserfs_fs.h first. IMPORTANT NOTE: As of approximately October 2007, namesys.com has been offline and all of the original Namesys staff have gone on to other ventures or are otherwise unavailable. All removals of the namesys.com domain from the code and documentation are to avoid confusion by users, not to avoid proper attribution. Reiserfsprogs has been maintained by the ReiserFS development community for some time and can be reached at reiserfs-devel@vger.kernel.org. [BUILDING] The generated autotools files (configure, Makefile.in, ...) are not kept in the repository. After a fresh clone, bootstrap them first: ./autogen.sh ./configure make Build dependencies: a C compiler, autoconf, automake, libtool, pkg-config, libcom_err (com_err development files) and, optionally, libuuid.
Description
ReiserFS userspace utilities (mkreiserfs, reiserfsck, debugreiserfs, resize_reiserfs, reiserfstune) with a modernized build system
1.7 MiB
0 Stars
1 Watchers
0 Forks
Languages
C
95.5%
Roff
2.7%
Shell
0.8%
M4
0.4%
Python
0.3%
Other
0.3%