Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* fingerd tweaking
@ 1997-12-05  5:00 Cameron Laird
  1997-12-05  5:00 ` Louis Theran
  1997-12-08  5:00 ` Craig Johnston
  0 siblings, 2 replies; 3+ messages in thread
From: Cameron Laird @ 1997-12-05  5:00 UTC (permalink / raw)



I'm doing administration of a Digital Unix 4.0 host.  The
organization wants a finger daemon that returns only on
exact matches (that is, a client who commands "finger bob"
will see data only on "bob", not "bob_adams", "bob_bell",
...).  Suggestions, anyone?  I think I might be able to
munge inetd's invocation of fingerd so that it does this;
if not, perhaps I'll find a public domain copy of sources,
and hack at them a bit to do what I want.  Are there other
possibilities I should know?
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com      +1 713 996 8546 FAX



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fingerd tweaking
  1997-12-05  5:00 fingerd tweaking Cameron Laird
@ 1997-12-05  5:00 ` Louis Theran
  1997-12-08  5:00 ` Craig Johnston
  1 sibling, 0 replies; 3+ messages in thread
From: Louis Theran @ 1997-12-05  5:00 UTC (permalink / raw)



In article <669n60$n1q$1@Starbase.NeoSoft.COM>, Cameron Laird wrote:
>I'm doing administration of a Digital Unix 4.0 host.  The
>organization wants a finger daemon that returns only on
>exact matches (that is, a client who commands "finger bob"
>will see data only on "bob", not "bob_adams", "bob_bell",
>...).  Suggestions, anyone?  I think I might be able to
>munge inetd's invocation of fingerd so that it does this;

This sounds like the correct route.  The fingerd on my system (FreeBSD) has
an option that lets you specify the program that it uses to look up local
information.  If the default one on Digital Unix doesn't, I'm sure that you
can get another one off the net that does.  You should also look at the man
page for finger(1).  Some versions have options that allow you to tell it
only to match against user names, etc.  If finger(1) doesn't support exactly
what you want, just wrap it in a script and have fingerd invoke that.

Something else to consider is that finger(1) doesn't necessarily use the
network for local lookups.  Exactly what happens depends, not surprisingly,
on your local setup and the OS you are using.

^L

-- 
Louis Theran a.k.a. User K -- Carjacker on the Information Superhighway
"Off the record.  On the QT.  And very Hush-Hush."
(Sending mail to k-dated@yt.to will return a temporary address that works.)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fingerd tweaking
  1997-12-05  5:00 fingerd tweaking Cameron Laird
  1997-12-05  5:00 ` Louis Theran
@ 1997-12-08  5:00 ` Craig Johnston
  1 sibling, 0 replies; 3+ messages in thread
From: Craig Johnston @ 1997-12-08  5:00 UTC (permalink / raw)



In article <669n60$n1q$1@Starbase.NeoSoft.COM>,
Cameron Laird <claird@Starbase.NeoSoft.COM> wrote:
>I'm doing administration of a Digital Unix 4.0 host.  The
>organization wants a finger daemon that returns only on
>exact matches (that is, a client who commands "finger bob"
>will see data only on "bob", not "bob_adams", "bob_bell",
>...).  Suggestions, anyone?  I think I might be able to
>munge inetd's invocation of fingerd so that it does this;
>if not, perhaps I'll find a public domain copy of sources,
>and hack at them a bit to do what I want.  Are there other
>possibilities I should know?

Yeah -- a simple wrapper.  Provided your local fingerd just calls
finger (usually the case) and your local fingerd doesn't have an
option to call finger with the "-m" flag (and provided that your
local finger supports "-m" or something similar) you could move
finger someplace and replace it with something like this:

#include <stdio.h>
#include <unistd.h>

#define REAL_FINGER_PATH "/usr/bin/finger.orig"  /* or whatever */
#define OPTION "-m"   /* flag to make finger only show exact matches */

int main(int argc, char **argv)
{
char *args[argc+2];  /* need a null terminator for execv(), and an extra arg */
char **index;   
index = args;       /* follow the bouncing ball... */ 

*index++ = *argv++; --argc;  /* copy argv[0] */
*index++ = OPTION;           /* make OPTION the first arg */
while(argc--) *index++ = *argv++;  /* copy the rest of our args */
*index = 0; 	   	/* make execv happy */

execv(REAL_FINGER_PATH, args);  /* exec finger */
perror("couldn't exec finger");     /* we bit it if we got here */
return 1;
}

Compile, install in place of the original finger.  Don't make it
setuid or setgid -- leave the old finger with whatever mode it had
before and if something bad happens, it wasn't my fault.    ;)

-- 
Craig A. Johnston  /  Applications Engineer, NeoSoft, Inc.  
caj@neosoft.com    /  ph: (504) 539-9235  



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-12-08  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-12-05  5:00 fingerd tweaking Cameron Laird
1997-12-05  5:00 ` Louis Theran
1997-12-08  5:00 ` Craig Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox