Commit Graph

2237 Commits (ee01079a17bfecd17292ccd60058056fb3a8ba6c)

Author SHA1 Message Date
Theodore Ts'o a2df22f1e9 Stop after the second '.' when parsing version numbers
Now that we are moving to x.y.z version number scheme for maintenance
releases, we ned to change ext2fs_parse_version_string and
blkid_parse_version_string to ignore the second period so we don't
have maintenance releases with a substantially bigger verison number
than the initial x.y release.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 12:37:13 -04:00
Theodore Ts'o 851bcf3fc3 Update the *.po and *.gmo files after the e2fsprogs.pot update
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 12:09:40 -04:00
Theodore Ts'o 424a3e4a23 Remove Changelog files since they're not used after the git migration
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o 714da4515e Update e2fsprogs.pot for translators
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o ac7dd696d6 Fix bug which could cause libblkid to loop forever
When revalidating a partition where there is obsolete information in
/etc/blkid.tab, we end up freeing a the type tag without clearing
dev->bid_type, causing blkid_verify() to loop forever.

Addresses-Debian-Bug: #432052

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o 73d4f8ccaa Update French and Dutch translation files
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-08 08:50:41 -04:00
Theodore Ts'o fd6ee4ee2e Update Vietnamese PO file from the Translation Project
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 23:30:36 -04:00
Theodore Ts'o 29a5deed21 Improve the config/parse_types.sh helper script
Fix a potential security problem if e2fsprogs is built as root (as
Gentoo does!).  In addition fix the script and how it is called from
the configure script so that it does the right thing when
cross-compiling.

Fixes-Gentoo-bug: #146903

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 19:55:03 -04:00
Theodore Ts'o a3f464ffe7 Fix bogus strip permission errors when building under Debian
When building the e2fsprogs dpkg's, the dh_strip command emits a large
number of error messages caused by the permissions not being right.  So
run dh_fixperms before running dh_strip.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 14:51:18 -04:00
Theodore Ts'o d48bc60459 Compile the default mke2fs.conf into mke2fs program
People are getting surprised by mke2fs creating filesystems with
different defaults than earlier versions of mke2fs if mke2fs.conf is
not present.  Having gotten two complaints about ramdisks getting
created by with 4k blocksizes which then blow up when the ramdisk is
mounted with a "Magic mismatch, very weird" error message from the
kernel, let's fix this by making sure mke2fs has a built-in version of
mke2fs.conf file.  People can still override the built-in version of
mke2fs.conf by editing /etc/mke2fs.conf, but this maintains the
previous behavior.

Addresses-Sourceforge-Bug: #1745818

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 14:27:30 -04:00
Theodore Ts'o 6f890e516d Add new function: profile_set_default()
profile_set_default() sets the value of the pseudo file "<default>".
If the file "<default>" had previously been passed to profile_init(),
then def_string parameter will be parsed and used as the profile
information for the "<default>" file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 13:03:35 -04:00
Theodore Ts'o 6bde5c28ba Add PROFILE_FILE_NO_RELOAD flag which is used by profile_update_file()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 10:36:15 -04:00
Theodore Ts'o 1a191d6648 e2fsck: Detect recursive loops in @-expansions
The Turkish translation has a bug in it where it has the translation
of "E@e '%Dn' in %p (%i)" to "E@E".  This causes @E to be expanded at
@E, recursively, forever, until the stack fills up e2fsck core dumps.

Fix it by stopping after a recursive depth of 10, which is far more
than we need.

Addresses-Sourceforge-Bug: 1646081

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-02 19:04:31 -04:00
Theodore Ts'o 4b4df799f1 Make it clear in an error message that it is mk_cmds that is complaining
Obviates gentoo patch: e2fsprogs-1.32-mk_cmds-cosmetic.patch

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-30 20:05:41 -04:00
Theodore Ts'o 6c9cc58375 Set LC_ALL instead of LANG in the test suite config
LC_ALL is the "high priority" environment variable that overrides all
others, where as LANG is the lowest priorty environment variable.  If
LC_ALL is set, it doesn't matter whether LANG, LANGUAGE, LC_COLLATE,
LC_MESSAGES, and the all the rest are set.  This will assure that the
locale when running the test suites is the "C" locale.

Obviates Gentoo patch: e2fsprogs-1.38-tests-locale.patch

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-30 19:52:11 -04:00
Theodore Ts'o bcafb8d76e Add .gitignore file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-30 17:01:42 -04:00
Theodore Ts'o 59fff333e9 Add .git directory to set of files to be ignored when building tarballs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-30 16:47:38 -04:00
Theodore Ts'o 57f485010a Update e2fsprogs 1.40 changelogs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-30 16:44:13 -04:00
Theodore Ts'o dc26a9d54d Added tag E2FSPROGS-1_40 for changeset 097cd140ac3b 2007-06-29 22:05:59 -04:00
Theodore Ts'o becc391037 Release of e2fsprogs version 1.40
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-29 22:05:14 -04:00
Kalpak Shah 1ed49d2c2a Fix byte swapping bug in get_next_inode_full()
On big-endian systems, while swapping, ext2fs_swap_inode_full() swaps
only 128+extra_isize bytes and the EAs if they are present. Now if inode
N has EAs, (and this is the inode in the "scratch inode") then inode N+1
also carries seems to have them since the "scratch inode" was never
zeroed.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-29 21:40:19 -04:00
Theodore Ts'o d7b64725ee Update Release Notes, Changelogs, version.h, etc. for 1.40 release
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:32:47 -04:00
Theodore Ts'o 30dd262235 Fix divide by zero error in blkid's NTFS probing logic
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 17:17:24 -04:00
Theodore Ts'o 0d8b6733c7 Fix the info-dir line for the com_err.texinfo file
Fix the info-dir line so that the menu name does not contain a .info
prefix.  First of all, it's ugly, secondly, it causes the install-info
command to fail to remove the com_err info file from the
/usr/share/info/dir file when the comerr-dev package is removed and
purged.

Addresses Debian Bug: #401711

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 16:59:36 -04:00
Theodore Ts'o 1a9188507c Remove RFC-4122 from e2fsprogs distribution
Documentation about UUID's is available in enough places, and it's
awkward to deal with debian-legal's insanities.  So I'm caving in the
"more-lunatic-than-RMS" wing of Debian by removing RFC-4122 so we don't
have do the dfsg tarball.   Also remove the rule that only tried to
install RFC-4122 on Ubuntu, since Ubuntu seems to want to fetch
e2fsprogs exclusively from Debian.

Addresses Debian Bug: #407107

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-24 16:49:14 -04:00
Theodore Ts'o bbc4cd30a8 Clarify the copyright licenses used by the various libraries in COPYING
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-23 01:04:53 -04:00
Kalpak Shah 915a2669ef Fix ext2fs_read_inode_full() so that the whole inode is byte-swapped
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-22 22:32:43 -04:00
Theodore Ts'o c844010cc4 Fix byte-swapping issues for the i_extra_size field
Thanks to Andreas Dilger and Kalpak Shah for spotting this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-22 19:53:21 -04:00
Andreas Dilger a34c6ffd68 e2fsck: added sanity check for xattr validation
Add an extra validity test in check_ext_attr().  If an attribute's
e_value_size is zero the current code does not allocate a region for it
and as a result the e_value_offs value is not verified.  However, if
e_value_offs is very large then the later call to
ext2fs_ext_attr_hash_entry() can dereference bad memory and crash
e2fsck.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Jim Garlick <garlick@llnl.gov>
2007-06-22 02:22:38 -04:00
Karsten Hopp e382a7eade Add support for LUKS encrypted partitions
This patch adds support for cryptsetup-luks (http://luks.endorphin.org)
UUIDs to libblkid.  This is required p.e. to avoid hardcoding device
names for encrypted partitions.  Could you please take a look at it and
consider inclusion in the next e2fsprogs release ?

Signed-off-by: Karsten Hopp <karsten@redhat.com>
2007-06-21 13:43:33 -04:00
Theodore Ts'o df36136301 Fix gcc -Wall bug in e2fsck
Remove extraneous return after fatal_error().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-21 13:31:13 -04:00
Kalpak Shah 8cd1ab88dd New regression test which contains a corrupt ind. block in the journal inode
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2007-06-21 13:30:06 -04:00
Theodore Ts'o 051afbe0d7 e2fsck: Check the all of journal blocks for validity
The original code only checked the direct blocks to make sure the
journal inode was sane.  Unfortunately, if some or all of the indirect
or doubly indirect blocks were corrupted, this would not be caught.
Thanks to Andreas Dilger and Kalpak Shah for noticing this problem.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-21 11:59:06 -04:00
Kalpak Shah ded28ac2ab Write the updated journal inode if s_jnl_blocks was successfully used
If the journal inode was corrected from s_jnl_blocks, write the fixed
journal inode back to disk.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2007-06-21 11:59:06 -04:00
Kalpak Shah 5107d0d196 Recreate journal that had been removed previously due to corruption
If the journal had been removed because it was corrupt, the
E2F_FLAG_JOURNAL_INODE flag will be set.  If this flag is set, then
recreate the filesystem after checking the filesystem.

Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2007-06-21 11:59:06 -04:00
Theodore Ts'o 56d1236726 Add default journal size function
Factor out the code which sets the default journal size and move it
into libext2fs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-21 11:59:06 -04:00
Theodore Ts'o cb0c5d701a Add more paranoid NTFS probing and fetch UUID and LABEL information
Hopefully this addresses false positives by the blkid library when
detecting NTFS partitions.

Addresses Launchpad Bug: #110138

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-19 03:29:47 -04:00
Theodore Ts'o 058ad1c70c Don't write changes to the backup superblocks by default
This patch changes ext2fs_open() to set EXT2_FLAG_MASTER_SB_ONLY by
default.  This avoids some problems in e2fsck (reported by Jim Garlick)
where a corrupt journal can end up writing the bad superblock to the
backups.  In general, only e2fsck (after the filesystem is clean),
tune2fs, and resize2fs should change the backup superblocks by default.
Most callers of ext2fs_open() should not be touching anything where the
backups should be touched.  So let's change the defaults to avoid
potential problems.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-18 18:26:50 -04:00
Theodore Ts'o 5267a520bb Fix error checking of badblock's last-block and start-block arguments
Addresses Debian Bug: #416477

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-04 01:49:51 -04:00
Theodore Ts'o d2af1bdd05 Fix e2fsck's get_size logic so it will work with the Linux floppy driver
The Linux floppy driver is a bit different from the other block device
drivers, in that if the device has been opened with O_EXCL, it disallows
another open(), even if the second open() does not have the O_EXCL flag.
So this patch moves the call to ext2fs_get_device_size() so that if it
returns EBUSY, e2fsck can close the filesystem, retry the device size,
and then reopen it.  This rather complicated approach is required since
we need to know the blocksize of the filesystem before we can call
ext2fs_get_device_size().

Addresses Debian Bug: #410569

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-06-04 01:14:52 -04:00
Theodore Ts'o a2b2ff61c8 Add test to make sure the ext2 superblock structure is 1024 bytes
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-31 12:39:02 -04:00
Theodore Ts'o decb2a5b3a Reserve superblock field for the raid stripe width.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-31 12:30:09 -04:00
Andreas Dilger b62e88af6a Reserve superblock fields for multiple mount protection feature
There have been reported instances of a filesystem having been mounted
at 2 places at the same time causing a lot of damage to the
filesystem. This patch reserves superblock fields and an INCOMPAT flag
for adding multiple mount protection(MMP) support within the ext4
filesystem itself. The superblock will have a block number
(s_mmp_block) which will hold a MMP structure which has a sequence
number which will be periodically updated every 5 seconds by a mounted
filesystem. Whenever a filesystem will be mounted it will wait for
s_mmp_interval seconds to make sure that the MMP sequence does not
change. To further make sure, we write a random sequence number into
the MMP block and wait for another s_mmp_interval secs. If the
sequence no. doesn't change then the mount will succeed. In case of
failure, the nodename, bdevname and the time at which the MMP block
was last updated will be displayed. tune2fs can be used to set
s_mmp_interval as desired.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
2007-05-31 12:25:46 -04:00
Daniel Drake e7b5d3c0b2 e2fsck: Add blocksize sanity check when finding a backup superblock
I've been investigating why e2fsck refuses to restore the backup superblock
of a partition with a broken primary superblock.

The partition in question has a block size of 4096, and mke2fs reports that
backup superblocks were created on blocks 32768, 98304, 163840, ...

When running e2fsck, get_backup_sb starts by guessing a block size of 1024
and backup superblock at block 8193. I'm not sure why, but it actually finds
a superblock at this location, so returns a context with superblock 8193,
blocksize 1024.

Later on, ext2fs_open2() tries to process this superblock. It then realises
that the block size value stored in the superblock (4096) does not match what
it was told (1024), so it bails out with EXT2_ET_UNEXPECTED_BLOCK_SIZE. fsck
aborts without fixing the partition.

The following patch solves the problem by discounting superblocks which do
not meet the currently-sought block size.
As a result, block 32768 (blocksize=4096) is now used to restore the backup,
which agrees with the first location that mke2fs listed.

Signed-off-by: Daniel Drake <d.drake@mmm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-31 11:56:17 -04:00
Brian Behlendorf 8f234d9650 [COVERITY] Free potential null dereference bug in e2fsck
At the second conditional iter->file could still be NULL. We need to
check for it again.  Should never happen in practice, but better to be
sure.

Coverity ID: 6: Forward Null

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-31 11:42:48 -04:00
Brian Behlendorf 21400381d9 [COVERITY] Free memory leak in mke2fs when parsing extended options
Coverity ID: 34: Resource Leak

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-31 11:30:47 -04:00
Andreas Dilger de8f3a7621 Fix gcc -Wall warnings, especially on 64-bit systems
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-25 11:18:11 -04:00
Theodore Ts'o f954ba012f Fix gcc -Wall issues in e2fsck sources
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2007-05-22 20:53:01 -04:00
Theodore Ts'o 32460c1e4c Add new function profile_get_uint() in the e2fsck sources
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-22 20:51:47 -04:00
Andreas Dilger 54833579ee Add Makefile production rule for e2fsprogs.spec in case it gets deleted
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-22 16:20:14 -04:00