NetBSD-Bugs archive

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

bin/57752: makefs(8) -t msdos doesn't return EXIT_FAILUER on some errors



>Number:         57752
>Category:       bin
>Synopsis:       makefs(8) -t msdos doesn't return EXIT_FAILUER on some errors
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 05 13:05:01 +0000 2023
>Originator:     Izumi Tsutsui
>Release:        NetBSD 10.0_RC1
>Organization:
>Environment:
System: NetBSD mirage 10.0_RC1 NetBSD 10.0_RC1 (GENERIC) #0: Sun Nov 5 18:30:08 UTC 2023 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386, but maybe all
Machine: i386
>Description:
makefs(8) -t msdos returns EXIT_SUCESS even on some errors
so script cannot handle error case.

>How-To-Repeat:
---
% makefs -t msdos -M 16384 -m 16384 test.fs test || echo failed
Creating `test.fs'
makefs: meta data exceeds file system size
% makefs -t msdos -M 16384 -m 16384 test.fs test && echo success
Creating `test.fs'
makefs: meta data exceeds file system size
success
% makefs -t msdos -M 32768 -m 32768 -o fat_type=32 test.fs test || echo failed
Creating `test.fs'
makefs: 15 clusters too few clusters for FAT32, need 65525
% makefs -t msdos -M 32768 -m 32768 -o fat_type=32 test.fs test && echo success
Creating `test.fs'
makefs: 15 clusters too few clusters for FAT32, need 65525
success
%
---

>Fix:
Replace "return;" after mkfs_msdos() in src/usr.sbin/makefs/msdos.c
with err(3) etc?

 https://github.com/NetBSD/src/blob/3bcce0b/usr.sbin/makefs/msdos.c#L179-L180
---
	printf("Creating `%s'\n", image);
	TIMER_START(start);
	if (mkfs_msdos(image, NULL, &msdos_opt->options) == -1)
		return;
	TIMER_RESULTS(start, "mkfs_msdos");
---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index