Add a -L (lie brazenly) flag, to demonstrate the perils of proof by

assertion^W^W^W^W^W^W^Wprovide admins with a means of providing a
standard host-wide identd response.  From the man page:

The -L<user name> option instructs identd to lie  brazenly
about  the  identity  of the user in question.  You didn't
really intend to trust my assertion about who I  was  any-
way, right?
This  flag  provides  a way for a site to support services
requiring the ident protocol while  providing  a  standard
answer to all ident queries. All queries to identd will
respond with a host type of  `OTHER'  and  a  username  of
<user name>.
This commit is contained in:
jwise 1999-05-18 04:49:41 +00:00
parent 05bdcfc198
commit 76cd940256
5 changed files with 50 additions and 5 deletions

View File

@ -1,9 +1,12 @@
# $NetBSD: Makefile,v 1.6 1998/07/15 07:31:55 msaitoh Exp $
# $NetBSD: Makefile,v 1.7 1999/05/18 04:49:41 jwise Exp $
PROG= identd
MAN= identd.8
CPPFLAGS+= -DINCLUDE_EXTENSIONS -DSTRONG_LOG -DALLOW_FORMAT
.ifdef DEFAULT_LIE_USER
CPPFLAGS+= -DDEFAULT_LIE_USER=\"${DEFAULT_LIE_USER}\"
.endif
LDADD+= -lutil -lkvm
DPADD+= ${LIBUTIL} ${LIBKVM}

View File

@ -1,4 +1,4 @@
.\" $NetBSD: identd.8,v 1.7 1998/07/15 07:31:56 msaitoh Exp $
.\" $NetBSD: identd.8,v 1.8 1999/05/18 04:49:41 jwise Exp $
.\"
.\" @(#)identd.8 1.9 92/02/11 Lysator
.\" Copyright (c) 1992 Peter Eriksson, Lysator, Linkoping University.
@ -25,6 +25,7 @@ identd \- TCP/IP IDENT protocol server
.RB [ \-N ]
.RB [ \-d ]
.RB [ \-F<format> ]
.RB [ \-L<user name> ]
.RB [ "kernelfile" [ "kmemfile" ] ]
.SH DESCRIPTION
.IX "identd daemon" "" \fLidentd\fP daemon"
@ -279,6 +280,18 @@ Not implemented yet, but on my wish-list are the following:
.in -.5i
.fi
.PP
The
.B \-L<user name>
option instructs
.B identd
to lie brazenly about the identity of the user in question. You didn't
.I really
intend to trust my assertion about who I was anyway, right?
.br
This flag provides a way for a site to support services requiring the ident
protocol while providing a standard answer to all ident queries. All queries
to identd will respond with a host type of `OTHER' and a username of <user name>.
.PP
.B kernelfile
defaults to the normally running kernel file.
.PP

View File

@ -1,4 +1,4 @@
/* $NetBSD: identd.c,v 1.9 1998/07/15 07:31:56 msaitoh Exp $ */
/* $NetBSD: identd.c,v 1.10 1999/05/18 04:49:41 jwise Exp $ */
/*
** identd.c A TCP/IP link identification protocol server
@ -107,6 +107,7 @@ int other_flag = 0;
int unknown_flag = 0;
int noident_flag = 0;
int crypto_flag = 0;
int liar_flag = 0;
int lport = 0;
int fport = 0;
@ -114,6 +115,7 @@ int fport = 0;
char *charset_name = (char *) NULL;
char *indirect_host = (char *) NULL;
char *indirect_password = (char *) NULL;
char *lie_string = (char *) NULL;
#ifdef ALLOW_FORMAT
int format_flag = 0;
@ -477,6 +479,18 @@ int main(argc,argv)
break;
#endif
case 'L': /* lie brazenly */
liar_flag = 1;
if (*(argv[i]+2) != '\0')
lie_string = argv[i]+2;
else
#ifdef DEFAULT_LIE_USER
lie_string = DEFAULT_LIE_USER;
#else
ERROR("-L specified with no user name");
#endif
break;
default:
ERROR1("Bad option %s", argv[i]);
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: identd.h,v 1.5 1998/07/15 07:31:56 msaitoh Exp $ */
/* $NetBSD: identd.h,v 1.6 1999/05/18 04:49:41 jwise Exp $ */
/*
** identd.h Common variables for the Pidentd daemon
@ -15,6 +15,7 @@
#define __IDENTD_H__
extern char version[];
extern char *lie_string;
extern char *path_unix;
extern char *path_kmem;
@ -27,6 +28,7 @@ extern int other_flag;
extern int unknown_flag;
extern int noident_flag;
extern int crypto_flag;
extern int liar_flag;
extern char *charset_name;
extern char *indirect_host;

View File

@ -1,4 +1,4 @@
/* $NetBSD: parse.c,v 1.11 1998/07/27 15:11:06 mycroft Exp $ */
/* $NetBSD: parse.c,v 1.12 1999/05/18 04:49:41 jwise Exp $ */
/*
** parse.c This file contains the protocol parser
@ -224,6 +224,19 @@ int parse(fp, laddr, faddr)
/* Read query from client */
rcode = fscanf(fp, " %d , %d", &lport, &fport);
if (liar_flag)
{
if (syslog_flag)
syslog(LOG_NOTICE, "User %s requested a user for host %s: %d, %d, and I lied",
pwp->pw_name,
gethost(faddr),
lport, fport);
printf("%d , %d : USER-ID : OTHER :%s\r\n",
lport, fport, lie_string);
continue;
}
#ifdef INCLUDE_EXTENSIONS
/*
** Do additional parsing in case of extended request