From 84b98d0484fe61d4ebe205016e35a06da194f525 Mon Sep 17 00:00:00 2001 From: Dan Harkless Date: Thu, 2 Mar 2000 07:52:47 +0000 Subject: [PATCH] Changed the GECOS-field '&' translation behavior to be controlled by the BSD42 #define rather than GCOS_HACK, since it's apparently always appropriate on OSes where BSD42 is #defined, and never appropriate on any other OSes. Thanks to Kimmo Suominen for responding to my "What is this code here for?" comment in mts.c and explaining the feature. Also added ULTRIX 4.2A to the list of OSes that have an initgroups() function but no prototype in the system headers. --- ChangeLog | 9 +++++++++ TODO | 3 +++ acconfig.h | 4 ++-- config.h.in | 4 ++-- configure.in | 6 +++--- stamp-h.in | 2 +- uip/slocal.c | 3 ++- zotnet/mts/mts.c | 14 +++++++++----- 8 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ac95ef..d96f7c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Mar 01 23:30:50 2000 Dan Harkless + + * Changed the GECOS-field '&' translation behavior to be + controlled by the BSD42 #define rather than GCOS_HACK, since it's + apparently always appropriate on OSes where BSD42 is #defined, and + never appropriate on any other OSes. Thanks to Kimmo Suominen for + responding to my "What is this code here for?" comment in mts.c + and explaining the feature. + Mon Feb 28 21:50:29 2000 Dan Harkless * Upped the version number to 1.0.3+dev (ideally this should be diff --git a/TODO b/TODO index 27ca134..345960d 100644 --- a/TODO +++ b/TODO @@ -28,6 +28,9 @@ MAN PAGES --------- +* Change all man pages to group all the commandline options together in one + section with each as a separate mini-heading. Having to dig through prose to + find what a particular option does is a pain in the nads. * Update mh-tailor man page. * generate mh-chart man page from other man pages * update default mode in man pages with sed diff --git a/acconfig.h b/acconfig.h index 146d00a..15178d7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -265,8 +265,8 @@ #undef HAVE_DB1_NDBM_H /* Define to the header containing the declaration of initgroups() on your - system, if any. AIX 4.[13] and SunOS 4.1.3 have the function in libc but - don't have a declaration anywhere. */ + system, if any. AIX 4.[13], SunOS 4.1.3, and ULTRIX 4.2A have the function + in libc but don't have a declaration anywhere. */ #undef INITGROUPS_HEADER /* Define if your system actually has a prototype for snprintf() in diff --git a/config.h.in b/config.h.in index e6073bd..b9b9ed1 100644 --- a/config.h.in +++ b/config.h.in @@ -300,8 +300,8 @@ #undef HAVE_GETHOSTBYNAME /* Define to the header containing the declaration of initgroups() on your - system, if any. AIX 4.[13] and SunOS 4.1.3 have the function in libc but - don't have a declaration anywhere. */ + system, if any. AIX 4.[13], SunOS 4.1.3, and ULTRIX 4.2A have the function + in libc but don't have a declaration anywhere. */ #undef INITGROUPS_HEADER /* Define if your system actually has a prototype for snprintf() in diff --git a/configure.in b/configure.in index 37204fa..5176a8a 100644 --- a/configure.in +++ b/configure.in @@ -370,9 +370,9 @@ AC_TRY_LINK([#include ], [sigsetjmp((void *)0, 0);], AC_REPLACE_FUNCS(snprintf strerror strdup) -dnl Look for the initgroups() declaration. On AIX 4.[13] and Solaris 4.1.3, -dnl the function is defined in libc but there's no declaration in any system -dnl header. +dnl Look for the initgroups() declaration. On AIX 4.[13], Solaris 4.1.3, and +dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in +dnl any system header. dnl dnl On Solaris 2.[456], the declaration is in . On HP-UX 9-11 and dnl (reportedly) FreeBSD 3.[23], it's in . Any other locations we diff --git a/stamp-h.in b/stamp-h.in index ef93cba..da7a698 100644 --- a/stamp-h.in +++ b/stamp-h.in @@ -1 +1 @@ -Mon Feb 28 22:19:07 PST 2000 +Wed Mar 1 23:36:54 PST 2000 diff --git a/uip/slocal.c b/uip/slocal.c index e12b940..22ba3e8 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -34,7 +34,8 @@ #else /* On AIX 4.1, initgroups() is defined and even documented (giving the parameter types as char* and int), but doesn't have a prototype in any of the system - header files. AIX 4.3 and SunOS 4.1.3 have the same problem. */ + header files. AIX 4.3, SunOS 4.1.3, and ULTRIX 4.2A have the same + problem. */ extern int initgroups(char*, int); #endif diff --git a/zotnet/mts/mts.c b/zotnet/mts/mts.c index 254a758..26e4807 100644 --- a/zotnet/mts/mts.c +++ b/zotnet/mts/mts.c @@ -415,12 +415,16 @@ getuserinfo (void) * "Dan Harkless ". Naturally, you'll want your MTA to have * an alias (e.g. in /etc/aliases) from "fakeusername" to your account name. */ -#ifndef GCOS_HACK - /* What is this code here for? As of 2000-01-25, GCOS_HACK doesn't appear - anywhere else in nmh. -- Dan Harkless */ +#ifndef BSD42 for (cp = fullname; *np && *np != (MMailids ? '<' : ','); *cp++ = *np++) continue; -#else +#else /* BSD42 */ + /* On BSD(-derived) systems, the system utilities that deal with the GECOS + field (finger, mail, sendmail, etc.) translate any '&' character in it to + the login name, with the first letter capitalized. So, for instance, + fingering a user "bob" with the GECOS field "& Jones" would reveal him to + be "In real life: Bob Jones". Surprisingly, though, the OS doesn't do + the translation for you, so we have to do it manually here. */ for (cp = fullname; *np && *np != (MMailids ? '<' : ','); ) { if (*np == '&') { /* blech! */ strcpy (cp, pw->pw_name); @@ -432,7 +436,7 @@ getuserinfo (void) *cp++ = *np++; } } -#endif +#endif /* BSD42 */ *cp = '\0'; if (MMailids) { -- 1.7.10.4