Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: caj@praline.no.neosoft.com (Craig Johnston)
Subject: Re: fingerd tweaking
Date: 1997/12/08	[thread overview]
Message-ID: <66g3gs$57n@praline.no.neosoft.com> (raw)
In-Reply-To: 669n60$n1q$1@Starbase.NeoSoft.COM


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  



      parent reply	other threads:[~1997-12-08  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-05  5:00 fingerd tweaking Cameron Laird
1997-12-05  5:00 ` Louis Theran
1997-12-08  5:00 ` Craig Johnston [this message]
read-only archive

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