[1967] in Moira

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

Re: changes to moira container table and container related queries

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Jul 23 18:38:48 2002

Message-Id: <200207232238.SAA18408@riff-raff.mit.edu>
To: Qing Dong <dongq@MIT.EDU>
cc: moiradev@MIT.EDU, jcalz@MIT.EDU
In-Reply-To: Your message of "Wed, 10 Jul 2002 15:29:02 EDT."
             <5.1.0.14.2.20020710152253.00ac2108@hesiod> 
Date: Tue, 23 Jul 2002 18:38:44 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	Sorry for the delay in getting back to you on this.  The code
mostly looks good.  I found two problems, both of which I've fixed:

       - You renamed the old acon_validate to acon7_validate, but left
         the first memeber of the struct as acon_valobj; I made it
         acon7_valobj.

       - I had to fix followup_gcon to make it display the owner and
         memacl correctly for both old and new clients.

I also implemented support for the publicflg bit in the moira curses
client, which I've included below.  I haven't implemented the
set_container_list query (or whatever name we decided on) yet.  I'll
hopefully do that soon.

	The moirad currently running on ttsp has these changes in it;
you should feel free to test it.

Garry

Index: include/moira_site.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/include/moira_site.h,v
retrieving revision 1.45
diff -u -r1.45 moira_site.h
--- moira_site.h	2002/03/29 02:23:56	1.45
+++ moira_site.h	2002/07/23 22:01:56
@@ -418,17 +418,18 @@
 /* Container queries */
 
 #define CON_NAME        0
-#define CON_DESCRIPT    1
-#define CON_LOCATION    2
-#define CON_CONTACT     3
-#define CON_OWNER_TYPE  4
-#define CON_OWNER_NAME  5
-#define CON_MEMACE_TYPE 6
-#define CON_MEMACE_NAME 7
-#define CON_MODTIME     8
-#define CON_MODBY       9
-#define CON_MODWITH     10
-#define CON_END         11
+#define CON_PUBLIC      1
+#define CON_DESCRIPT    2
+#define CON_LOCATION    3
+#define CON_CONTACT     4
+#define CON_OWNER_TYPE  5
+#define CON_OWNER_NAME  6
+#define CON_MEMACE_TYPE 7
+#define CON_MEMACE_NAME 8
+#define CON_MODTIME     9
+#define CON_MODBY       10
+#define CON_MODWITH     11
+#define CON_END         12
 
 /* Directories & files used on the server machine: */
 
Index: clients/moira/cluster.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/cluster.c,v
retrieving revision 1.63
diff -u -r1.63 cluster.c
--- cluster.c	2002/03/20 12:55:43	1.63
+++ cluster.c	2002/07/23 22:22:43
@@ -169,6 +169,7 @@
 static char **SetContainerDefaults(char **info, char *name)
 {
   info[CON_NAME] = strdup(name);
+  info[CON_PUBLIC] = strdup(DEFAULT_NO);
   info[CON_DESCRIPT] = strdup(CON_DEFAULT_TYPE);
   info[CON_LOCATION] = strdup(CON_DEFAULT_TYPE);
   info[CON_CONTACT] = strdup(CON_DEFAULT_TYPE);
@@ -822,6 +823,9 @@
 	return NULL;
       break;
     case CONTAINER:
+      if (GetYesNoValueFromUser("Is this a public container", 
+				&info[CON_PUBLIC]) == SUB_ERROR)
+	return NULL;
       if (GetValueFromUser("Container's Description:", &info[CON_DESCRIPT]) ==
 	  SUB_ERROR)
 	return NULL;
@@ -2119,7 +2123,8 @@
   char buf[BUFSIZ], tbuf[256];
 
   Put_message("");
-  sprintf(buf, "Container:      %-16s", info[CON_NAME]);
+  sprintf(buf, "Container:      %-16s    Public:      %s", info[CON_NAME],
+	  atoi(info[CON_PUBLIC]) ? "Yes" : "No");
   Put_message(buf);
   sprintf(buf, "Description:    %-16s", info[CON_DESCRIPT]);
   Put_message(buf);
Index: clients/moira/defs.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/defs.h,v
retrieving revision 1.22
diff -u -r1.22 defs.h
--- defs.h	2001/09/13 02:31:23	1.22
+++ defs.h	2002/07/23 22:07:59
@@ -50,7 +50,7 @@
 
 /* What version of the queries are we asking for? */
 
-#define QUERY_VERSION 8
+#define QUERY_VERSION 9
 
 /* This is unimplemented in the menu stuff, but would be nice. */
 

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