Bug 507667

Summary: 'write' does not work
Product: [Fedora] Fedora Reporter: John Koelndorfer <jkoelndorfer>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 11CC: kdudka, kzak, ovasik, sindrepb
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-17 10:16:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Koelndorfer 2009-06-23 17:25:13 UTC
Description of problem:
write (CLI application) does not work, and to my knowledge cannot be made to work without chowning ttys (though I have not tried).


Version-Release number of selected component (if applicable):
Unknown. -v, -V, or --version. Man page does not provide a version.

How reproducible:
Every time.

Steps to Reproduce:
1. Attempt to write a user. `write user`. Write claims you don't have write permissions on.
2. Attempt to turn on write permissions via `mesg y`
  
Actual results:
`mesg y` complains: "mesg: error: tty device is not owned by group `tty'" Writing continues to not work.

Expected results:
mesg enables writing. write should then work.

Additional info:

Comment 1 John Koelndorfer 2009-06-23 17:27:24 UTC
Can't edit comments? Above, meant to say that -v, -V, and --version all fail to return version info.

Comment 2 Ondrej Vasik 2009-06-23 19:07:04 UTC
Yep, you can't edit ... additionally - write is not part of coreutils, it is from util-linux-ng, reassigning.

Comment 3 Karel Zak 2009-06-23 20:07:43 UTC
I can't reproduce this problem. Please, check who(1) output and tty permissions.

$ who
test     tty2         2009-06-23 22:01
kzak     tty1         2009-06-22 15:29 (:0)
kzak     pts/0        2009-06-23 20:15 (:0.0)
kzak     pts/2        2009-06-23 20:25 (:0.0)
kzak     pts/3        2009-06-23 20:28 (:0.0)
kzak     pts/4        2009-06-23 20:34 (:0.0)
kzak     pts/5        2009-06-23 21:34 (:0.0)
kzak     pts/6        2009-06-23 20:43 (:0.0)

$ ll /dev/tty2
crw--w---- 1 test tty 4, 2 2009-06-23 22:05 /dev/tty2

$ write test
Hello World!
^C

Comment 4 John Koelndorfer 2009-06-23 20:13:00 UTC
I also have screen running. I notice that the /dev/pts/x files screen is using are owned by group screen.

Comment 5 Karel Zak 2009-06-24 08:18:13 UTC
(In reply to comment #4)
> I also have screen running. I notice that the /dev/pts/x files screen is using
> are owned by group screen.  

On my system all active /dev/pts/x files (include screen stuff) are owned by user and tty group. I can write to/from screen tty.

Anyway, write(1) requires that the tty is owned by tty group -- write(1) has s-bit on group:

# ls -la /usr/bin/write
-rwxr-sr-x 1 root tty 11936 2009-06-10 15:04 /usr/bin/write
      ^           ^^^

Comment 6 Karel Zak 2009-09-17 10:16:12 UTC
Closing... Please, reopen if you believe that the problem is reproduce able on the currently supported Fedora releases. Thanks.