1997-01-24 - Re: fingerd

Header Data

From: ichudov@algebra.com
To: Peter M Allan <peter.allan@aeat.co.uk>
Message Hash: 5605f05f90b7b952c1f8010839b6558aad5e2aa659a1ed314f85f4a8a6a47371
Message ID: <199701241610.IAA28245@toad.com>
Reply To: N/A
UTC Datetime: 1997-01-24 16:10:47 UTC
Raw Date: Fri, 24 Jan 1997 08:10:47 -0800 (PST)

Raw message

From: ichudov@algebra.com
Date: Fri, 24 Jan 1997 08:10:47 -0800 (PST)
To: Peter M Allan <peter.allan@aeat.co.uk>
Subject: Re: fingerd
Message-ID: <199701241610.IAA28245@toad.com>
MIME-Version: 1.0
Content-Type: text/plain


Peter M Allan wrote:
> 
> These messages have been sent about fingerd.
> My preference for fiddling with remote fingers is to
> leave fingerd as supplied by the vendor (run by "nobody") and
> replace the finger program itself.  It can be made to recognise
> when it is being run by "nobody" and behave differently
> from when run by another user.
> 
> Source at the end of this file.  (Bashed out fairly quickly
> starting from a utmp-eraser I made for a luser who wouldn't
> tolerate wall messages from shutdown.)
> 
> I have (among other things) an extension to TCP-wrappers
> (a new hosts_access.c file), and a prog to find disk space wasted by duplicated files.  
> (mail me with Subject: "send goodies" for these.)
> /*  
> *  
> *  compile and test myfinger
> *  
> *  	cc  -C -o myfinger myfinger.c
> *  
> *  
> *  (assuming the standard finger is /usr/ucb/finger)
> *     cp /usr/ucb/finger /usr/ucb/finger.real
> *     cp myfinger /usr/ucb/finger
> *  
> *  
> *  (if using TCP wrapper reverse-fingers, make them NOT nobody,
> *   but another id such as nobody2.)
> *  
> *  I disclaim any disasters........
> *  
> */  
> 
> /*
>  *
>  *   my finger program - local only, to be less informative than /usr/ucb/finger
>  *   
>  */
> 
> 
> #undef _utmp_h
> #define TRUE  1
> #define FALSE 0
> #define FAKE 1
> #define WIPE 2
> #define UTMP "/etc/utmp"
> 
> 
> #include <stdio.h>
> #include <pwd.h>
> #include "utmp.h"
> #include <lastlog.h>
> 
> main(argc, argv, env)
> int  argc;
> char **argv;
> char **env;
> {
> 	int  i, listed;
> 	struct passwd *pwent;
> 
> 	if (argc < 1)
> 		exit(0);	/* beat sneaks */

argc is never less than one.

>          /*  If run by "nobody" (uid=65534) assume this is a remote finger */
>          /* otherwise run the standard finger command */
>          if (65534!=getuid()) {
>                        execv("/usr/ucb/finger.real", argv);
>                        /** if we get here exec failed, so we default to my finger  **/

igor






Thread