[Bug 202933] unwanted behaviour change when writing to revoked terminals
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Sep 6 17:04:02 UTC 2015
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202933
Bug ID: 202933
Summary: unwanted behaviour change when writing to revoked
terminals
Product: Base System
Version: 10.1-RELEASE
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: kern
Assignee: freebsd-bugs at FreeBSD.org
Reporter: fbsd.bugzilla at fenyo.net
Hi,
When a terminal is revoked, writing to it sets errno to:
- ENXIO until FreeBSD 10.1 kernel
- EIO with FreeBSD 10.2 kernel
The following program can be used to see this behaviour change:
------------------------------------------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
extern int errno;
int main() {
int id = open("/dev/console", O_RDWR);
revoke("/dev/console");
int ret = write(id, "X", 1);
if (ret < 0) printf("errno=%d\n", errno);
return 0;
}
------------------------------------------------------------------
It returns 6 (ENXIO) on FreeBSD 10.1 and 5 (EIO) on FreeBSD 10.2.
I wonder if this new behaviour would not be an unwanted side-effect due to
kernel changes.
For instance, this leads to bug ID 202932 for the rsyslog8 port, that loops
endlessly after /dev/console is revoked since the errno code tested to handle
correctly this case is now EIO instead of ENXIO.
This could happen to some other tools for the same reason.
Sincerely,
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list