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) ..
Still returns only first 7 characters of user name at RHL 7.0 RC1.
In may, I reported this bug to netbug.linux.org, that maintain the netkit package. The reply I got, was this: <copy> > 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. </copy> 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 */ strncpy(utmp_idle[nusers].ui_utmp.ut_name, uptr->ut_name, sizeof(utmp_idle[nusers].ui_utmp.ut_name)); </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 ??
This has been fixed in the RedHat 7.1 release which includes the 0.17 netkit package. Read ya, Phil