From 2f823059e9566ae24e0881fd0c5fc096352810cc Mon Sep 17 00:00:00 2001 From: william Date: Wed, 2 Jan 2013 04:19:54 +0000 Subject: [PATCH] As of 1.5, upstream no longer supported utmp: http://git.savannah.gnu.org/cgit/nmh.git/patch/?id=7ba29497ff3f164e2a507eda35e81f1cb0658c74 Without utmp support (or utmpx in openbsd), rcvtty(1) will not notify the terminal upon receipt of new mail... which is why it exists. We still want rcvtty to work, so bring the utmp support back as a local patch. ok bentley@ --- mail/nmh/Makefile | 3 +- mail/nmh/patches/patch-uip_rcvtty_c | 47 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 mail/nmh/patches/patch-uip_rcvtty_c diff --git a/mail/nmh/Makefile b/mail/nmh/Makefile index 073f46c7d9b..b0e9d0555dd 100644 --- a/mail/nmh/Makefile +++ b/mail/nmh/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.33 2012/06/18 16:03:00 pascal Exp $ +# $OpenBSD: Makefile,v 1.34 2013/01/02 04:19:54 william Exp $ COMMENT= new MH mail handling program DISTNAME= nmh-1.5 +REVISION= 0 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SAVANNAH:=nmh/} HOMEPAGE= http://www.nongnu.org/nmh/ diff --git a/mail/nmh/patches/patch-uip_rcvtty_c b/mail/nmh/patches/patch-uip_rcvtty_c new file mode 100644 index 00000000000..6f97afe2e65 --- /dev/null +++ b/mail/nmh/patches/patch-uip_rcvtty_c @@ -0,0 +1,47 @@ +$OpenBSD: patch-uip_rcvtty_c,v 1.1 2013/01/02 04:19:55 william Exp $ + +Upstream no longer supports utmp... +http://git.savannah.gnu.org/cgit/nmh.git/patch/?id=7ba29497ff3f164e2a507eda35e81f1cb0658c74 + + +--- uip/rcvtty.c.orig Mon Jun 11 00:06:19 2012 ++++ uip/rcvtty.c Tue Jan 1 18:11:37 2013 +@@ -24,6 +24,8 @@ + + #ifdef HAVE_GETUTXENT + #include ++#else ++#include + #endif /* HAVE_GETUTXENT */ + + #define SCANFMT \ +@@ -83,7 +85,12 @@ main (int argc, char **argv) + int md, vecp = 0; + char *cp, *user, buf[BUFSIZ], tty[BUFSIZ]; + char **argp, **arguments, *vec[MAXARGS]; ++#if HAVE_GETUTXENT + struct utmpx *utp; ++#else ++ struct utmp ut; ++ register FILE *uf; ++#endif + #ifdef LOCALE + setlocale(LC_ALL, ""); + #endif +@@ -169,6 +176,16 @@ main (int argc, char **argv) + } + } + endutxent(); ++#else ++ if ((uf = fopen (_PATH_UTMP, "r")) == NULL) ++ exit (RCV_MBX); ++ while (fread ((char *) &ut, sizeof(ut), 1, uf) == 1) ++ if (ut.ut_name[0] != 0 ++ && strncmp (user, ut.ut_name, sizeof(ut.ut_name)) == 0) { ++ strncpy (tty, ut.ut_line, sizeof(ut.ut_line)); ++ alert (tty, md); ++ } ++ fclose (uf); + #endif /* HAVE_GETUTXENT */ + + exit (RCV_MOK);