In order to allow this package to be built on jessie, just depend on
debhelper >= 9.0. We will test to see if dh_update_autotools_config
exists and only use it if it is present.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Enable the following security features: stack protection, fortify,
read-only relocation tables, immediate dynamic symbol binding, and
text segment ASLR by enabling position independent executable
(PIE).
Special handling is provided for shared library and statically linked
executables. For all the gory details please see:
https://lists.debian.org/debian-devel/2016/05/msg00302.html
Distributions who want to do their own special thing can set CFLAGS,
CFLAGS_SHLIB, CLFAGS_STLIB, LDFLAGS, LDFLAGS_SHLIB and LDFLAGS_STATIC
as appropriate.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Use a large_inode so that when e2fsck is fixing a file system with
project quota enabled, the correct project id's quota is adjusted when
a corrupted inode is deleted.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Creating a file system with project quotas can fail if mke2fs is built
using hardening options. This is because quota_compute_usage() used
ext2fs_get_next_inode() instead of ext2fs_get_inode_full(), and a
small inode was passed into quota_data_add, when a large inode needs
to be used. As a result get_dq() would end up dereferencing undefined
space in the stack. Without the hardening options, this would be
zero, so "mke2fs -t ext4 -O project.quota -I 256 test.img" would work
essentially by accident.
Fix this by using ext2fs_get_inode_full() so that a large inode is
available to quota_data_inodes().
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some operating systems may not define EBADMSG and EUCLEAN, so for
better portability use our own private error code numbers.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fix bad date in debian/changelog, as well as a dropped entry for
1.43~WIP.2016.03.15-2.
Tighted dependency version for debhelper to reflect use of
dh_update_autotools_config.
Removed unused source Lintian overrides.
Thanks to Mattia Rizzolo for pointing these out.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Replace "Source-Version" with "binary:Version" in
e2fsprogs.shlibs.local, and e2fsck-static doesn't have any shared
libraries dependency so remove the ${shlibs:Depends} from the Depends.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Before running "make update-gmo", backup the po/*.gmo and po/*.po
files so they can be restored when "make -f debian/rules clean" is
run. This allows the Debian source tree to built and rebuilt.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The regular expression worked for version numbers such as 1.42.12, but
not if there isn't a third component in the version number.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Starting with Debian Stretch, we now have support for dbgsym packages
which are uploaded to a separate package archive. Since some people
might want to try to backport e2fsprogs 1.43 for Jessie set things up
so that the package can be built on older Debiain systems (where the
legacy dbg packages will be created) as well as newer (as of this
writing, Debian Sid or Stretch).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
For the 1.43 release, we will not be enabling the metadata_csum
feature by default. We will leave that up to distribution vendors to
decide whether they want to be aggressive about enabling this feature
by default.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If the fs_offset feature is present (and no "-o offset"
option is specified), e2undo performs the undo operation at
the stored offset.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The fs_offset entry stores the filesystem offset. This allows for an
easy undo, because one does not have to remember/specify the
filesystem offset manually.
The fs_offset entry is implemented as a compatible feature.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This is useful if the filesystem is located at an arbitrary
offset instead of the beginning of a device or file.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Support key extension if the tdb_data_size is an arbitrary integer
multiple of the channel's block size. Before, key extension was only
possible if the tdb_data_size and the channel's block size were
equal.
Note: a key, whose data is the result of a short read, will be
extended if the tdb_data_size and the channel's block size are equal
(that's what the old code did) (if tdb_data_size is an arbitrary
integer multiple (> 1) of the channel's block size, the key might
be extended as well (depending on the keysize)).
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The old code has some issues, for example, when backing up fs block 0
(can be reproduced via "mke2fs -z undo -b 1024 -E offset=1024 out 1024"):
* backing_blk_num is set to ULLONG_MAX instead of 0
* data is read from the beginning of the file instead of offset 1024
* data_ptr is set to read_ptr - 1024 ("invalid" address)
Hence, the wrong fs block is associated with the wrong data.
For details, see also commit 76da764639cbfcc998f13c263a11a4601bcb9961.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The testcase "u_offset" tests/defines e2undo's new UI and offset
handling code. The testcase "u_mke2fs_opt_offset" documents some
issues with undo_io.c's old offset handling code (e.g., backup of
fs block 0, key extension (tdb_data_size != block_size) etc.).
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If a filesystem size is explicitly specified, it should be used without
subtracting the offset.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If "mke2fs -E offset=N ..." is called without a specified filesystem size,
the offset should be subtracted from the default filesystem size (see
commit 87d9b2fb). If "mke2fs -E offset=N ..." is called with an
explicitly specified filesystem size, the specified filesystem size
should be used.
Also, call dd with the "iflag=fullblock" option, if it is going to read
from a pipe.
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Avoid a potential out-of-bounds memory access if the group passed to
ext2fs_clear_block_uninit() or ext2fs_clear_inode_uninit() is greater
than the number of groups in the file system. This prevents a failure
in resize2fs when to allocate a block when growing the file system
significantly.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Hurd and *BSD is not going to have FS_IOC_FIEMAP, at least not at
Linux's codepoint.
Addresses-Debian-Bug: #822576
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Fix resize2fs so that the location of the backup superblocks when the
sparse_super2 feature is enabled is properly set when growing the file
system from a single block group to larger file system sizes.
Also fix a bug where the block group summary statistics in some cases
when exapnding a sparse_super2 file system.
Finally, accurately calculate the file system metadata overhead of the
last block group in sparse_super2 file systems.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Some users will get confused and try to specify multiple -O options.
So teach mke2fs to treat "-O feature1 -O feature2" as
"-O feature1,feature2".
https://bugzilla.kernel.org/show_bug.cgi?id=117421
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The lib/support library is only used for internal e2fsprogs programs,
and it won't compile correctly due to the fact that lib/ext2fs isn't
included in the e2fsprogs-libs distribution anyway.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Commit 2d2d799c72 tried to use parse_quota_options(), which uses
commas to separate out the quota types. Unfortunately, when parsing
extended options, commands are used to separate different extended
options.
To fix this, I've add a new support function parse_quota_type(), which
allows either commas or colons to used as a separator character, and
which manipulates a bit field to indicate which quota types should be
enabled. Eventually tune2fs should be converted to use
parse_quota_type() as well, thus obsoleting parse_quota_options(), but
that's a more complicated cleanup patch for later.
Fix a lint warning which could the number of blocks to be incorretly
printed if it exceeds 2**32.
Also fix some typos and other minor bugs in the usage message.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If the user specifies an offset using -E offset without specifying an
explicit size, the system will use the block device (or file) size as
the default file system size. If we are using the default file system
size, subtract out the offset so the resulting file system will stay
within the block device. Also print a warning that this might not be
what the user wants.
Addresses-Debian-Bug: #803629
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
If the sources for e2fsprogs are located in a pathname that contains a
tilde character (which can happen when the sources are unpacked using
"apt-get source" when e2fsprogs has a pre-release test version),
texi2dvi will fail due to a bug (Debian bug #822492: "texinfo:
texi2dvi doesn't protect the ~ character in the second pass"). Work
around this bug by using texi2dvi --clean.
Addresses-Debian-Bug: #822227
Reported-by: svante.signell@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>