]> diplodocus.org Git - nmh/commitdiff
Remove support for aliases based on Unix groups.
authorKen Hornstein <kenh@pobox.com>
Thu, 18 May 2017 18:03:09 +0000 (14:03 -0400)
committerKen Hornstein <kenh@pobox.com>
Thu, 18 May 2017 18:03:09 +0000 (14:03 -0400)
Remove support for expanding aliases based on group membership (=) and
all users who have a particular primary group (+).  This was the result
of a discussion on nmh-workers; these features were of dubious value, likely
not used, and interfered with RFC-2047 encoded names in alias files.

docs/pending-release-notes
man/mh-alias.man
uip/aliasbr.c

index 23cc77c09218ae14b7d8618d892a2a82a2319db6..98a9958dc0bbca98f634600a3302481abece691f 100644 (file)
@@ -83,6 +83,8 @@ OBSOLETE FEATURES
   deprecated in nmh 1.6, and was removed in this release.
 - Support for multiple hostnames in the "servers" entry of mts.conf has
   been removed.
   deprecated in nmh 1.6, and was removed in this release.
 - Support for multiple hostnames in the "servers" entry of mts.conf has
   been removed.
+- Support in alias files for expanding aliases based on group membership
+  (=) and primary group (+) has been removed.
 
 -------------------
 DEPRECATED FEATURES
 
 -------------------
 DEPRECATED FEATURES
index f3c63c7c264c919536b5b6aaae3a97c7e0f0589f..71fbe3d12660d619ab27ca6ae5f222a1740859ba 100644 (file)
@@ -42,8 +42,6 @@ where:
 .nf
 .IR address-group "    := " address-list
 .RI "                  |  < " file
 .nf
 .IR address-group "    := " address-list
 .RI "                  |  < " file
-.RI "                  |  = " Unix-group
-.RI "                  |  + " Unix-group
 
 .IR address-list "     := " address
 .RI "                  |  " address-list ", " address
 
 .IR address-list "     := " address
 .RI "                  |  " address-list ", " address
@@ -60,9 +58,6 @@ that comment line.
 and
 .I file
 are Unix file names.
 and
 .I file
 are Unix file names.
-.I Unix-group
-is a group name or number from
-the system's group database.
 Alias file contents are case-insensitive, with the exception
 of filesystem path names.
 .PP
 Alias file contents are case-insensitive, with the exception
 of filesystem path names.
 .PP
@@ -77,26 +72,6 @@ starts with a \*(lq<\*(rq, the file named after the
 .I address-list
 for the alias.
 .PP
 .I address-list
 for the alias.
 .PP
-If the
-.I address-group
-starts with an \*(lq=\*(rq, the
-system's group database
-is consulted for the Unix-group named after the \*(lq=\*(rq.  Each login name
-occurring as a member of the group is added to the
-.I address-list
-for the alias.
-.PP
-In contrast, if the
-.I address-group
-starts with a \*(lq+\*(rq, the system's group database
-is consulted to determine the group-id of the
-Unix-group named after the \*(lq+\*(rq.  Each login name occurring in the
-system's password database
-whose group-id is indicated by this group is
-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.
 .PP
 In match, a trailing \*(lq*\*(rq on an alias will match just about anything
 appropriate.
 .PP
@@ -132,8 +107,6 @@ sgroup: fred, fear, freida
 fred: frated@UCI.example
 b-people: Blind List: bill, betty
 Unix\-committee: <unix.aliases
 fred: frated@UCI.example
 b-people: Blind List: bill, betty
 Unix\-committee: <unix.aliases
-staff: =staff
-wheels: +wheel
 news.*: news
 .fi
 .RE
 news.*: news
 .fi
 .RE
@@ -161,13 +134,6 @@ in the user's
 .B nmh
 directory.
 .PP
 .B nmh
 directory.
 .PP
-\*(lqstaff\*(rq is defined as all users who are listed as members of the
-group \*(lqstaff\*(rq in the
-system's group database, and \*(lqwheels\*(rq
-is defined as all users whose group-id in
-the system's password database
-is equivalent to the \*(lqwheel\*(rq group.
-.PP
 Lastly,
 .RI \*(lqnews. anything \*(rq
 is aliased to \*(lqnews\*(rq;
 Lastly,
 .RI \*(lqnews. anything \*(rq
 is aliased to \*(lqnews\*(rq;
index ab2130efc18f470fda4f5f9f3cc196f531fb7669..b5add173a0ecc56ee5a492f4a5f001e87e17ef13 100644 (file)
@@ -9,7 +9,6 @@
 #include <h/aliasbr.h>
 #include <h/addrsbr.h>
 #include <h/utils.h>
 #include <h/aliasbr.h>
 #include <h/addrsbr.h>
 #include <h/utils.h>
-#include <grp.h>
 #include <pwd.h>
 
 static int akvis;
 #include <pwd.h>
 
 static int akvis;
@@ -37,8 +36,6 @@ static char *scanp (char *);
 static char *getp (char *);
 static char *seekp (char *, char *, char **);
 static int addfile (struct aka *, char *);
 static char *getp (char *);
 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 char *getalias (char *);
 static void add_aka (struct aka *, char *);
 static struct aka *akalloc (char *);
 static char *getalias (char *);
 static void add_aka (struct aka *, char *);
 static struct aka *akalloc (char *);
@@ -249,28 +246,6 @@ alias (char *file)
                }
                break;
 
                }
                break;
 
-           case '=':           /* UNIX group */
-               if (!*(cp = getp (pp + 1))) {
-                   fclose (fp);
-                   return AK_ERROR;
-               }
-               if (!addgroup (ak, cp)) {
-                   fclose (fp);
-                   return AK_NOGROUP;
-               }
-               break;
-
-           case '+':           /* UNIX group members */
-               if (!*(cp = getp (pp + 1))) {
-                   fclose (fp);
-                   return AK_ERROR;
-               }
-               if (!addmember (ak, cp)) {
-                   fclose (fp);
-                   return AK_NOGROUP;
-               }
-               break;
-
            default:            /* list */
                while ((cp = getalias (pp)))
                    add_aka (ak, cp);
            default:            /* list */
                while ((cp = getalias (pp)))
                    add_aka (ak, cp);
@@ -374,67 +349,6 @@ addfile (struct aka *ak, char *file)
 }
 
 
 }
 
 
-static int
-addgroup (struct aka *ak, char *grp)
-{
-    char *gp;
-    struct group *gr = getgrnam (grp);
-    struct home *hm = NULL;
-
-    if (!gr)
-       gr = getgrgid (atoi (grp));
-    if (!gr) {
-       akerrst = grp;
-       return 0;
-    }
-
-    while ((gp = *gr->gr_mem++))
-    {
-       struct passwd *pw;
-       for (hm = homehead; hm; hm = hm->h_next)
-           if (!strcmp (hm->h_name, gp)) {
-               add_aka (ak, hm->h_name);
-               break;
-           }
-        if ((pw = getpwnam(gp)))
-       {
-               hmalloc(pw);
-               add_aka (ak, gp);
-       }
-    }
-
-    return 1;
-}
-
-
-static int
-addmember (struct aka *ak, char *grp)
-{
-    gid_t gid;
-    struct group *gr = getgrnam (grp);
-    struct home *hm = NULL;
-
-    if (gr)
-       gid = gr->gr_gid;
-    else {
-       gid = atoi (grp);
-       gr = getgrgid (gid);
-    }
-    if (!gr) {
-       akerrst = grp;
-       return 0;
-    }
-
-    init_pw ();
-
-    for (hm = homehead; hm; hm = hm->h_next)
-       if (hm->h_gid == gid)
-           add_aka (ak, hm->h_name);
-
-    return 1;
-}
-
-
 static char *
 getalias (char *addrs)
 {
 static char *
 getalias (char *addrs)
 {