0

The purpose of the write command is to send msg to a user logged in a tty. In order for this command to work, the receiver should set write permission on his tty for the group. This is necessary since:

  1. the /dev/ttyXXX belongs to the tty group
  2. the write command is using SGID with the tty group to let users have a chance to write to someone's tty

Ok. Now, if the sender don't set write permission for his own tty, he can't write to someone else tty's. I can't see any technical grounds for this! Is this just to preserve some kind of politeness? And even in this case, why does the wall command don't follow the same principle? Anyone can use wall while his mesg says n....

Am I missing something?

Kara
  • 6,115
  • 16
  • 50
  • 57
denis
  • 11
  • 4

1 Answers1

0

The implication of write is that it is two way communication. From the man page:

If the recipient wants to reply, this can be accomplished by typing a message

I don't think you would be pleased to have some other user able to spam text to your terminal without reprisal/reply from you. Think of it as a sanity requirement.

jim mcnamara
  • 16,005
  • 2
  • 34
  • 51