From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,afa985c13d885d6a X-Google-Attributes: gidf8c9b,public X-Google-Thread: 1020c6,afa985c13d885d6a X-Google-Attributes: gid1020c6,public X-Google-Thread: fee84,afa985c13d885d6a X-Google-Attributes: gidfee84,public From: caj@praline.no.neosoft.com (Craig Johnston) Subject: Re: fingerd tweaking Date: 1997/12/08 Message-ID: <66g3gs$57n@praline.no.neosoft.com>#1/1 X-Deja-AN: 296196792 References: <669n60$n1q$1@Starbase.NeoSoft.COM> Organization: NeoSoft, Inc. (Houston Based Internet Service Provider) Newsgroups: comp.unix.questions,comp.unix.osf.osf1,comp.unix.admin 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; >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 #include #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