Remove default sizeof sizes in configure script when cross-compiling
Since version 2.50 autoconf fully supports checking sizes of types
(with AC_CHECK_SIZEOF) when cross-compiling. Therefore there is no
need to preset the respective cache variables anymore. The following
patch removes the special case. There is no need to adjust AC_PREREQ
as it's set to 2.50 already.
Tested successfully cross-building for the mips64el-linux-gnu host on
an i386-linux-gnu build system, removing the following warning
(because of a mismatch for the "long" type):
Sizeof(__U64__TYPEDEF) is 4 should be 8
Problem detected with asm_types.h
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 20 May 2008 18:51:14 +0000 (14:51 -0400)]
e2fsck: Fix potential data corruptor bug in journal recovery
While synchronizing e2fsck's recovery.c with the latest 2.6 kernel
sources, I discovered a serious bug that apparently had been fixed in
the kernel sometime between Deceber 2003 and April 2005, but which had
not been carried over to e2fsprogs. Specifically, when blocks whose
first 4 bytes are JFS_MAGIC_NUMBER (0xc03b3998) are written into the
journal, the first 4 bytes zero'ed out. A one character typo meant
that when the blocks were replayed by e2fsck, the JFS_MAGIC_NUMBER
would not be restored.
Oops.
Fortunately, it is *highly* unlikely that ext4 metadata blocks will
contain that magic number in the first four bytes, and data=journalled
is a relatively rarely used.
This commit fixes this bug, as well as updating e2fsck's recovery.c to
be in sync with 2.6.25.
blkid: Keep cached filesystem information on EACCES and ENOENT errors
When a nonprivileged user uses the blkid command, we want to keep the
cached filesystem information, and opening a device file could result
in an EACCESS or ENOENT (if an intervening directory is mode 700). We
were previously testing for EPERM, which was really the wrong error
code to be testing against.
In current git there is a double free on ctx->filesystem_name in the
end of main() and in e2fsck_free_context, causing e2fsck to abort at
the end of pass5.
The m_no_opt test has been silently failing since the addition of
mke2fs.conf, since it was trying to use resize_inode on a non-sparse
filesystem. Fix it so it works correctly.
libext2fs: Fix resize inode creation with non-standard s_first_data_block
Thanks to Max Lindner (lokimuh) for pointing this out.
I'm playing around a bit with ext2 and multi-user encryption and I
need space for my key management. So I set s_first_data_block to 4000
or something like that.
This way mke2fs segfaults when executing
ext2fs_create_resize_inode() because
Theodore Ts'o [Wed, 26 Mar 2008 13:09:09 +0000 (09:09 -0400)]
e2fsck: Include the device name in the progress information
Also make sure the device name has no spaces in it, to avoid confusing
displays, and make ctx->filesystem_name and ctx->device_name allocated
memory to avoid potential problems in the future.
Theodore Ts'o [Wed, 26 Mar 2008 12:53:13 +0000 (08:53 -0400)]
fsck: Make -Cn work correctly where n != 0
Previously, fsck was only passing in -Cn to the first e2fsck process
to start up, and enabling the progress information by sending a
SIGUSR1 signal. This didn't work if the progress information was
intended to go to file descriptor, since the information was never
passed to e2fsck.
So we now pass the progress fd in as a negative number if the progress
information is intended to be initially suppressed.
Theodore Ts'o [Wed, 26 Mar 2008 12:26:01 +0000 (08:26 -0400)]
e2fsck: Support a negative argument to -C to suppress progress information
If a negative progress argument is given to -C, initially suppress the
progress information. It can be enabled later by sending the e2fsck
process a SIGUSR1 signal.
Theodore Ts'o [Wed, 26 Mar 2008 12:11:11 +0000 (08:11 -0400)]
fsck: Fix -C handling so that subsequent progress bars are enabled
The exiting fsck instance wasn't marked as DONE, so the safety checks
thought a progress bar was still in progress, and so we didn't enable
another filesystem's checking.
Theodore Ts'o [Fri, 21 Mar 2008 13:10:09 +0000 (09:10 -0400)]
debugfs, tune2fs: Handle daylight savings time when parsing a time string
We need to set tm_isdst to -1 so that mktime will automatically
determine whether or not daylight savings time (DST) is in effect.
Previously tm_isdst was set to 0, which caused mktime to interpret the
time as if it was always not using DST.
Theodore Ts'o [Sat, 15 Mar 2008 05:25:51 +0000 (01:25 -0400)]
ext2_fs.h: Rename EXT4_ORPHAN_FS to be EXT3_ORPHAN_FS
No application will ever use the ORPHAN_FS flag, since it only shows
up in kernel memory, but it's been pointed out it was first used in
ext3, and so it should be renamed for accuracy.
Theodore Ts'o [Fri, 14 Mar 2008 19:13:45 +0000 (15:13 -0400)]
debian: Remove preinstall script which is no longer necessary
The preinstall script checked for dpkg --asert-support-predepends,
which has been true since 1996. Also it removed configuration files
which haven't been around since well before Debian sarge, more than
two stable releases ago.
Matthias Koenig [Fri, 14 Mar 2008 17:29:35 +0000 (13:29 -0400)]
uuidd: Fix issues identified by SuSE's security team
SuSE's security team audited uuidd and came up with these issues.
None of them are serious given that uuidd runs setuid as a
unprivileged user which has no special access other than libuuid
directory, but it's good to get them fixed.
Eric Sandeen [Fri, 29 Feb 2008 22:10:21 +0000 (16:10 -0600)]
Fix ext2fs_swap_inode_full() for in-inode xattrs on big-endian machines
After the fix for resize2fs's inode mover losing in-inode
extended attributes, the regression test I wrote caught
that the attrs were still getting lost on powerpc.
Looks like the problem is that ext2fs_swap_inode_full()
isn't paying attention to whether or not the EA magic is
in hostorder, so it's not recognized (and not swapped)
on BE machines. Patch below seems to fix it.
Yay for regression tests. ;)
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Theodore Ts'o [Thu, 13 Mar 2008 14:44:54 +0000 (10:44 -0400)]
e2fsck: Use "Clear Htree" instead of "Clear" when the Htree is corrupt
Change the prompt so it is clear to the user that e2fsck will be
clearing the htree information, not the directory inode itself, when
the htree information has proven to be corrupt.
Theodore Ts'o [Thu, 13 Mar 2008 04:58:54 +0000 (00:58 -0400)]
e2fsck: Fix directory i_size handling
If a directory's i_size is bigger than the number of blocks, don't try
to allocate extra empty blocks to the end of the directory; there's no
real point to do that. Also, if a directory's i_size is not a
multiple of the blocksize, flag that as a mistake so it can be fixed.
This more elegantly addresses the problem which was found on Bas van
Schaik's filesystem.
Theodore Ts'o [Wed, 12 Mar 2008 20:10:48 +0000 (16:10 -0400)]
e2fsck: Handle a pass 2 "should never happen" error gracefully
Turns out a "should never happen" error can indeed happen very easily
if a directory with an htree index has an incorrect, and too-large,
i_size field. This patch fixes this so that we handle this situation
gracefully, allowing filesystems with this error to be fixed.
In another patch I will clean up the specific problem which caused the
internal "should never happen" error from happening at all, but patch
will prevent e2fsck from crashing, and prompt the user to remove the
htree index, so it can be rebuilt again after pass 3.
Thanks to Bas van Schaik at Tetra for giving me access to his system
so this problem could be debugged.
Theodore Ts'o [Sun, 9 Mar 2008 01:20:40 +0000 (20:20 -0500)]
resize2fs: Fix resizing filesystems with large inodes
Use ext2fs_get_next_inode_full() in resize2fs and clean up large inode
handling; previous attempt was not properly handling all cases, and
was incorrectly setting i_extra_isize. This caused some extended
attributes to get removed or randomly assigned to other inodes as a
result of the resize, which can be unfortunate on systems using
SELinux.
The previous commit didn't fix things completely on big-endian systems
like PowerPC.
Addresses-Red-Hat-Bugzilla: #434893
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Fri, 29 Feb 2008 02:26:01 +0000 (21:26 -0500)]
tune2fs: Remove support for clearing the SPARSE_SUPER feature
Clearing SPARSE_SUPER is dangerous; it can result in a filesystem
which e2fsck can't fix easily. Since there is very few good reasons
for wanting to turn this feature off, disable tune2fs's abiity to do
this. Users who really want this can use debugfs.
Also, deprecate the tune2fs -s option. Remove it from the man page
and usage message.
Eric Sandeen [Thu, 28 Feb 2008 19:22:12 +0000 (13:22 -0600)]
Add regression test for resize2fs moving inodes with inline xattrs
The image contains an inode past the resize point with an inline xattr
value of "propervalue". It also contains deleted inodes which had the
xattr value "oldvalue".
When resize2fs moves the inode, it should copy the xattr as well, so
that post-resize we see "propervalue" not "oldvalue".
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 27 Feb 2008 20:01:19 +0000 (15:01 -0500)]
Add support for manipulating large_file feature in mke2fs and tune2fs
Previously we just let the kernel and e2fsck do this automatically,
but e2fsck will no longer automatically clear the large_file feature.
It still isn't really necessary to worry about this feature flag
explicitly, but some users seem to care.
Theodore Ts'o [Wed, 27 Feb 2008 05:00:30 +0000 (00:00 -0500)]
e2fsck: Don't clear the LARGE_FILES feature flag
Stop clearing the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag automatically
if there are no large files in the filesystem. It's been almost a
decade since there have been kernels that don't support this flag, and
e2fsck clears it quietly without telling the user why the filesystem
has been changed.
Theodore Ts'o [Wed, 27 Feb 2008 03:24:42 +0000 (22:24 -0500)]
libblkid: Add error checking to devicemapper code to avoid segfaults
If a device mapper volume disappears while libblkid code is running,
it is possible for the devicemapper code to return errors, and since
libblkid wasn't checking for error returns, it would dereference a
null pointer and crash. Add error checking to prevent this.
Addresses-RedHat-Bugzilla: #433857
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Wed, 27 Feb 2008 00:05:33 +0000 (19:05 -0500)]
Fix dumpe2fs parsing of explicit superblock/blocksize parameters
The dumpe2fs syntax documented in the man page has been broken for
some time due to getopt() changes. Change the option syntax in
dumpe2fs to be one which is more extensible and consistent with the
format for extended options in mke2fs and tune2fs.
Theodore Ts'o [Tue, 26 Feb 2008 22:31:06 +0000 (17:31 -0500)]
tune2fs: Add support to clear the resize_inode feature
This requires an fsck aftwards. We don't allow setting the
resize_inode feature because extensive work to tune2fs or e2fsck to
safely relocate blocks is necessary in order to reserve the blocks
needed by the resize inode.
Addresses-Red-Hat-Bugzilla: #167816
Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Theodore Ts'o [Tue, 26 Feb 2008 19:26:01 +0000 (14:26 -0500)]
libe2p: New e2p_edit_feature2 which provides better error handling
This creates a new enhanced edit_feature function for libe2p which
supports a different set of feature flags that are OK to clear as
opposed to set, and which returns more specific information about why
the user provided an invalid edit feature command.
Theodore Ts'o [Tue, 26 Feb 2008 17:11:47 +0000 (12:11 -0500)]
debian: Pass 100 to UID_MIN and GID_MIN, not 1
According to the policy, UIDs and GIDs in the range 1-100 are reserved
to be globally allocated by the base-passwd package. The libuuid1
postinstall script passes in UID_MIN=1 and GID_MIN=1. The useradd and
groupadd commands seems to skip UID's between 1 and 100 anyway, but
it's confusing, so we should pass in UID_MIN=100 and GID_MIN=100 for
clarity and in case useradd and groupadd ever changes their behaviour.