Bug 150648 - [patch] rshd(8): Incorrect determination of length of user name.
Summary: [patch] rshd(8): Incorrect determination of length of user name.
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-09-17 14:20 UTC by Andrey Ignatov
Modified: 2022-10-17 12:34 UTC (History)
0 users

See Also:


Attachments
file.diff (312 bytes, patch)
2010-09-17 14:20 UTC, Andrey Ignatov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Ignatov 2010-09-17 14:20:00 UTC
man 8 rshd:
-->
DESCRIPTION
	...
     6.   A null terminated user name of at most 16 characters is retrieved on
	  the initial socket.  This user name is interpreted as a user iden-
	  tity to use on the server's machine.
	...
DIAGNOSTICS
	...
     Ruser too long.
	     The name of the user on the remote machine is longer than 16
	     characters.
	...
<--

But user with length of name at 15 characters (15 + '\0' = 16)
can't run the command via rsh on host. He get "Ruser too long".

This bug is critical for one of my users. Length of his name is 15
characters :)

How-To-Repeat: 1. On host1 (rsh-server):
# testuser=$(jot -b u -s "" 15)
# echo ${#testuser}
15
# pw useradd $testuser -u 12345 -c "Test user" -d /home/test -g operator -m -w no -s /bin/sh
# pw usershow $testuser
uuuuuuuuuuuuuuu:*:12345:5::0:0:Test user:/home/test:/bin/sh

2. On host2 (client):
# testuser=$(jot -b u -s "" 15)
# echo ${#testuser}
15
# pw useradd $testuser -u 12345 -c "Test user" -d /home/test -g operator -m -w no -s /bin/sh
# pw usershow $testuser
uuuuuuuuuuuuuuu:*:12345:5::0:0:Test user:/home/test:/bin/sh
# su -l $testuser
$ id
uid=12345(uuuuuuuuuuuuuuu) gid=5(operator) groups=5(operator)	
$ rsh host1 hostname
rshd: ruser too long
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:52 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:34:49 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>