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:
- the
/dev/ttyXXX
belongs to the tty group - 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 th开发者_Go百科e wall
command don't follow the same principle? Anyone can use wall while his mesg
says n....
Am I missing something?
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.
精彩评论