Error with EISDIR when calling open(2) with O_CREAT when the
last component of the path is an existing directory and O_DIRECTORY
is not specified.
This is required by recent versions of POSIX. We previously did
not return an error.
Flagged by Sortix os-test.
committing on behalf of daniel@, partly based on FreeBSD changes
ok guenther@ jsg@ deraadt@
EHLO must reset the transaction
RFC5321 §4.1.4 states that an EHLO command MAY be issued by a client
later in the session and, if it's acceptable, it MUST clear all buffers
and reset the state exactly as if a RSET command was issued.
discussed with / okay martijn@
error with EINVAL if open(2) is called with both O_CREAT and O_DIRECTORY
Before this change:
If no file or directory matching the last component of a path existed.
A regular file was created, an error was returned and errno set to ENOTDIR.
If a regular file matching the last component of a path existed,
an error was returned and errno set to ENOTDIR.
If a directory matching the last component of a path existed,
it was opened without error.
One possible reading of POSIX is that O_CREAT | O_DIRECTORY is a valid way
to get a file descriptor for an existing directory. In practice it isn't
used and the combination of O_CREAT and O_DIRECTORY has returned an error
on NetBSD since 2010 and Linux since 2023.
ok deraadt@ daniel@
Add support for the RK3528 variant. To make things easier to follow,
pull the hardware differences out into a per-variant structure containing
the different parameters we have to program.
tested on 3528 (radxa e20c), 3568 (nanopi r5s), 3588 (nanopi r6c)
feedback from kettenis@
ok kettenis@ dlg@