Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Sep 2015 17:04:01 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 202933] unwanted behaviour change when writing to revoked terminals
Message-ID:  <bug-202933-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: fbsd.bugzilla@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-202933-8>