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-next>] [day] [month] [year] [list]
Date:	Sat, 27 Apr 2013 18:44:41 +0800
From:	Zheng Liu <gnehzuil.liu@...il.com>
To:	linux-ext4@...r.kernel.org
Cc:	"Theodore Ts'o" <tytso@....edu>, Zheng Liu <wenqing.lz@...bao.com>
Subject: [PATCH] libext2fs: do not print any error message from libext2fs

From: Zheng Liu <wenqing.lz@...bao.com>

In libext2fs we don't print any error message form it except that OMIT_COM_ERR
is defined.  In lib/ext2fs/inline_data.c it doesn't obey this rule.  So fix it.
Meanwhile when we find an dir entry in inline data, we will print the message in
debugfs rather than in libext2fs.

Cc: "Theodore Ts'o" <tytso@....edu>
Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
---
[This patch is against pu branch of e2fsprogs tree]

 debugfs/htree.c          | 5 ++++-
 lib/ext2fs/inline_data.c | 6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/debugfs/htree.c b/debugfs/htree.c
index ca39b4b..e042fd7 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -388,8 +388,11 @@ void do_dirsearch(int argc, char *argv[])
 	pb.len = strlen(pb.search_name);
 
 	if (ext2fs_inode_has_inline_data(current_fs, inode)) {
-		ext2fs_inline_data_dirsearch(current_fs, inode,
+		errcode_t retval;
+		retval = ext2fs_inline_data_dirsearch(current_fs, inode,
 					     argv[2], strlen(argv[2]));
+		if (retval)
+			printf("Entry found at inline data\n");
 		goto out;
 	}
 
diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
index ea3736c..6d5cf52 100644
--- a/lib/ext2fs/inline_data.c
+++ b/lib/ext2fs/inline_data.c
@@ -134,16 +134,16 @@ static int do_search_dir(ext2_filsys fs, void *start, unsigned int size,
 		de = (struct ext2_dir_entry *)(start + offset);
 		errcode = ext2fs_get_rec_len(fs, de, &rec_len);
 		if (errcode) {
+#ifndef OMIT_COM_ERR
 			com_err("search_dir_inline_data", errcode,
 				"while getting rec_len for inline data");
+#endif
 			return errcode;
 		}
 		if (de->inode &&
 		    len == (de->name_len & 0xFF) &&
-		    strncmp(name, de->name, len) == 0) {
-			printf("Entry found at inline data\n");
+		    strncmp(name, de->name, len) == 0)
 			return 1;
-		}
 		offset += rec_len;
 	}
 	return 0;
-- 
1.7.12.rc2.18.g61b472e

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ