Bug 10184 - rusersd only returns first 7 characters of username.
Summary: rusersd only returns first 7 characters of username.
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rusers   
(Show other bugs)
Version: 6.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-03-15 16:15 UTC by di990013
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-11-30 15:24:08 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description di990013 2000-03-15 16:15:07 UTC
When running RH 6.1, rusers returns only the first 7 characters (andresen)
of my username (andresen). I traced the problem to appear in the server
part of Netkit-rusers-0.16-x.

In the source for rusers_proc.c I found:

static void do_strncpy(char *tgt, const char *src, size_t len) {
    strncpy(tgt, src, len);
    tgt[len-1] = 0;          // Line in question

This effectively cuts the last (8.) character away.

Question: Is this necessary ?

Running RH 4.2 on my old computer, I get the entire string (andresen) ..

Comment 1 Derek Tattersall 2000-08-10 18:55:04 UTC
Still returns only first 7 characters of user name at RHL 7.0 RC1.

Comment 2 Need Real Name 2000-11-30 15:24:05 UTC
In may, I reported this bug to netbug@ftp.uk.linux.org, that maintain the netkit
package. The reply I got, was this:

> Here at uni, we have both HP-UX 10.20 and Redhat Linux 6.1 machines. In
> one of my scipts, I use rusers (to figure out who is online). Lately, I've
> noticied a strange thing with rusers. When I do a 

The short answer is "rusers sucks".

The long answer is it looks like you're right. ut_name should be
strncpy, and the others should be do_strncpy.

Now I've checked ftp://ftp.uk.linux.org/pub/linux/Networking/netkit and found a
new version of the netkit. After a quick look at the source, I noticed this:
<from rpc.rusersd/rusers_proc.c:do_names_2(int all)>
/* note NOT do_strncpy */
</from rpc.rusersd/rusers_proc.c:do_names_2(int all)>

This source was released around 31 of july. I've made a quick test and the new
version fixes the problem. Now the question is:

Will you (Redhat) make an (rpm-) update available to fix the problem ??

Comment 3 Phil Knirsch 2001-06-06 15:03:00 UTC
This has been fixed in the RedHat 7.1 release which includes the 0.17 netkit

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.