From: Ken Hornstein Date: Fri, 18 Apr 2014 13:30:22 +0000 (-0400) Subject: Remove conflict(8). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/94b8e5d6c0fff813de5da91558aaebf1df8c816e Remove conflict(8). --- diff --git a/.gitignore b/.gitignore index b8e0d468..e3335a9b 100644 --- a/.gitignore +++ b/.gitignore @@ -58,7 +58,6 @@ a.out.dSYM/ /uip/ap /uip/burst /uip/comp -/uip/conflict /uip/dist /uip/dp /uip/flist diff --git a/Makefile.am b/Makefile.am index 6d253a4a..46f7b904 100644 --- a/Makefile.am +++ b/Makefile.am @@ -152,7 +152,7 @@ bin_SCRIPTS = uip/mhmail etc/sendfiles ## ## This is all programs that get installed in the "lib" directory ## -auxexec_PROGRAMS = uip/ap uip/conflict uip/dp uip/fmtdump uip/mhl uip/mkstemp \ +auxexec_PROGRAMS = uip/ap uip/dp uip/fmtdump uip/mhl uip/mkstemp \ uip/post uip/rcvdist uip/rcvpack uip/rcvstore uip/rcvtty \ uip/slocal uip/viamail uip/mhtest @@ -224,7 +224,7 @@ dist_contrib_DATA = docs/contrib/replyfilter docs/contrib/build_nmh \ ## Our man pages ## man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ - man/conflict.8 man/dist.1 man/dp.8 man/flist.1 man/flists.1 \ + man/dist.1 man/dp.8 man/flist.1 man/flists.1 \ man/fmtdump.8 man/fmttest.1 man/fnext.1 man/folder.1 man/folders.1 \ man/forw.1 man/fprev.1 man/inc.1 man/install-mh.1 man/mark.1 \ man/mh-alias.5 man/mh-chart.7 man/mh-draft.5 man/mh-folders.5 \ @@ -243,7 +243,7 @@ man_MANS = man/ali.1 man/anno.1 man/ap.8 man/burst.1 man/comp.1 \ ## Sources for our man pages ## man_SRCS = man/ali.man man/anno.man man/ap.man man/burst.man man/comp.man \ - man/conflict.man man/dist.man man/dp.man man/flist.man \ + man/dist.man man/dp.man man/flist.man \ man/flists.man man/fmtdump.man man/fmttest.man man/fnext.man \ man/folder.man man/folders.man man/forw.man man/fprev.man \ man/inc.man man/install-mh.man man/mark.man man/mh-alias.man \ @@ -415,9 +415,6 @@ uip_whom_LDADD = $(LDADD) $(POSTLINK) uip_ap_SOURCES = uip/ap.c uip_ap_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK) -uip_conflict_SOURCES = uip/conflict.c uip/aliasbr.c -uip_conflict_LDADD = $(LDADD) $(POSTLINK) - uip_dp_SOURCES = uip/dp.c uip_dp_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK) diff --git a/docs/pending-release-notes b/docs/pending-release-notes index 2107b3c2..755d6bda 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -7,8 +7,9 @@ NEW FEATURES OBSOLETE FEATURES ----------------- -- The undocumented -queue switch to post was deprecated in nmh 1.6, and +- The undocumented -queue switch to post was deprecated in nmh 1.6, and was removed in this release. +- conflict(8) was deprecated in nmh 1.6, and was removed in this release. ------------------- DEPRECATED FEATURES diff --git a/man/conflict.man b/man/conflict.man deleted file mode 100644 index 8f00bda8..00000000 --- a/man/conflict.man +++ /dev/null @@ -1,81 +0,0 @@ -.TH CONFLICT %manext8% "June 24, 2012" "%nmhversion%" -.\" -.\" %nmhwarning% -.\" -.SH NAME -conflict \- search for alias/password conflicts -.SH SYNOPSIS -.HP 5 -.na -.B %libdir%/conflict -.RB [ \-search -.IR directory ] -.RB [ \-mail -.IR name ] -.RB [ \-version ] -.RB [ \-help ] -.RI [ aliasfiles -\&...] -.ad -.SH DESCRIPTION -.B "Conflict is deprecated and will be removed from the next nmh release." -.PP -.B Conflict -is a program that checks to see if the interface between -.B nmh -and the transport system is in good shape -.PP -.B Conflict -also checks for maildrops in %mailspool% which do not -belong to a valid user. It assumes that no user name will start with -`.', and thus ignores files in %mailspool% which begin with `.'. It also -checks for entries in the -.IR group (5) -file which do not belong -to a valid user, and for users who do not have a valid group number. -In addition duplicate users and groups are noted. -.PP -If the -.B \-mail -.I name -switch is used, then the results will be sent -to the specified -.IR name . -Otherwise, the results are sent to the standard output. -.PP -The -.B \-search -.I directory -switch can be used to search directories -other than %mailspool% and to report anomalies in those directories. -The -.B \-search -.I directory -switch can appear more than one time in an -invocation to -.BR conflict . -.PP -.B Conflict -should be run under -.IR cron (8), -or whenever system accounting takes place. -.SH FILES -.fc ^ ~ -.nf -.ta \w'%etcdir%/ExtraBigFileName 'u -^%etcdir%/mts.conf~^nmh mts configuration file -^/etc/passwd~^List of users -^/etc/group~^List of groups -^%bindir%/mhmail~^Program to send mail -^%mailspool%/~^Directory of mail drop -.fi -.SH "PROFILE COMPONENTS" -None -.SH "SEE ALSO" -.IR mh\-alias (5) -.SH "DEFAULTS" -.nf -.RB ` aliasfiles "' defaults to %etcdir%/MailAliases" -.fi -.SH CONTEXT -None diff --git a/man/mh-alias.man b/man/mh-alias.man index d765f887..dcb6e212 100644 --- a/man/mh-alias.man +++ b/man/mh-alias.man @@ -1,4 +1,4 @@ -.TH MH-ALIAS %manext5% "Oct 14, 2012" "%nmhversion%" +.TH MH-ALIAS %manext5% "Apr 18, 2014" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -192,7 +192,6 @@ System-wide default alias file. .IR whom (1), .IR getgrent (3), .IR getpwent (3), -.IR conflict (8), .IR post (8) .SH BUGS Although the forward-referencing semantics of diff --git a/man/mh-profile.man b/man/mh-profile.man index f991860f..61cf70bf 100644 --- a/man/mh-profile.man +++ b/man/mh-profile.man @@ -1,4 +1,4 @@ -.TH MH-PROFILE %manext5% "February 16, 2014" "%nmhversion%" +.TH MH-PROFILE %manext5% "April 18, 2014" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -537,10 +537,6 @@ supersedes the default built-in pager command.) .RS 5 This is the program used to automatically mail various messages and notifications. It is used by -.B conflict -when using the -.B \-mail -option. It is used by .B send to post failure notices. It is used to retrieve an external-body with access-type `mail-server' diff --git a/man/mh-tailor.man b/man/mh-tailor.man index ba62daa4..c446b2e2 100644 --- a/man/mh-tailor.man +++ b/man/mh-tailor.man @@ -1,4 +1,4 @@ -.TH MH-TAILOR %manext5% "December 8, 2013" "%nmhversion%" +.TH MH-TAILOR %manext5% "April 18, 2014" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -12,7 +12,6 @@ defines run-time options for those programs which interact (in some form) with the message transport system. At present, these (user) programs are: .BR ap , -.BR conflict , .BR inc , .BR msgchk , .BR msh , diff --git a/man/nmh.man b/man/nmh.man index b9dadd17..18dd7008 100644 --- a/man/nmh.man +++ b/man/nmh.man @@ -1,4 +1,4 @@ -.TH NMH %manext7% "March 13, 2014" "%nmhversion%" +.TH NMH %manext7% "April 18, 2014" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -474,9 +474,6 @@ Indirectly Invoked Commands .IR ap (8) parse addresses RFC 822\-style .TP -.IR conflict (8) -search for alias/password conflicts -.TP .IR dp (8) parse dates RFC 822\-style .TP diff --git a/uip/conflict.c b/uip/conflict.c deleted file mode 100644 index 4c140022..00000000 --- a/uip/conflict.c +++ /dev/null @@ -1,372 +0,0 @@ - -/* - * conflict.c -- check for conflicts in mail system - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ - -#include -#include -#include -#include -#include -#include -#include - -/* - * maximum number of directories that can - * be specified using -search switch. - */ -#define NDIRS 100 - -/* - * Add space for group names, 100 at a time - */ -#define NGRPS 100 - -#define CONFLICT_SWITCHES \ - X("mail name", 0, MAILSW) \ - X("search directory", 0, SERCHSW) \ - X("version", 0, VERSIONSW) \ - X("help", 0, HELPSW) \ - -#define X(sw, minchars, id) id, -DEFINE_SWITCH_ENUM(CONFLICT); -#undef X - -#define X(sw, minchars, id) { sw, minchars, id }, -DEFINE_SWITCH_ARRAY(CONFLICT, switches); -#undef X - -static char *mail = NULL; -static char *dirs[NDIRS]; -static FILE *out = NULL; - -extern struct aka *akahead; -extern struct home *homehead; - -/* - * prototypes - */ -void alias_files (int, char **); -void pwd_names (void); -void grp_names (void); -void grp_members (void); -void grp_ids (void); -void maildrops (void); -void mdrop(char *); -int check (char *); -void setup (void); - - -int -main (int argc, char **argv) -{ - int akp = 0, dp = 0; - char *cp, **argp, **arguments; - char buf[BUFSIZ], *akv[50]; - - if (nmh_init(argv[0], 0 /* use context_foil() */)) { return 1; } - - mts_init (invo_name); - arguments = getarguments (invo_name, argc, argv, 0); - argp = arguments; - - while ((cp = *argp++)) { - if (*cp == '-') { - switch (smatch (++cp, switches)) { - case AMBIGSW: - ambigsw (cp, switches); - done (1); - case UNKWNSW: - adios (NULL, "-%s unknown", cp); - - case HELPSW: - snprintf (buf, sizeof(buf), "%s [switches] [aliasfiles ...]", - invo_name); - print_help (buf, switches, 0); - done (0); - case VERSIONSW: - print_version(invo_name); - done (0); - - case MAILSW: - if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); - if (mail) - adios (NULL, "mail to one address only"); - else - mail = cp; - continue; - - case SERCHSW: - if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); - if (dp >= NDIRS) - adios (NULL, "more than %d directories", NDIRS); - dirs[dp++] = cp; - continue; - } - } - akv[akp++] = cp; - } - - if (akp == 0) - akv[akp++] = AliasFile; - if (!homehead) - init_pw (); - if (!mail) - out = stdout; - dirs[dp] = NULL; - - alias_files (akp, akv); - pwd_names (); - grp_names (); - grp_members (); - grp_ids (); - maildrops (); - - done (0); - return 1; -} - - -void -alias_files (int akp, char **akv) -{ - register int i, err; - - for (i = 0; i < akp; i++) - if ((err = alias (akv[i])) != AK_OK) { - setup (); - fprintf (out, "aliasing error in %s - %s\n", akv[i], akerror (err)); - } - else - if (out && !mail) - fprintf (out, "alias file %s is ok\n", akv[i]); -} - - -void -pwd_names (void) -{ - int hit = 0; - register struct home *hm, *lm; - - for (hm = homehead; hm; hm = hm->h_next) - for (lm = hm->h_next; lm; lm = lm->h_next) - if (strcmp (hm->h_name, lm->h_name) == 0) { - setup (); - fprintf (out, "duplicate user %s(uid=%d)\n", - lm->h_name, (int) lm->h_uid); - hit++; - } - - if (!hit && out && !mail) - fprintf (out, "no duplicate users\n"); -} - - -void -grp_names (void) -{ - int numgroups, maxgroups; - int i, hit = 0; - char **grps; - struct group *gr; - - /* allocate space NGRPS at a time */ - numgroups = 0; - maxgroups = NGRPS; - grps = (char **) mh_xmalloc((size_t) (maxgroups * sizeof(*grps))); - - setgrent (); - while ((gr = getgrent ())) { - for (i = 0; i < numgroups; i++) - if (!strcmp (grps[i], gr->gr_name)) { - setup (); - fprintf (out, "duplicate group %s(gid=%d)\n", - gr->gr_name, (int) gr->gr_gid); - hit++; - break; - } - if (i >= numgroups) { - if (numgroups >= maxgroups) { - maxgroups += NGRPS; - grps = (char **) mh_xrealloc(grps, - (size_t) (maxgroups * sizeof(*grps))); - } - grps[numgroups++] = getcpy (gr->gr_name); - } - } - endgrent (); - - for (i = 0; i < numgroups; i++) - free (grps[i]); - free (grps); - - if (!hit && out && !mail) - fprintf (out, "no duplicate groups\n"); -} - - -void -grp_members (void) -{ - register int hit = 0; - register char **cp, **dp; - register struct group *gr; - register struct home *hm; - - setgrent (); - while ((gr = getgrent ())) { - for (cp = gr->gr_mem; *cp; cp++) { - for (hm = homehead; hm; hm = hm->h_next) - if (!strcmp (*cp, hm->h_name)) - break; - if (hm == NULL) { - setup (); - fprintf (out, "group %s(gid=%d) has unknown member %s\n", - gr->gr_name, (int) gr->gr_gid, *cp); - hit++; - } else { - hm->h_ngrps++; - } - - for (dp = cp + 1; *dp; dp++) - if (strcmp (*cp, *dp) == 0) { - setup (); - fprintf (out, "group %s(gid=%d) has duplicate member %s\n", - gr->gr_name, (int) gr->gr_gid, *cp); - hit++; - } - } - } - endgrent (); - - for (hm = homehead; hm; hm = hm->h_next) - if (hm->h_ngrps > NGROUPS_MAX) { - setup (); - fprintf (out, "user %s is a member of %d groups (max %d)\n", - hm->h_name, hm->h_ngrps, NGROUPS_MAX); - hit++; - } - - if (!hit && out && !mail) - fprintf (out, "all group members accounted for\n"); -} - - -void -grp_ids (void) -{ /* -DRAND not implemented at most places */ - register int hit = 0; - register struct home *hm; - - for (hm = homehead; hm; hm = hm->h_next) - if (getgrgid (hm->h_gid) == NULL) { - setup (); - fprintf (out, "user %s(uid=%d) has unknown group-id %d\n", - hm->h_name, (int) hm->h_uid, (int) hm->h_gid); - hit++; - } - - if (!hit && out && !mail) - fprintf (out, "all group-id users accounted for\n"); -} - - -void -maildrops (void) -{ - register int i; - - if (mmdfldir && *mmdfldir) - mdrop (mmdfldir); - if (uucpldir && *uucpldir) - mdrop (uucpldir); - for (i = 0; dirs[i]; i++) - mdrop (dirs[i]); -} - - -void -mdrop(char *drop) -{ - register int hit = 0; - register struct dirent *dp; - register DIR *dd = opendir (drop); - - if (!dd) { - setup (); - fprintf (out, "unable to open maildrop area %s\n", drop); - return; - } - - while ((dp = readdir (dd))) - if (dp->d_name[0] != '.' && !check (dp->d_name)) { - setup (); - fprintf (out, - "there is a maildrop for the unknown user %s in %s\n", - dp->d_name, drop); - hit++; - } - - closedir (dd); - if (!hit && out && !mail) - fprintf (out, "all maildrops accounted for in %s\n", drop); -} - - -int -check (char *s) -{ - register struct home *hm; - - for (hm = homehead; hm; hm = hm->h_next) - if (!strcmp (s, hm->h_name)) - return 1; - return 0; -} - -void -setup (void) -{ - int fd, pd[2]; - - if (out) - return; - - if (mail) { - if (pipe (pd) == NOTOK) - adios ("pipe", "unable to"); - - switch (fork ()) { - case NOTOK: - adios ("fork", "unable to"); - - case OK: - close (pd[1]); - if (pd[0] != 0) { - dup2 (pd[0], 0); - close (pd[0]); - } - if ((fd = open ("/dev/null", O_WRONLY)) != NOTOK) - if (fd != 1) { - dup2 (fd, 1); - close (fd); - } - execlp (mailproc, r1bindex (mailproc, '/'), - mail, "-subject", invo_name, (void *) NULL); - adios (mailproc, "unable to exec "); - - default: - close (pd[0]); - out = fdopen (pd[1], "w"); - fprintf (out, "%s: the following is suspicious\n\n", - invo_name); - } - } -}