lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 21 Jan 2023 12:32:24 -0800
From:   Eric Biggers <ebiggers@...nel.org>
To:     linux-ext4@...r.kernel.org
Cc:     Paulo Antonio Alvarez <pauloaalvarez@...il.com>
Subject: [PATCH 32/38] misc/mke2fs: fix Windows build

From: Eric Biggers <ebiggers@...gle.com>

unix_io_manager is no longer available on Windows.  windows_io_manager
must be used instead.

Fixes: 86b6db9f5a43 ("libext2fs: code adaptation to use the Windows IO manager")
Cc: Paulo Antonio Alvarez <pauloaalvarez@...il.com>
Signed-off-by: Eric Biggers <ebiggers@...gle.com>
---
 lib/ext2fs/ext2_io.h    |  2 ++
 lib/support/plausible.c |  7 +------
 misc/mke2fs.c           | 12 ++++++------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/lib/ext2fs/ext2_io.h b/lib/ext2fs/ext2_io.h
index 8fe5b3235..679184e39 100644
--- a/lib/ext2fs/ext2_io.h
+++ b/lib/ext2fs/ext2_io.h
@@ -145,10 +145,12 @@ extern errcode_t io_channel_cache_readahead(io_channel io,
 #ifdef _WIN32
 /* windows_io.c */
 extern io_manager windows_io_manager;
+#define default_io_manager windows_io_manager
 #else
 /* unix_io.c */
 extern io_manager unix_io_manager;
 extern io_manager unixfd_io_manager;
+#define default_io_manager unix_io_manager
 #endif
 
 /* sparse_io.c */
diff --git a/lib/support/plausible.c b/lib/support/plausible.c
index 349aa2c4f..65a6b2e14 100644
--- a/lib/support/plausible.c
+++ b/lib/support/plausible.c
@@ -103,12 +103,7 @@ static void print_ext2_info(const char *device)
 	time_t			tm;
 
 	retval = ext2fs_open2(device, 0, EXT2_FLAG_64BITS, 0, 0,
-#ifdef _WIN32
-			      windows_io_manager,
-#else
-			      unix_io_manager,
-#endif
-                  &fs);
+			      default_io_manager, &fs);
 	if (retval)
 		return;
 	sb = fs->super;
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index bde1e582e..24cc14750 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1950,10 +1950,10 @@ profile_error:
 #ifdef CONFIG_TESTIO_DEBUG
 		if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
 			io_ptr = test_io_manager;
-			test_io_backing_manager = unix_io_manager;
+			test_io_backing_manager = default_io_manager;
 		} else
 #endif
-			io_ptr = unix_io_manager;
+			io_ptr = default_io_manager;
 		retval = ext2fs_open(journal_device,
 				     EXT2_FLAG_JOURNAL_DEV_OK, 0,
 				     0, io_ptr, &jfs);
@@ -2736,7 +2736,7 @@ static int should_do_undo(const char *name)
 	io_channel channel;
 	__u16	s_magic;
 	struct ext2_super_block super;
-	io_manager manager = unix_io_manager;
+	io_manager manager = default_io_manager;
 	int csum_flag, force_undo;
 
 	csum_flag = ext2fs_has_feature_metadata_csum(&fs_param) ||
@@ -3041,10 +3041,10 @@ int main (int argc, char *argv[])
 #ifdef CONFIG_TESTIO_DEBUG
 	if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
 		io_ptr = test_io_manager;
-		test_io_backing_manager = unix_io_manager;
+		test_io_backing_manager = default_io_manager;
 	} else
 #endif
-		io_ptr = unix_io_manager;
+		io_ptr = default_io_manager;
 
 	if (undo_file != NULL || should_do_undo(device_name)) {
 		retval = mke2fs_setup_tdb(device_name, &io_ptr);
@@ -3449,7 +3449,7 @@ int main (int argc, char *argv[])
 
 		retval = ext2fs_open(journal_device, EXT2_FLAG_RW|
 				     EXT2_FLAG_JOURNAL_DEV_OK, 0,
-				     fs->blocksize, unix_io_manager, &jfs);
+				     fs->blocksize, default_io_manager, &jfs);
 		if (retval) {
 			com_err(program_name, retval,
 				_("while trying to open journal device %s\n"),
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ