On Mon, 02 Sep 2019 21:15:23 +0200, Martijn van Duren wrote:
> https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
> {_POSIX_ARG_MAX}
> Maximum length of argument to the exec functions including environment da
> ta.
> Value: 4 096
Note that this is the minimum value POSIX requires, implementations
are allowed to have larger values. The _actual_ value on OpenBSD
is ARG_MAX which is much higher, 256 * 1024.
Personally, I'd just use asprintf() here. The actual limit is going
to be closer to ARG_MAX - (strlen("sh) + strlen("-c") so I don't
think you are likely to get it exactly. The kernel should enforce
that limit, not smtpd.
- todd