[1562] in Moira

home help back first fref pref prev next nref lref last post

access_list() fixes

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed May 31 20:47:10 2000

Message-Id: <200006010047.UAA24655@sweet-transvestite.mit.edu>
To: moiradev@MIT.EDU
Date: Wed, 31 May 2000 20:47:05 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	Having people take names in the grouper namespace would sort of
suck; mostly for them, because we would merrily stomp on them.  This
prevents people from renaming lists to those names.  People with the
bits to alis are assumed to not be stupid.

        It was also pointed out to me today that creating owner-foo
listnames as moira lists can cause all sorts of interesting behavior in
the aliases file, so lets prevent people not on the capacl from renaming
lists to those, too.

Garry

Index: qaccess.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qaccess.pc,v
retrieving revision 2.15
diff -c -r2.15 qaccess.pc
*** qaccess.pc	2000/03/29 20:07:17	2.15
--- qaccess.pc	2000/06/01 00:36:55
***************
*** 166,172 ****
--- 166,195 ----
  	  if (gid != atoi(argv[7]))
  	    return MR_PERM;
  	}
+ 
        newname = argv[1];
+ 
+       if (!strcmp("ulis", q->shortname))
+ 	  {
+ 	    /* Check that it doesn't conflict with the Grouper namespace. */
+ 	    if (strlen(newname) > 4 && isdigit(newname[2]) && 
+ 		isdigit(newname[3]) && newname[4] == '-')
+ 	      {
+ 		if (!strncasecmp(newname, "fa", 2) ||
+ 		    !strncasecmp(newname, "sp", 2) ||
+ 		    !strncasecmp(newname, "su", 2) ||
+ 		    !strncasecmp(newname, "ja", 2))
+ 		  return MR_RESERVED;
+ 	      }
+ 
+ 	    /* Don't let anyone take owner-foo list names.  They interact 
+ 	     * weirdly with the aliases automatically generated by 
+ 	     * mailhub.gen.
+ 	     */
+ 	    if (!strncasecmp(newname, "owner-", 6))
+ 	      return MR_RESERVED;
+ 	  }
+ 
        EXEC SQL SELECT users_id INTO :users_id FROM users
  	WHERE login = :newname;
        if ((sqlca.sqlcode != SQL_NO_MATCH) && strcmp(strtrim(name), newname) &&
Index: qsupport.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qsupport.pc,v
retrieving revision 2.23
diff -c -r2.23 qsupport.pc
*** qsupport.pc	2000/03/30 22:01:56	2.23
--- qsupport.pc	2000/05/31 23:18:56
***************
*** 87,93 ****
        /* If going from SMTP or NONE to SPLIT, make sure we have a valid
         * POP or IMAP box.
         */
!       if (!strcmp(potype, "SMTP") || !strcmp(potype, "NONE"))
  	{
  	  status = set_pobox_pop(q, argv, cl);
  	  if (status)
--- 87,94 ----
        /* If going from SMTP or NONE to SPLIT, make sure we have a valid
         * POP or IMAP box.
         */
!       if ((!strcmp(potype, "SMTP") || !strcmp(potype, "NONE")) && 
! 	   !strcmp(argv[1], "SPLIT"))
  	{
  	  status = set_pobox_pop(q, argv, cl);
  	  if (status)

Index: mr_et.et
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/lib/mr_et.et,v
retrieving revision 1.23
diff -c -r1.23 mr_et.et
*** mr_et.et	2000/05/24 04:27:02	1.23
--- mr_et.et	2000/06/01 00:11:00
***************
*** 216,219 ****
--- 216,222 ----
  ec	MR_VERSION_HIGH,
  	"Client query version is newer than server"
  
+ ec	MR_RESERVED,
+ 	"That name is reserved"
+ 
  	end

home help back first fref pref prev next nref lref last post