Bug 6728 - RFC742 "/w" not expanded properly.
RFC742 "/w" not expanded properly.
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: finger (Show other bugs)
6.2
i386 Linux
low Severity low
: ---
: ---
Assigned To: Crutcher Dunnavant
:
: 14002 (view as bug list)
Depends On:
Blocks: 14002
  Show dependency treegraph
 
Reported: 1999-11-04 12:38 EST by Dennis Brylow
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-04 16:24:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dennis Brylow 1999-11-04 12:38:09 EST
bsd-finger-0.10-25 has code for compliance with an obscure
feature of RFC742, which, roughly paraphrased, states that
"/w" or "/W" is equivalent to "-l".
The code simply overwrites the "/w" with the "-l" before
passing the args to the finger command, which knows nothing
of "/w".  However, this results in finger requests of the
form "finger /wuser@machine" becoming "-luser" instead of
"-l user".
Comment 1 Jeff Johnson 1999-12-22 10:06:59 EST
Does this problem persist in the latest finger-0.16-1 package in Raw Hide?
I'm not quite sure how to test, so, if you can supply a working test case,
I'd be grateful.
Comment 2 Jeff Johnson 2000-01-04 11:56:59 EST
Fixed in finger-0.16-2. Thanks for the patch.
Comment 3 Dennis Brylow 2000-05-18 03:08:59 EDT
The bug was fixed in finger-0.16-2, but it has now reappeared in finger-0.16-5
for RedHat v6.2.

Here, again, is the patch:

This patch fixes the code for compliance with an obscure feature of RFC742,
which, roughly paraphrased, states that "/w" or "/W" is equivalent to "-l".
The previous code simply overwrites the "/w" with the "-l" before passing
the args to the finger command, which knows nothing of "/w".  This patch
adds in a space, so that "/wuser" is expanded to "-l user" instead of
"-luser", which would not be understood by finger.

--- bsd-finger-0.16/fingerd/fingerd.c	Sun Dec 12 13:46:28 1999
+++ bsd-finger-0.16/fingerd/fingerd.c	Thu May 18 01:56:54 2000
@@ -214,7 +214,12 @@
 	av[k++] = "finger";
 	for (s = strtok(line, WS); s && k<ENTRIES; s = strtok(NULL, WS)) {
 		/* RFC742: "/[Ww]" == "-l" */
-		if (!strncasecmp(s, "/w", 2)) memcpy(s, "-l", 2);
+		if (!strncasecmp(s, "/w", 2))
+		  {
+		    if (k < ENTRIES - 1)
+		      av[k++] = "-l";
+		    s += 2;
+		  }
 		if (!forwarding) {
 		    t = strchr(s, '@');
 		    if (t) {
Comment 4 Pekka Savola 2000-07-16 03:40:06 EDT
This is still an issue in Rawhide finger (0.17-0.1).
Comment 5 Jeff Johnson 2000-07-22 15:05:18 EDT
Fixed in finger-0.17-3. Thanks (again) for the patch.
Comment 6 Christian Rose 2000-08-04 14:39:13 EDT
I can't verify that with finger 0.17-3.

finger /W user

and

finger /w user

produce correct results, but not

finger /Wuser

or

finger /wuser

The just return "unknown user".
Comment 7 Dennis Brylow 2000-08-04 14:56:50 EDT
Executing a "finger /wuser" should be expected to return "unknown user".  The
"/w" is really not proper Linux/Unix command line style.  The issue is that the
finger daemon must translate /w's incoming from other systems.  Therefore,
the appropriate test is "finger /wuser@machine".
Comment 8 Jeff Johnson 2000-08-04 16:24:26 EDT
*** Bug 14002 has been marked as a duplicate of this bug. ***
Comment 9 Christian Rose 2000-08-04 16:28:29 EDT
My bad. One always learns something.
Could verify correct /wuser@machine and /Wuser@machine behavior when fingering
from another machine.
Closing this.

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