[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to check for perl or usable printf tools?
From: |
Simon Josefsson |
Subject: |
Re: How to check for perl or usable printf tools? |
Date: |
Mon, 12 Sep 2022 11:04:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Erik Auerswald <auerswal@unix-ag.uni-kl.de> writes:
> I am trying to use the reported input file that crashes tftp for the test.
> This file contains non-printable characters (i.e., it is a "binary" file).
> I do not want to add this binary file as-is to the git repository.
Why? I don't see anything fundamentally wrong with commiting a binary
fuzz file that trigger som particular bad behaviour.
> Thus I want to create the contents with some widely available tool from
> some description, e.g., hexadecimal byte values.
Awk or ed?
Or 'od'?
> One possibility is printf. It seems to me as if printf(1) is not yet used
> in GNU Inetutils. Both the Bash builtin version and the GNU Coreutils
> version of printf support "\xHH" in the format string. But the Debian
> Almquist Shell (dash) builtin printf does not, at least not in dash
> version 0.5.8-2.10. The "\xHH" escape sequence is not specified by POSIX.
> (Perhaps I could use octal instead of hexadecimal, since that is specified
> by POSIX, and the printf built into dash supports it.) Thus we would
> need to check for a usable printf implementation first. But Autoconf
> does not seem to contain such a macro (I did not see "AC_PROG_PRINTF"
> in the documentation).
If printf is already a fragile tool for this, it sounds like it will
cause problems.
> Another possibility is perl. Perl is already used in GNU Inetutils,
> for the "bootstrap" script and for "whois". I did not see an obvious
> perl check in Autoconf (i.e., no "AC_PROG_PERL") in the documentation.
> The test script would need to test if perl is available to avoid a false
> positive test result with broken tftp.
It is only required for developers and 'make dist', isn't it?
> I think I'll just hack something together with printf and octal escape
> sequences, but I would prefer a "proper" Autoconf-based approach.
> Help with Autoconf would be appreciated.
I can help with it, but sounds like it would be nice to settle on a
solution we believe is portable first.
Maybe 'perl' is actually the simplest, and the self-test should SKIP
when perl isn't available?
/Simon
signature.asc
Description: PGP signature
- Re: [PATCH 3/3] telnet: Avoid command evaluation crashes., (continued)
- TFTP client crash seems to be caused by missing bounds check in makeargv(), Erik Auerswald, 2022/09/04
- Re: TFTP client crash seems to be caused by missing bounds check in makeargv(), Erik Auerswald, 2022/09/04
- Re: TFTP client crash seems to be caused by missing bounds check in makeargv(), Simon Josefsson, 2022/09/06
- Re: TFTP client crash seems to be caused by missing bounds check in makeargv(), Erik Auerswald, 2022/09/07
- Re: TFTP client crash seems to be caused by missing bounds check in makeargv(), Simon Josefsson, 2022/09/08
- How to check for perl or usable printf tools?, Erik Auerswald, 2022/09/11
- Re: How to check for perl or usable printf tools?,
Simon Josefsson <=
- Re: How to check for perl or usable printf tools?, Alfred M. Szmidt, 2022/09/12
- Re: How to check for perl or usable printf tools?, Erik Auerswald, 2022/09/12
- Re: How to check for perl or usable printf tools?, Erik Auerswald, 2022/09/17
- Re: How to check for perl or usable printf tools?, Simon Josefsson, 2022/09/25
- Re: How to check for perl or usable printf tools?, Erik Auerswald, 2022/09/25
- Re: How to check for perl or usable printf tools?, Erik Auerswald, 2022/09/25
- Re: How to check for perl or usable printf tools?, Simon Josefsson, 2022/09/25
- Re: [PATCH 3/3] telnet: Avoid command evaluation crashes., Erik Auerswald, 2022/09/19
- fixing the ftp crashes found via fuzzer (was: Re: [PATCH 3/3] telnet: Avoid command evaluation crashes.), Erik Auerswald, 2022/09/20
- Re: fixing the ftp crashes found via fuzzer, Simon Josefsson, 2022/09/21