From d04c449ebf8d1edb05879d6afd9408d545303b56 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 8 Nov 2024 15:36:12 -0600 Subject: [PATCH] Comment out test that submitter didn't include test file for, and move *type=='v' check back under distinguishing between vfat/iso9660 instead of run for all filetypes and potentially triggering if a new 4 letter physical filesystem type starting with v shows up in future. --- tests/blkid.test | 6 +++--- toys/other/blkid.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/blkid.test b/tests/blkid.test index d0f6fbed..c370d657 100755 --- a/tests/blkid.test +++ b/tests/blkid.test @@ -45,9 +45,9 @@ testing "squashfs" "BLKID squashfs" 'temp.img: TYPE="squashfs"\n' "" "" testing "vfat" "BLKID vfat" \ 'temp.img: SEC_TYPE="msdos" LABEL="myvfat" UUID="7356-B91D" TYPE="vfat"\n' \ "" "" -testing "fat32" "BLKID fat32" \ - 'temp.img: LABEL="myfat32" UUID="B25B-2ECB" TYPE="vfat"\n' \ - "" "" +#testing "fat32" "BLKID fat32" \ +# 'temp.img: LABEL="myfat32" UUID="B25B-2ECB" TYPE="vfat"\n' \ +# "" "" testing "xfs" "BLKID xfs" \ 'temp.img: LABEL="XFS_test" UUID="d63a1dc3-27d5-4dd4-8b38-f4f97f495c6f" TYPE="xfs"\n' \ "" "" diff --git a/toys/other/blkid.c b/toys/other/blkid.c index 47510393..41229796 100644 --- a/toys/other/blkid.c +++ b/toys/other/blkid.c @@ -162,13 +162,13 @@ static void do_blkid(int fd, char *name) if (!FLAG(L) && !FLAG(U)) { if (!TT.o || !strcasecmp(TT.o, "full")) printf("%s:", name); else if (!strcasecmp(TT.o, "export")) show_tag("DEVNAME", name); - if (*type=='v' && fstypes[i].magic_len == 4) show_tag("SEC_TYPE", "msdos"); } len = fstypes[i].label_len; if (!FLAG(U) && len) { s = toybuf+fstypes[i].label_off-off; if (!strcmp(type, "vfat") || !strcmp(type, "iso9660")) { + if (*type=='v' && !FLAG(U)) show_tag("SEC_TYPE", "msdos"); while (len && s[len-1]==' ') len--; if (strstart(&s, "NO NAME")) len=0; } -- 2.39.5