开发者

Why should I set write permission to my tty in order to use the write cmd?

开发者 https://www.devze.com 2023-01-23 04:19 出处:网络
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 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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消