Fix crash when trying to access the /admin/ page
Apparently checking passwords goes through checks for hash algorithms
supported by crypt(3). But since none of the algorithms checked are
supported by the OpenBSD libc, the code ends up dereferencing a NULL
pointer. I'm not sure yet why the code checks for algorithms supported
by crypt(3), as the code wasn't present in icecast-2.4.4.
To fix this, avoid dereferencing said NULL pointer. While here, add
DEBUG_PACKAGES.
Problem reported by Olivier Cherrier.
Do not hardcode /usr/src/ in one of the files containing desired output.
This is expected to fix a test failure that anton@ reported with BSDSRCDIR set.
Fix control message handling in recvit to avoid out of bounds write
to userland
Because of the use of a unsigned variable to track the length of the
control buffer recvit can underflow that variable because of an unchecked
ALIGN(). This can be triggered by passing a too short buffer that is not a
multiple of _ALIGNBYTES + 1. In such a case the kernel copies out data past
the provided buffer.
On top of addding the missing overflow check this also uses the proper
socklen_t type for the msg_controllen and uses an unsigned int for the
still overloaded variable i.
The security implications of this are mainly theoretical. The correct use
of control message handling requires the use of CMSG_SPACE which ensures
the buffer size is properly rounded. In base only dig uses a buffer that
is not correctly rounded at the same time it is oversized enough to not
matter.
[2 lines not shown]