Bug 6728 - RFC742 "/w" not expanded properly.
Summary: RFC742 "/w" not expanded properly.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: finger
Version: 6.2
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
: 14002 (view as bug list)
Depends On:
Blocks: 14002
TreeView+ depends on / blocked
 
Reported: 1999-11-04 17:38 UTC by Dennis Brylow
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-08-04 20:24:32 UTC


Attachments (Terms of Use)

Description Dennis Brylow 1999-11-04 17:38:09 UTC
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 15:06:59 UTC
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 16:56:59 UTC
Fixed in finger-0.16-2. Thanks for the patch.

Comment 3 Dennis Brylow 2000-05-18 07:08:59 UTC
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 07:40:06 UTC
This is still an issue in Rawhide finger (0.17-0.1).


Comment 5 Jeff Johnson 2000-07-22 19:05:18 UTC
Fixed in finger-0.17-3. Thanks (again) for the patch.

Comment 6 Christian Rose 2000-08-04 18:39:13 UTC
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 18:56:50 UTC
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 20:24:26 UTC
*** Bug 14002 has been marked as a duplicate of this bug. ***

Comment 9 Christian Rose 2000-08-04 20:28:29 UTC
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.