Skip to content

Commit

Permalink
Merge branch 'master' into debian/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tytso committed Dec 4, 2024
2 parents 6b30400 + 096463d commit 14c897c
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 28 deletions.
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -13750,6 +13750,9 @@ then
try_libarchive=""
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Disabling libarchive support" >&5
printf "%s\n" "Disabling libarchive support" >&6; }

printf "%s\n" "#define CONFIG_DISABLE_LIBARCHIVE 1" >>confdefs.h

elif test "$withval" = "direct"
then
try_libarchive="direct"
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,8 @@ AS_HELP_STRING([--without-libarchive],[disable use of libarchive]),
then
try_libarchive=""
AC_MSG_RESULT([Disabling libarchive support])
AC_DEFINE(CONFIG_DISABLE_LIBARCHIVE, 1,
[Define to 1 to completely disable libarchive])
elif test "$withval" = "direct"
then
try_libarchive="direct"
Expand Down
14 changes: 12 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
e2fsprogs (1.47.2~rc1-2) unstable; urgency=medium

* Fix fuseext2 transition to account for /usr-move (Closes: #1088838)
* Fix orphan_file support on big endian systems.
* Mke2fs will allow "-r 1" since fsarchiver uses it rather pointlessly
* Allow building e2fsprogs without libarchive-dev installed to make life
easier for bootstrapping for new Debian ports (Closes: #1078693)

-- Theodore Y. Ts'o <tytso@mit.edu> Tue, 03 Dec 2024 23:40:01 -0500

e2fsprogs (1.47.2~rc1-1) unstable; urgency=medium

* New upstream version
Expand All @@ -6,8 +16,8 @@ e2fsprogs (1.47.2~rc1-1) unstable; urgency=medium
suitable for pre-1995 1.2 version kernels and a typo will just end up
confusing the user and leaving them with a file system missing most
modern ext4 features, including no support for on-line resizing and no
support for post-2038 timestamps. Closes: #1086603)
* Add support for gnu.translator extended attrbitues in tar files fed to
support for post-2038 timestamps. (Closes: #1086603)
* Add support for gnu.translator extended attrbutes in tar files fed to
mke2fs -d.
* Avoid a spurious failure in badblocks when -n or -w is specified
twice. (Closes: #1087341)
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: e2fsprogs
Section: admin
Priority: required
Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
Build-Depends: dpkg-dev (>= 1.22.5), gettext, texinfo, pkgconf, libarchive-dev, libfuse3-dev [linux-any kfreebsd-any] <!pkg.e2fsprogs.no-fuse2fs>, debhelper-compat (= 12), dh-exec, libblkid-dev, uuid-dev, m4, udev [linux-any], systemd [linux-any], systemd-dev [linux-any], cron [linux-any], dh-sequence-movetousr
Build-Depends: dpkg-dev (>= 1.22.5), gettext, texinfo, pkgconf, libarchive-dev <!nocheck>, libfuse3-dev [linux-any kfreebsd-any] <!pkg.e2fsprogs.no-fuse2fs>, debhelper-compat (= 12), dh-exec, libblkid-dev, uuid-dev, m4, udev [linux-any], systemd [linux-any], systemd-dev [linux-any], cron [linux-any], dh-sequence-movetousr
Rules-Requires-Root: no
Standards-Version: 4.7.0
Homepage: http://e2fsprogs.sourceforge.net
Expand Down
14 changes: 14 additions & 0 deletions debian/fuse2fs.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

# begin-remove-after: released:trixie
if test "$1" = configure && dpkg --compare-versions "$2" lt 1.47.2~rc1-1~; then
# DEP17 P1 mitigation.
for cmd in /sbin/mount.fuse-ext2 /sbin/mount.fuseext2; do
dpkg-divert --package fuse2fs --no-rename --divert "$cmd.usr-is-merged" --remove "$cmd"
done
fi
# end-remove-after: released:trixie

#DEBHELPER#
14 changes: 14 additions & 0 deletions debian/fuse2fs.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

# begin-remove-after: released:trixie
if test "$1" = remove || test "$1" = upgrade -o "$1" = failed-upgrade - o "$1" = abort-install -o "$1" = abort-upgrade && dpkg --compare-versions "$2" lt 1.47.2~rc1-1~; then
# DEP17 P1 mitigation.
for cmd in /sbin/mount.fuse-ext2 /sbin/mount.fuseext2; do
dpkg-divert --package fuse2fs --no-rename --divert "$cmd.usr-is-merged" --remove "$cmd"
done
fi
# end-remove-after: released:trixie

#DEBHELPER#
14 changes: 14 additions & 0 deletions debian/fuse2fs.preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -e

# begin-remove-after: released:trixie
if test "$1" = install -o "$1" = upgrade && dpkg --compare-versions "$2" lt 1.47.2~rc1-1~; then
# DEP17 P1 mitigation.
for cmd in /sbin/mount.fuse-ext2 /sbin/mount.fuseext2; do
dpkg-divert --package fuse2fs --no-rename --divert "$cmd.usr-is-merged" --add "$cmd"
done
fi
# end-remove-after: released:trixie

#DEBHELPER#
11 changes: 9 additions & 2 deletions doc/RelNotes/v1.47.2.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
E2fsprogs 1.47.2 (November 28, 2024) 6ba18ef7bf4b
E2fsprogs 1.47.2 (November 28, 2024) 283fcab2c9af
====================================

Updates/Fixes since v1.47.1:
Expand All @@ -22,6 +22,8 @@ https://github.com/tytso/e2fsprogs/issues/192)
Fixes
-----

Fix orphan_file support on big endian systems.

Avoid a spurious failure in badblocks when -n or -w is specified twice.
(Addresses Debian Bug #1087341)

Expand Down Expand Up @@ -68,7 +70,7 @@ Enable Continuous Integration testing in Debian's Salsa forge.
Fix a memory leak in oss-fuzz test programs.

Provide fuseext2 to replace the debian package src:fuse-umfuse-ext2.
(Addresses Debian Bug #1085590)
(Addresses Debian Bug #1085590, #1088838)

Fix the f_badjour_encrypted test to write the error output from mke2fs
and debugfs to a log file so it doesn't mess up the "make check" output
Expand All @@ -82,4 +84,9 @@ Clean up groff warnings in man pages. (Addresses Debian Bugs #1086892,
Document the orphan_file feature in the ext4(5) and tune2fs(8) man
pages. (Addresses Debian Bug #1073062)

Allow building e2fsprogs without libarchive-dev installed to make life
easier for bootstrapping for new Debian ports (Addresses Debian Bug
#1078693)

Various man page cleanups.

5 changes: 3 additions & 2 deletions e2fsck/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,9 @@ static int reinit_orphan_block(ext2_filsys fs,
* Update checksum to match expected buffer contents with
* appropriate block number.
*/
tail->ob_checksum = ext2fs_do_orphan_file_block_csum(fs,
pd->ino, pd->generation, blk, pd->buf);
tail->ob_checksum =
ext2fs_cpu_to_le32(ext2fs_do_orphan_file_block_csum(fs,
pd->ino, pd->generation, blk, pd->buf));
}
if (!pd->clear) {
pd->errcode = io_channel_read_blk64(fs->io, blk, 1,
Expand Down
3 changes: 3 additions & 0 deletions lib/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
/* Define to 1 for features for use by ext4 developers */
#undef CONFIG_DEVELOPER_FEATURES

/* Define to 1 to completely disable libarchive */
#undef CONFIG_DISABLE_LIBARCHIVE

/* Define to 1 if using dlopen to access libarchive */
#undef CONFIG_DLOPEN_LIBARCHIVE

Expand Down
4 changes: 2 additions & 2 deletions lib/ext2fs/ext2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,8 +1122,8 @@ static inline unsigned int ext2fs_dir_rec_len(__u8 name_len,

/* Structure at the tail of orphan block */
struct ext4_orphan_block_tail {
__u32 ob_magic;
__u32 ob_checksum;
__le32 ob_magic;
__le32 ob_checksum;
};

/*
Expand Down
12 changes: 7 additions & 5 deletions lib/ext2fs/orphan.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __u32 ext2fs_do_orphan_file_block_csum(ext2_filsys fs, ext2_ino_t ino,
crc = ext2fs_crc32c_le(crc, (unsigned char *)buf,
inodes_per_ob * sizeof(__u32));

return ext2fs_cpu_to_le32(crc);
return crc;
}

struct mkorphan_info {
Expand Down Expand Up @@ -101,8 +101,9 @@ static int mkorphan_proc(ext2_filsys fs,
struct ext4_orphan_block_tail *tail;

tail = ext2fs_orphan_block_tail(fs, oi->buf);
tail->ob_checksum = ext2fs_do_orphan_file_block_csum(fs,
oi->ino, oi->generation, new_blk, oi->buf);
tail->ob_checksum =
ext2fs_cpu_to_le32(ext2fs_do_orphan_file_block_csum(fs,
oi->ino, oi->generation, new_blk, oi->buf));
}
err = io_channel_write_blk64(fs->io, new_blk, 1, oi->buf);
} else /* zerobuf is used to initialize new indirect blocks... */
Expand Down Expand Up @@ -249,13 +250,14 @@ errcode_t ext2fs_orphan_file_block_csum_set(ext2_filsys fs, ext2_ino_t ino,
blk64_t blk, char *buf)
{
struct ext4_orphan_block_tail *tail;
__u32 crc;

if (!ext2fs_has_feature_metadata_csum(fs->super))
return 0;

tail = ext2fs_orphan_block_tail(fs, buf);
return ext2fs_orphan_file_block_csum(fs, ino, blk, buf,
&tail->ob_checksum);
return ext2fs_orphan_file_block_csum(fs, ino, blk, buf, &crc);
tail->ob_checksum = ext2fs_cpu_to_le32(crc);
}

int ext2fs_orphan_file_block_csum_verify(ext2_filsys fs, ext2_ino_t ino,
Expand Down
46 changes: 35 additions & 11 deletions misc/create_inode_libarchive.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,50 @@
#define _GNU_SOURCE 1

#include "config.h"
#include <ext2fs/ext2_types.h>
#include "create_inode.h"
#include "create_inode_libarchive.h"
#include "support/nls-enable.h"

#ifdef HAVE_ARCHIVE_H
#ifdef CONFIG_DISABLE_LIBARCHIVE

/* If ./configure was run with --without-libarchive, then only
* __populate_fs_from_tar() remains in this file and will return an error. */
errcode_t __populate_fs_from_tar(ext2_filsys, ext2_ino_t, const char *,
ext2_ino_t, struct hdlinks_s *,
struct file_info *,
struct fs_ops_callbacks *) {
com_err(__func__, 0,
_("you need to compile e2fsprogs without --without-libarchive"
"be able to process tarballs"));
return 1;
}

#else

/* If ./configure was NOT run with --without-libarchive, then build with
* support for dlopen()-ing libarchive at runtime. This will also work even
* if archive.h is not available at compile-time. See the comment below. */

/* 64KiB is the minimum blksize to best minimize system call overhead. */
//#define COPY_FILE_BUFLEN 65536
//#define COPY_FILE_BUFLEN 1048576
#define COPY_FILE_BUFLEN 16777216

/* If archive.h was found, include it as usual. To support easier
* bootstrapping, also allow compilation without archive.h present by
* declaring the necessary opaque structs and preprocessor definitions. */
#ifdef HAVE_ARCHIVE_H
#include <archive.h>
#include <archive_entry.h>
#else
struct archive;
struct archive_entry;
#define ARCHIVE_EOF 1 /* Found end of archive. */
#define ARCHIVE_OK 0 /* Operation was successful. */
#include <unistd.h> /* ssize_t */
typedef ssize_t la_ssize_t;
#endif /* HAVE_ARCHIVE_H */

#include <libgen.h>
#include <locale.h>

Expand Down Expand Up @@ -175,7 +205,7 @@ static int libarchive_available(void)

return 1;
}
#endif
#endif /* CONFIG_DLOPEN_LIBARCHIVE */

static errcode_t __find_path(ext2_filsys fs, ext2_ino_t root, const char *name,
ext2_ino_t *inode)
Expand Down Expand Up @@ -541,20 +571,13 @@ static errcode_t handle_entry(ext2_filsys fs, ext2_ino_t root_ino,
}
return 0;
}
#endif

errcode_t __populate_fs_from_tar(ext2_filsys fs, ext2_ino_t root_ino,
const char *source_tar, ext2_ino_t root,
struct hdlinks_s *hdlinks EXT2FS_ATTR((unused)),
struct file_info *target,
struct fs_ops_callbacks *fs_callbacks)
{
#ifndef HAVE_ARCHIVE_H
com_err(__func__, 0,
_("you need to compile e2fsprogs with libarchive to "
"be able to process tarballs"));
return 1;
#else
char *path2, *path3, *dir, *name;
unsigned int dir_exists;
struct archive *a;
Expand Down Expand Up @@ -700,5 +723,6 @@ errcode_t __populate_fs_from_tar(ext2_filsys fs, ext2_ino_t root_ino,
uselocale(old_locale);
freelocale(archive_locale);
return retval;
#endif
}

#endif /* CONFIG_DISABLE_LIBARCHIVE */
22 changes: 19 additions & 3 deletions misc/mke2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ static void PRS(int argc, char *argv[])
* Finally, we complain about fs_blocks_count > 2^32 on a non-64bit fs.
*/
blk64_t fs_blocks_count = 0;
int r_opt = -1;
char *fs_features = 0;
int fs_features_size = 0;
int use_bsize;
Expand Down Expand Up @@ -1932,11 +1933,26 @@ static void PRS(int argc, char *argv[])
quiet = 1;
break;
case 'r':
com_err(program_name, 0,
_("the -r option has been removed.\n\n"
r_opt = strtoul(optarg, &tmp, 0);
if (*tmp) {
com_err(program_name, 0,
_("bad revision level - %s"), optarg);
exit(1);
}
if (r_opt > EXT2_MAX_SUPP_REV) {
com_err(program_name, EXT2_ET_REV_TOO_HIGH,
_("while trying to create revision %d"), r_opt);
exit(1);
}
if (r_opt != EXT2_DYNAMIC_REV) {
com_err(program_name, 0,
_("the -r option has been removed.\n\n"
"If you really need compatibility with pre-1995 Linux systems, use the\n"
"command-line option \"-E revision=0\".\n"));
exit(1);
exit(1);
}
fs_param.s_rev_level = r_opt;
break;
case 's':
com_err(program_name, 0,
_("the -s option has been removed.\n\n"
Expand Down

0 comments on commit 14c897c

Please sign in to comment.