[604] in Moira

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

Improve membership editing of afs.incr

daemon@ATHENA.MIT.EDU (Richard Basch)
Wed May 5 11:43:31 1993

Date: Wed, 5 May 1993 11:43:17 -0400
To: bug-moira@MIT.EDU
From: "Richard Basch" <basch@MIT.EDU>


The following are what I believe would be required to improve the
membership editing by the afs.incr backend...  Basically, rather than
just passing the group flags, I am passing all of the list's attributes.

-Richard

*** /tmp/,RCSt1WWwCSd	Wed May  5 11:41:12 1993
--- server/increment.dc	Wed May  5 11:40:30 1993
***************
*** 188,195 ****
  	beforec = 10;
      } else if (!strcmp(table, "members")) {
  	id = (int) argv[0];
! 	EXEC SQL SELECT CHAR(grouplist) INTO :barg3 FROM list 
! 	  WHERE list_id = :id;
  	name = malloc(0);
  	id_to_name(id, "LIST", &name);
  	strcpy(barg0, name);
--- 188,197 ----
  	beforec = 10;
      } else if (!strcmp(table, "members")) {
  	id = (int) argv[0];
! 	EXEC SQL SELECT CHAR(active), CHAR(publicflg), CHAR(hidden),
! 	    CHAR(maillist), CHAR(grouplist), CHAR(gid)
! 	  INTO :barg3, :barg4, :barg5, :barg6, :barg7, :barg8
! 	  FROM list WHERE list_id = :id;
  	name = malloc(0);
  	id_to_name(id, "LIST", &name);
  	strcpy(barg0, name);
***************
*** 206,212 ****
  	}
  	strcpy(barg2, name);
  	free(name);
! 	beforec = 4;
      } /* else
        com_err(whoami, 0, "unknown table in incremental_before"); */
  }
--- 208,214 ----
  	}
  	strcpy(barg2, name);
  	free(name);
! 	beforec = 9;
      } /* else
        com_err(whoami, 0, "unknown table in incremental_before"); */
  }
***************
*** 302,309 ****
  	afterc = 10;
      } else if (!strcmp(table, "members")) {
  	id = (int) argv[0];
! 	EXEC SQL SELECT CHAR(grouplist) INTO :aarg3 FROM list
! 	  WHERE list_id = :id;
  	name = malloc(0);
  	id_to_name(id, "LIST", &name);
  	strcpy(aarg0, name);
--- 304,313 ----
  	afterc = 10;
      } else if (!strcmp(table, "members")) {
  	id = (int) argv[0];
! 	EXEC SQL SELECT CHAR(active), CHAR(publicflg), CHAR(hidden),
! 	    CHAR(maillist), CHAR(grouplist), CHAR(gid)
! 	  INTO :aarg3, :aarg4, :aarg5, :aarg6, :aarg7, :aarg8
! 	  FROM list WHERE list_id = :id;
  	name = malloc(0);
  	id_to_name(id, "LIST", &name);
  	strcpy(aarg0, name);
***************
*** 320,326 ****
  	}
  	strcpy(aarg2, name);
  	free(name);
! 	afterc = 4;
      } else if (!strcmp(table, "clear")) {
  	afterc = 0;
  	table = beforetable;
--- 324,330 ----
  	}
  	strcpy(aarg2, name);
  	free(name);
! 	afterc = 9;
      } else if (!strcmp(table, "clear")) {
  	afterc = 0;
  	table = beforetable;
*** /tmp/,RCSt1WWwFXz	Wed May  5 11:41:12 1993
--- incremental/afs.c	Wed May  5 11:35:11 1993
***************
*** 340,354 ****
  {
      int code;
      char *p;
-     
-     if ((beforec < 4 || !atoi(before[LM_END])) &&
- 	(afterc < 4 || !atoi(after[LM_END])))
- 	return;
  
!     if (afterc)
  	edit_group(1, after[LM_LIST], after[LM_TYPE], after[LM_MEMBER]);
!     if (beforec)
  	edit_group(0, before[LM_LIST], before[LM_TYPE], before[LM_MEMBER]);
  }
  
  
--- 340,378 ----
  {
      int code;
      char *p;
  
! #define LM_EXTRA_ACTIVE (LM_END)
! #define LM_EXTRA_PUBLIC (LM_END+1)
! #define LM_EXTRA_HIDDEN (LM_END+2)
! #define LM_EXTRA_MAILLIST (LM_END+3)
! #define LM_EXTRA_GROUP  (LM_END+4)
! #define LM_EXTRA_GID    (LM_END+5)
! #define LM_EXTRA_END    (LM_END+6)
! 
! #define LM_EXTRA_OLD_GROUP (LM_END)
! #define LM_EXTRA_OLD_END   (LM_END+1)
! 
!     if (afterc) {
! 	if (afterc < LM_EXTRA_OLD_END) {
! 	    return;
! 	} else if (afterc < LM_EXTRA_END) {
! 	    if (!atoi(after[LM_EXTRA_OLD_GROUP])) return;
! 	} else
! 	    if (!atoi(after[LM_EXTRA_ACTIVE]) && !atoi(after[LM_EXTRA_GROUP]))
! 		return;
! 	
  	edit_group(1, after[LM_LIST], after[LM_TYPE], after[LM_MEMBER]);
!     } else if (beforec) {
! 	if (beforec < LM_EXTRA_OLD_END) {
! 	    return;
! 	} else if (beforec < LM_EXTRA_END) {
! 	    if (!atoi(before[LM_EXTRA_OLD_GROUP])) return;
! 	} else
! 	    if (!atoi(before[LM_EXTRA_ACTIVE]) && !atoi(before[LM_EXTRA_GROUP]))
! 		return;
! 	
  	edit_group(0, before[LM_LIST], before[LM_TYPE], before[LM_MEMBER]);
+     }
  }
  
  

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