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]
Message-ID: <ea11fea30810091034k56788d54ka794fdde914f6616@mail.gmail.com>
Date:	Thu, 9 Oct 2008 23:04:45 +0530
From:	"Manish Katiyar" <mkatiyar@...il.com>
To:	ext4 <linux-ext4@...r.kernel.org>, "Theodore Tso" <tytso@....edu>
Cc:	mkatiyar@...il.com
Subject: [PATCH] debugfs : Fix printing of pathnames with ncheck if files have hardlinks in same directory.

Hi Ted,

Commit 03206bd introduced regression in ncheck while printing all the
pathnames of an inode. For files which have hardlink in the same
directory we will print the same pathname instead of all possible like
below :-

debugfs:  ncheck 14
Inode	Pathname
14	/a/f1
14	/a/f1
14	/b/f3

where it should have printed

debugfs:  ncheck 14
Inode   Pathname
14      /a/f1
14      /a/f2
14      /b/f3

Below patch fixes it.

Signed-off-by : Manish Katiyar <mkatiyar@...il.com>

---
 debugfs/ncheck.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/debugfs/ncheck.c b/debugfs/ncheck.c
index 22fa29f..c850739 100644
--- a/debugfs/ncheck.c
+++ b/debugfs/ncheck.c
@@ -36,14 +36,16 @@ static int ncheck_proc(struct ext2_dir_entry *dirent,
 	int	i;
 	char	*pathname;
 	errcode_t	retval;
+	static ext2_ino_t parent;

 	iw->position++;
+	if (iw->position == 2)
+		parent = dirent->inode;
 	if (iw->position <= 2)
 		return 0;
 	for (i=0; i < iw->num_inodes; i++) {
 		if (iw->iarray[i] == dirent->inode) {
-			retval = ext2fs_get_pathname(current_fs, iw->parent,
-						     iw->iarray[i],
+			retval = ext2fs_get_pathname(current_fs, parent, iw->parent,
 						     &pathname);
 			if (retval)
 				com_err("ncheck", retval,
@@ -51,7 +53,7 @@ static int ncheck_proc(struct ext2_dir_entry *dirent,
 					"inode %d (%d)", iw->parent,
 					iw->iarray[i]);
 			else
-				printf("%u\t%s\n", iw->iarray[i], pathname);
+				printf("%u\t%s/%s\n", iw->iarray[i], pathname, dirent->name);
 		}
 	}
 	if (!iw->inodes_left)
-- 
1.5.4.3


Thanks -
Manish
--
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