mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
Remove undocumented talk behaviour, when names like
aa.bb aa:bb and aa!bb treated as user+host and not as local user names (especially aa.bb is common case). Only @ is valid user/host separator according to manpage. Pointed-by: doctor@dream.demos.su
This commit is contained in:
parent
302a30b002
commit
016d299205
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3823
@ -79,23 +79,17 @@ get_names(argc, argv)
|
||||
gethostname(hostname, sizeof (hostname));
|
||||
my_machine_name = hostname;
|
||||
/* check for, and strip out, the machine name of the target */
|
||||
for (cp = argv[1]; *cp && !index("@:!.", *cp); cp++)
|
||||
for (cp = argv[1]; *cp && *cp != '@'; cp++)
|
||||
;
|
||||
if (*cp == '\0') {
|
||||
/* this is a local to local talk */
|
||||
his_name = argv[1];
|
||||
his_machine_name = my_machine_name;
|
||||
} else {
|
||||
if (*cp++ == '@') {
|
||||
/* user@host */
|
||||
his_name = argv[1];
|
||||
his_machine_name = cp;
|
||||
} else {
|
||||
/* host.user or host!user or host:user */
|
||||
his_name = cp;
|
||||
his_machine_name = argv[1];
|
||||
}
|
||||
*--cp = '\0';
|
||||
his_machine_name = cp + 1;
|
||||
*cp = '\0';
|
||||
}
|
||||
if (argc > 2)
|
||||
his_tty = argv[2]; /* tty name is arg 2 */
|
||||
|
Loading…
Reference in New Issue
Block a user