mirror of https://github.com/vitalif/e2fsprogs
Merge branch 'next' into debian-packaging
commit
39e05c5672
|
@ -5,6 +5,11 @@ e2fsprogs (1.43-3) UNRELEASED; urgency=medium
|
|||
* Fix various spelling mistakes in man pages
|
||||
* Fix project quota bugs in e2fsck and mke2fs
|
||||
* Build binaries with hardening support
|
||||
* Improve e2fsck messages when the journal superblock is corrupt and
|
||||
the user declines to fix the journal. (Closes: #768162)
|
||||
* Fix debugfs's handling of "set_bg <bg> checksum calc" on 64-bit file
|
||||
systems.
|
||||
* Simplify the debian rules file
|
||||
|
||||
-- Theodore Y. Ts'o <tytso@mit.edu> Sun, 22 May 2016 20:51:29 -0400
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ maindir ?= ${debdir}/e2fsprogs
|
|||
e2fsckstaticdir ?= ${debdir}/e2fsck-static
|
||||
debugdir ?= ${debdir}/e2fsprogs-dbg
|
||||
stdbuilddir ?= ${debdir}/BUILD-STD
|
||||
staticbuilddir ?= ${debdir}/BUILD-STATIC
|
||||
mipsbuilddir ?= ${debdir}/BUILD-MIPS
|
||||
mipsbuilddir64 ?= ${debdir}/BUILD-MIPS-64
|
||||
# docdir ?= ${maindir}/usr/share/doc/${package}
|
||||
|
@ -113,10 +112,8 @@ endif
|
|||
STAMPSDIR ?= debian/stampdir
|
||||
CFGSTDSTAMP ?= ${STAMPSDIR}/configure-std-stamp
|
||||
CFGBFSTAMP ?= ${STAMPSDIR}/configure-bf-stamp
|
||||
CFGSTATICSTAMP ?= ${STAMPSDIR}/configure-static-stamp
|
||||
BUILDSTDSTAMP ?= ${STAMPSDIR}/build-std-stamp
|
||||
BUILDBFSTAMP ?= ${STAMPSDIR}/build-bf-stamp
|
||||
BUILDSTATICSTAMP ?=${STAMPSDIR}/build-static-stamp
|
||||
|
||||
INSTALL ?= install
|
||||
INSTALL_PROGRAM ?= $(INSTALL) -p -o root -g root -m 0755
|
||||
|
@ -151,17 +148,7 @@ else
|
|||
CFLAGS += -D__NO_STRING_INLINES
|
||||
endif
|
||||
|
||||
ifneq (${DEB_HOST_ARCH_OS},linux)
|
||||
SKIP_STATIC = yes
|
||||
endif
|
||||
|
||||
ifeq ($(SKIP_STATIC),yes)
|
||||
BUILD_STATIC =
|
||||
E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
|
||||
else
|
||||
BUILD_STATIC = build-static
|
||||
E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
|
||||
endif
|
||||
|
||||
CFLAGS_SHLIB = $(filter-out -fPIE -fpie -pie,$(CFLAGS))
|
||||
CFLAGS_STLIB = $(filter-out -fPIE -fpie -pie,$(CFLAGS))
|
||||
|
@ -215,9 +202,6 @@ STD_CONF_FLAGS ?= --enable-elf-shlibs
|
|||
BF_CONF_FLAGS ?= --enable-elf-shlibs --disable-nls --disable-imager \
|
||||
--disable-testio-debug --disable-uuidd --disable-tls --disable-debugfs
|
||||
|
||||
STATIC_CONF_FLAGS ?= --disable-nls --disable-imager \
|
||||
--disable-uuidd --disable-tls
|
||||
|
||||
MIPS_NOPIC_CONF_FLAGS ?= --disable-nls --disable-imager \
|
||||
--disable-uuidd --disable-tls \
|
||||
--disable-resizer # --disable-debugfs
|
||||
|
@ -369,36 +353,9 @@ endif
|
|||
mkdir -p ${STAMPSDIR}
|
||||
touch ${CFGBFSTAMP}
|
||||
|
||||
${CFGSTATICSTAMP}:
|
||||
dh_testdir
|
||||
rm -f config.cache
|
||||
|
||||
mkdir -p ${staticbuilddir}
|
||||
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
||||
cd ${staticbuilddir} && AWK=/usr/bin/awk ${topdir}/configure \
|
||||
${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
|
||||
CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
|
||||
CFLAGS_STLIB="$(CFLAGS_STLIB)" \
|
||||
LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
|
||||
LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
|
||||
else
|
||||
cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
|
||||
${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
|
||||
${EXTRA_CONF_FLAGS} --build=$(DEB_BUILD_GNU_TYPE) \
|
||||
--host=$(DEB_HOST_GNU_TYPE) CFLAGS="${CFLAGS}" \
|
||||
CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
|
||||
CFLAGS_STLIB="$(CFLAGS_STLIB)" \
|
||||
LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
|
||||
LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
|
||||
endif
|
||||
mkdir -p ${STAMPSDIR}
|
||||
touch ${CFGSTATICSTAMP}
|
||||
|
||||
build-arch: build
|
||||
build-indep: build
|
||||
build: build-std $(BUILD_BF) $(BUILD_STATIC)
|
||||
build: build-std $(BUILD_BF)
|
||||
|
||||
build-std: ${BUILDSTDSTAMP}
|
||||
${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
|
||||
|
@ -443,15 +400,6 @@ ${BUILDBFSTAMP}: ${CFGBFSTAMP}
|
|||
$(MAKE) -C ${bfbuilddir}/resize V=1 all
|
||||
touch ${BUILDBFSTAMP}
|
||||
|
||||
build-static: ${BUILDSTATICSTAMP}
|
||||
${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
|
||||
dh_testdir
|
||||
$(MAKE) -C ${staticbuilddir} V=1 libs
|
||||
ifneq ($(BUILD_E2FSCK_STATIC),no)
|
||||
$(MAKE) -C ${staticbuilddir}/e2fsck V=1 e2fsck.static
|
||||
endif
|
||||
touch ${BUILDSTATICSTAMP}
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
if test -d debian/orig-gmo ; then \
|
||||
|
@ -550,13 +498,7 @@ binary-arch: install $(INSTALL_UDEB)
|
|||
dh_testdir
|
||||
dh_testroot
|
||||
|
||||
# lintian overrides
|
||||
for i in $$(cd debian && echo *.lintian-overrides); do \
|
||||
pkg=$${i%.lintian-overrides} ;\
|
||||
if test "$${pkg}" != source ; then \
|
||||
$(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
|
||||
fi ;\
|
||||
done
|
||||
dh_lintian
|
||||
|
||||
# symlinks to prepare dh_installdocs run
|
||||
|
||||
|
@ -648,12 +590,9 @@ endif
|
|||
|
||||
dh_compress
|
||||
|
||||
dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
|
||||
dh_makeshlibs --add-udeb=e2fsprogs-udeb
|
||||
ifeq ($(SKIP_UDEB),)
|
||||
dh_makeshlibs --add-udeb=e2fsprogs-udeb -plibcomerr${COMERR_SOVERSION} \
|
||||
-V 'libcomerr2 (>= 1.33-3)'
|
||||
ifneq ($(UTIL_LINUX_NG),yes)
|
||||
dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
|
||||
echo "udeb: libblkid 1 libblkid1-udeb" >> \
|
||||
debian/libblkid1/DEBIAN/shlibs
|
||||
echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
|
||||
|
@ -696,15 +635,8 @@ ifneq ($(UTIL_LINUX_NG),yes)
|
|||
dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
|
||||
endif
|
||||
endif
|
||||
dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
|
||||
dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
|
||||
ifeq ($(SKIP_UDEB),)
|
||||
dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
|
||||
ifneq ($(UTIL_LINUX_NG),yes)
|
||||
dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
|
||||
dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
|
||||
endif
|
||||
endif
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
|
||||
|
|
|
@ -583,7 +583,7 @@ static errcode_t ext2fs_journal_load(journal_t *journal)
|
|||
case JFS_DESCRIPTOR_BLOCK:
|
||||
case JFS_COMMIT_BLOCK:
|
||||
case JFS_REVOKE_BLOCK:
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
/* If we don't understand the superblock major type, but there
|
||||
* is a magic number, then it is likely to be a new format we
|
||||
|
@ -600,15 +600,15 @@ static errcode_t ext2fs_journal_load(journal_t *journal)
|
|||
|
||||
/* Checksum v1-3 are mutually exclusive features. */
|
||||
if (jfs_has_feature_csum2(journal) && jfs_has_feature_csum3(journal))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (journal_has_csum_v2or3(journal) &&
|
||||
jfs_has_feature_checksum(journal))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (!ext2fs_journal_verify_csum_type(journal, jsb) ||
|
||||
!ext2fs_journal_sb_csum_verify(journal, jsb))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (journal_has_csum_v2or3(journal))
|
||||
journal->j_csum_seed = jbd2_chksum(journal, ~0, jsb->s_uuid,
|
||||
|
@ -618,12 +618,12 @@ static errcode_t ext2fs_journal_load(journal_t *journal)
|
|||
* format to be able to proceed safely, so any other checks that
|
||||
* fail we should attempt to recover from. */
|
||||
if (jsb->s_blocksize != htonl(journal->j_blocksize))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (ntohl(jsb->s_maxlen) < journal->j_maxlen)
|
||||
journal->j_maxlen = ntohl(jsb->s_maxlen);
|
||||
else if (ntohl(jsb->s_maxlen) > journal->j_maxlen)
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
journal->j_tail_sequence = ntohl(jsb->s_sequence);
|
||||
journal->j_transaction_sequence = journal->j_tail_sequence;
|
||||
|
|
|
@ -653,18 +653,13 @@ static errcode_t parse_bmap(struct field_set_info *info,
|
|||
static errcode_t parse_gd_csum(struct field_set_info *info, char *field,
|
||||
char *arg)
|
||||
{
|
||||
__u16 *checksum = info->ptr;
|
||||
|
||||
if (strcmp(arg, "calc") == 0) {
|
||||
ext2fs_group_desc_csum_set(current_fs, set_bg);
|
||||
memcpy(&set_gd, ext2fs_group_desc(current_fs,
|
||||
current_fs->group_desc,
|
||||
set_bg),
|
||||
sizeof(set_gd));
|
||||
printf("Checksum set to 0x%04x\n",
|
||||
ext2fs_bg_checksum(current_fs, set_bg));
|
||||
*checksum = ext2fs_group_desc_csum(current_fs, set_bg);
|
||||
printf("Checksum set to 0x%04x\n", *checksum);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return parse_uint(info, field, arg);
|
||||
}
|
||||
|
||||
|
|
|
@ -550,7 +550,7 @@ static errcode_t e2fsck_journal_fix_bad_inode(e2fsck_t ctx,
|
|||
e2fsck_clear_recover(ctx, 1);
|
||||
return 0;
|
||||
}
|
||||
return EXT2_ET_BAD_INODE_NUM;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
} else if (recover) {
|
||||
if (fix_problem(ctx, PR_0_JOURNAL_RECOVER_SET, pctx)) {
|
||||
e2fsck_clear_recover(ctx, 1);
|
||||
|
@ -627,7 +627,7 @@ static errcode_t e2fsck_journal_load(journal_t *journal)
|
|||
case JFS_DESCRIPTOR_BLOCK:
|
||||
case JFS_COMMIT_BLOCK:
|
||||
case JFS_REVOKE_BLOCK:
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
/* If we don't understand the superblock major type, but there
|
||||
* is a magic number, then it is likely to be a new format we
|
||||
|
@ -644,15 +644,15 @@ static errcode_t e2fsck_journal_load(journal_t *journal)
|
|||
|
||||
/* Checksum v1-3 are mutually exclusive features. */
|
||||
if (jfs_has_feature_csum2(journal) && jfs_has_feature_csum3(journal))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (journal_has_csum_v2or3(journal) &&
|
||||
jfs_has_feature_checksum(journal))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (!e2fsck_journal_verify_csum_type(journal, jsb) ||
|
||||
!e2fsck_journal_sb_csum_verify(journal, jsb))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
if (journal_has_csum_v2or3(journal))
|
||||
journal->j_csum_seed = jbd2_chksum(journal, ~0, jsb->s_uuid,
|
||||
|
@ -662,19 +662,19 @@ static errcode_t e2fsck_journal_load(journal_t *journal)
|
|||
* format to be able to proceed safely, so any other checks that
|
||||
* fail we should attempt to recover from. */
|
||||
if (jsb->s_blocksize != htonl(journal->j_blocksize)) {
|
||||
com_err(ctx->program_name, EXT2_ET_CORRUPT_SUPERBLOCK,
|
||||
com_err(ctx->program_name, EXT2_ET_CORRUPT_JOURNAL_SB,
|
||||
_("%s: no valid journal superblock found\n"),
|
||||
ctx->device_name);
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
}
|
||||
|
||||
if (ntohl(jsb->s_maxlen) < journal->j_maxlen)
|
||||
journal->j_maxlen = ntohl(jsb->s_maxlen);
|
||||
else if (ntohl(jsb->s_maxlen) > journal->j_maxlen) {
|
||||
com_err(ctx->program_name, EXT2_ET_CORRUPT_SUPERBLOCK,
|
||||
com_err(ctx->program_name, EXT2_ET_CORRUPT_JOURNAL_SB,
|
||||
_("%s: journal too short\n"),
|
||||
ctx->device_name);
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
}
|
||||
|
||||
journal->j_tail_sequence = ntohl(jsb->s_sequence);
|
||||
|
@ -746,9 +746,9 @@ static errcode_t e2fsck_journal_fix_corrupt_super(e2fsck_t ctx,
|
|||
e2fsck_clear_recover(ctx, recover);
|
||||
return 0;
|
||||
}
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
} else if (e2fsck_journal_fix_bad_inode(ctx, pctx))
|
||||
return EXT2_ET_CORRUPT_SUPERBLOCK;
|
||||
return EXT2_ET_CORRUPT_JOURNAL_SB;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -820,7 +820,7 @@ errcode_t e2fsck_check_ext3_journal(e2fsck_t ctx)
|
|||
|
||||
retval = e2fsck_journal_load(journal);
|
||||
if (retval) {
|
||||
if ((retval == EXT2_ET_CORRUPT_SUPERBLOCK) ||
|
||||
if ((retval == EXT2_ET_CORRUPT_JOURNAL_SB) ||
|
||||
((retval == EXT2_ET_UNSUPP_FEATURE) &&
|
||||
(!fix_problem(ctx, PR_0_JOURNAL_UNSUPP_INCOMPAT,
|
||||
&pctx))) ||
|
||||
|
|
|
@ -1647,7 +1647,8 @@ failure:
|
|||
com_err(ctx->program_name, retval,
|
||||
_("while checking journal for %s"),
|
||||
ctx->device_name);
|
||||
fatal_error(ctx, 0);
|
||||
fatal_error(ctx,
|
||||
_("Cannot proceed with file system check"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -536,4 +536,7 @@ ec EXT2_ET_FILESYSTEM_CORRUPTED,
|
|||
ec EXT2_ET_BAD_CRC,
|
||||
"Bad CRC detected in file system"
|
||||
|
||||
ec EXT2_ET_CORRUPT_JOURNAL_SB,
|
||||
"The journal superblock is corrupt"
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue