[7837] in Athena Bugs

home help back first fref pref prev next nref lref last post

patch to sendmail for hesiod username lookup

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Mon Jul 29 23:44:45 1991

Date: Mon, 29 Jul 91 20:43:53 -0700
From: "Jonathan I. Kamens" <jik@cats.UCSC.EDU>
To: bugs@ATHENA.MIT.EDU


The patch below (which is against sendmail 5.65, but which will
probably apply with small changes to 5.61; in fact, we should get 5.65
and incorporate any local changes into it, and use that as the default
sendmail in the next release) makes sendmail do a hesiod lookup on a
UID to get the username of a user sending mail, if a regular passwd
file lookup fails.

This fix may or may not have solved the problem we were experiencing
with xmh in the last release.  In addition, it makes "expreserve" work
right if a user's login session is terminated while using vi (yeah,
yeah, I know, few people at MIT use vi, but nevertheless, it's
worthwhile trying to get it to work).

Note that in order for this patch to work, the previous patch I sent
in for hesiod.h needs to be applied (so that hesiod.h declares
hes_getpwuid), and the Imakefile/Makefile for sendmail needs to be
modified to give proper -I and -L flags (if it doesn't do that
already) and to define HESIOD when compiling.

  jik

*** 1.1	1991/07/30 03:25:26
--- conf.c	1991/07/30 03:31:15
***************
*** 27,32 ****
--- 27,35 ----
  # include <pwd.h>
  # include "sendmail.h"
  # include "pathnames.h"
+ # ifdef HESIOD
+ # include <hesiod.h>
+ # endif
  
  /*
  **  CONF.C -- Sendmail Configuration Tables.
***************
*** 236,241 ****
--- 239,252 ----
  			pw = getpwuid(getruid());
  			if (pw != NULL)
  				myname = newstr(pw->pw_name);
+ # ifdef HESIOD
+ 			else
+ 			{
+ 				pw = hes_getpwuid(getruid());
+ 				if (pw != NULL)
+ 					myname = newstr(pw->pw_name);
+ 			}
+ # endif
  		}
  		else
  		{

home help back first fref pref prev next nref lref last post