From f61367c1118de22149e1ddff4a2c2c2437d758f0 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Mon, 30 Jan 2012 11:33:59 +0100 Subject: [PATCH] Alias: Removed the address group `*', which meant everyone on the system. Therefore could remove `everyone' and `noshell' from mts.conf. If one really needs to write mail to everyone on the system (not just all regular users, which probably are in a group `user'), then he shurely can invest a bit more effort to do so. Likely, the simple condition to uids > 200 and not the shell `noshell' would anyways be to limited. Better use awk or the like and do it by hand. --- h/aliasbr.h | 6 ------ h/mts.h | 6 ------ man/mh-alias.man5 | 19 +++++-------------- man/mh-tailor.man5 | 15 --------------- sbr/mts.c | 12 ------------ uip/aliasbr.c | 34 +++------------------------------- 6 files changed, 8 insertions(+), 84 deletions(-) diff --git a/h/aliasbr.h b/h/aliasbr.h index 1e05335..befb8c9 100644 --- a/h/aliasbr.h +++ b/h/aliasbr.h @@ -4,7 +4,6 @@ #define PASSWD "/etc/passwd" /* passwd(5) */ #define GROUP "/etc/group" /* group(5) */ -#define EVERYONE 200 /* lowest uid for everyone */ struct aka { char *ak_name; /* name to match against */ @@ -51,8 +50,3 @@ char *akerror(int); #define AK_ERROR 2 /* error parsing file */ #define AK_LIMIT 3 /* memory limit exceeded */ #define AK_NOGROUP 4 /* no such group */ - -/* should live here, not in mts.c */ - -extern int Everyone; -extern char *NoShell; diff --git a/h/mts.h b/h/mts.h index 5092667..a0f83dc 100644 --- a/h/mts.h +++ b/h/mts.h @@ -22,9 +22,3 @@ void mts_init(char *); ** Global MailDelivery File */ extern char *maildelivery; - -/* -** Aliasing Facility (doesn't belong here) -*/ -extern int Everyone; -extern char *NoShell; diff --git a/man/mh-alias.man5 b/man/mh-alias.man5 index c8368be..597b155 100644 --- a/man/mh-alias.man5 +++ b/man/mh-alias.man5 @@ -100,15 +100,6 @@ added to the .I address\-list for the alias. .PP -If the -.I address\-group -is simply `*', then the file -.I /etc/passwd -is consulted and all login names with a userid -greater than some magic number (usually 200) are added to the -.I address\-list -for the alias. -.PP In match, a trailing \*(lq*\*(rq on an alias will match just about anything appropriate. (See example below.) .PP @@ -151,7 +142,6 @@ fred: frated@UCI UNIX\-committee: \*(rq are defined to be \*(lqnews\*(rq. .PP The key thing to understand about aliasing in @@ -253,6 +240,10 @@ ali(1), send(1), group(5), passwd(5), conflict(8), post(8) .SH CONTEXT None +.SH HISTORY +An address group named `*', meaning everyone on the system, had been +supported in nmh. It is not anymore in mmh. + .SH BUGS Although the forward-referencing semantics of .B mh\-alias diff --git a/man/mh-tailor.man5 b/man/mh-tailor.man5 index 265c3cf..7bb331b 100644 --- a/man/mh-tailor.man5 +++ b/man/mh-tailor.man5 @@ -113,21 +113,6 @@ file. See .BR slocal (1) for the details. -.RE -.PP -.BR everyone : -200 -.RS 5 -The highest user-id which should NOT receive mail addressed to -\*(lqeveryone\*(rq. -.RE -.PP -.BR noshell : -.RS 5 -If set, then each user-id greater than \*(lqeveryone\*(rq that has a -login shell equivalent to the given value (e.g., \*(lq/bin/csh\*(rq) -indicates that mail for \*(lqeveryone\*(rq should not be sent to them. -This is useful for handling admin, dummy, and guest logins. .SS "File Locking" A few words on locking: .B nmh diff --git a/sbr/mts.c b/sbr/mts.c index 2830bb7..ced0cf7 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -52,14 +52,6 @@ static char* masquerade = ""; */ char *maildelivery = NMHETCDIR"/maildelivery"; - -/* -** Aliasing Facility (doesn't belong here) -*/ -int Everyone = NOTOK; -static char *everyone = "-1"; -char *NoShell = ""; - /* ** Customize the MTS settings for nmh by adjusting ** the file mts.conf in the nmh etc directory. @@ -73,8 +65,6 @@ struct bind { static struct bind binds[] = { { "masquerade", &masquerade }, { "maildelivery", &maildelivery }, - { "everyone", &everyone }, - { "noshell", &NoShell }, { NULL, NULL } }; @@ -103,8 +93,6 @@ mts_init(char *name) fclose(fp); } - Everyone = atoi(everyone); - if (strstr(masquerade, "draft_from") != NULL) draft_from_masquerading = TRUE; diff --git a/uip/aliasbr.c b/uip/aliasbr.c index b9b32fa..073b1b2 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -39,7 +39,6 @@ static char *seekp(char *, char *, char **); static int addfile(struct aka *, char *); static int addgroup(struct aka *, char *); static int addmember(struct aka *, char *); -static int addall(struct aka *); static char *getalias(char *); static void add_aka(struct aka *, char *); static struct aka *akalloc(char *); @@ -115,11 +114,10 @@ aleq(char *string, char *aliasent) while ((c = *string++)) if (*aliasent == '*') return 1; + else if ((c | 040) != (*aliasent | 040)) + return 0; else - if ((c | 040) != (*aliasent | 040)) - return 0; - else - aliasent++; + aliasent++; return (*aliasent == 0 || *aliasent == '*'); } @@ -224,10 +222,6 @@ alias(char *file) } break; - case '*': /* Everyone */ - addall(ak); - break; - default: /* list */ while ((cp = getalias(pp))) add_aka(ak, cp); @@ -407,28 +401,6 @@ addmember(struct aka *ak, char *grp) } -static int -addall(struct aka *ak) -{ - int noshell = NoShell == NULL || *NoShell == 0; - register struct home *hm; - -#ifndef DBMPWD - if (homehead == NULL) -#endif /* DBMPWD */ - init_pw(); - if (Everyone < 0) - Everyone = EVERYONE; - - for (hm = homehead; hm; hm = hm->h_next) - if (hm->h_uid > Everyone && (noshell || - strcmp(hm->h_shell, NoShell)!=0)) - add_aka(ak, hm->h_name); - - return homehead != NULL; -} - - static char * getalias(char *addrs) { -- 1.7.10.4