[PATCH] Fixing the find_loop_by_file function to properly compare the filename by respecting the LO_NAME_SIZE.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes the bug reported on https://bugs.launchpad.net/ubuntu/+source/mult
ipath-tools/+bug/1469143

Signed-off-by: Jorge Niedbalski <jorge.niedbalski@xxxxxxxxxxxxx>
---
 kpartx/lopart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kpartx/lopart.c b/kpartx/lopart.c
index 6f83048..e92aeed 100644
--- a/kpartx/lopart.c
+++ b/kpartx/lopart.c
@@ -123,7 +123,7 @@ find_loop_by_file (const char * filename)
  continue;
  }

- if (0 == strcmp(filename, loopinfo.lo_name)) {
+ if (0 == strncmp(filename, loopinfo.lo_name, strlen(l
oopinfo.lo_name))) {
  close (fd);
  return xstrdup(dev); /*found */
  }
-- 
2.1.4

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux