[1672] in Moira

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

zephyr class owners

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed Sep 20 15:37:00 2000

Message-Id: <200009201936.PAA09988@sweet-transvestite.mit.edu>
To: moiradev@MIT.EDU
Date: Wed, 20 Sep 2000 15:36:56 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	These are the server side changes necessary to implement an
owner for zephyr classes in moira.  The owner is allowed to gzcl and
uzcl.

Garry

Index: mr_server.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/mr_server.h,v
retrieving revision 1.54
diff -c -r1.54 mr_server.h
*** mr_server.h	2000/08/10 02:23:49	1.54
--- mr_server.h	2000/09/20 18:51:33
***************
*** 151,156 ****
--- 151,157 ----
  int access_ahal(struct query *q, char *argv[], client *cl);
  int access_snt(struct query *q, char *argv[], client *cl);
  int access_printer(struct query *q, char *argv[], client *cl);
+ int access_zephyr(struct query *q, char *argv[], client *cl);
  
  /* prototypes from qfollow.pc */
  int followup_fix_modby(struct query *q, struct save_queue *sq,
Index: qaccess.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qaccess.pc,v
retrieving revision 2.18
diff -c -r2.18 qaccess.pc
*** qaccess.pc	2000/08/10 02:23:49	2.18
--- qaccess.pc	2000/09/20 19:04:19
***************
*** 583,585 ****
--- 583,609 ----
    else
      return MR_PERM;
  }
+ 
+ /* access_zephyr */
+ int access_zephyr(struct query *q, char *argv[], client *cl)
+ {
+   EXEC SQL BEGIN DECLARE SECTION;
+   char type[ZEPHYR_OWNER_TYPE_SIZE];
+   char *class;
+   int id;
+   EXEC SQL END DECLARE SECTION;
+   int status;
+ 
+   class = argv[ZA_CLASS];
+   EXEC SQL SELECT owner_type, owner_id INTO :type, :id
+       FROM zephyr WHERE class = :class;
+   if (sqlca.sqlcode)
+     return MR_PERM;
+ 
+   status = find_member(type, id, cl);
+   if (status)
+     return MR_SUCCESS;
+   else
+     return MR_PERM;
+ }
+ 
Index: qfollow.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qfollow.pc,v
retrieving revision 2.18
diff -c -r2.18 qfollow.pc
*** qfollow.pc	2000/08/10 02:23:49	2.18
--- qfollow.pc	2000/09/20 19:07:45
***************
*** 893,899 ****
      {
        mr_trim_args(q->vcnt, argv);
  
!       for (i = 1; i < 8; i += 2)
  	{
  	  status = fix_ace(argv[i], &argv[i + 1]);
  	  if (status && status != MR_NO_MATCH)
--- 893,899 ----
      {
        mr_trim_args(q->vcnt, argv);
  
!       for (i = 1; i < 10; i += 2)
  	{
  	  status = fix_ace(argv[i], &argv[i + 1]);
  	  if (status && status != MR_NO_MATCH)
Index: queries2.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/queries2.c,v
retrieving revision 2.76
diff -c -r2.76 queries2.c
*** queries2.c	2000/08/25 00:46:14	2.76
--- queries2.c	2000/09/20 19:32:40
***************
*** 2340,2347 ****
  static char *gzcl_fields[] = {
    "class",
    "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
!   "iws_type", "iws_name", "iui_type", "iui_name",
!   "modtime", "modby", "modwith",
  };
  
  static struct validate gzcl_validate = {
--- 2340,2347 ----
  static char *gzcl_fields[] = {
    "class",
    "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
!   "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
!   "owner_id", "modtime", "modby", "modwith",
  };
  
  static struct validate gzcl_validate = {
***************
*** 2350,2364 ****
    0,
    0,
    0,
-   0,
    0,
    0,
    followup_gzcl,
  };
  
  static char *azcl_fields[] = {
    "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
!   "iws_type", "iws_name", "iui_type", "iui_name",
  };
  
  static struct valobj azcl_valobj[] = {
--- 2350,2365 ----
    0,
    0,
    0,
    0,
+   access_zephyr,
    0,
    followup_gzcl,
  };
  
  static char *azcl_fields[] = {
    "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
!   "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", 
!   "owner_id",
  };
  
  static struct valobj azcl_valobj[] = {
***************
*** 2371,2381 ****
    {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
    {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
    {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
  };
  
  static struct validate azcl_validate = {
    azcl_valobj,
!   9,
    "class",
    "class = '%s'",
    1,
--- 2372,2384 ----
    {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
    {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
    {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
+   {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
+   {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
  };
  
  static struct validate azcl_validate = {
    azcl_valobj,
!   11,
    "class",
    "class = '%s'",
    1,
***************
*** 2387,2393 ****
  
  static char *uzcl_fields[] = {
    "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
!   "iws_type", "iws_name", "iui_type", "iui_name",
  };
  
  static struct valobj uzcl_valobj[] = {
--- 2390,2396 ----
  
  static char *uzcl_fields[] = {
    "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
!   "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", "owner_id",
  };
  
  static struct valobj uzcl_valobj[] = {
***************
*** 2401,2416 ****
    {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
    {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
    {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
  };
  
  static struct validate uzcl_validate = {
    uzcl_valobj,
!   10,
    "class",
    "class = '%s'",
    1,
-   0,
    0,
    0,
    set_zephyr_modtime,
  };
--- 2404,2421 ----
    {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
    {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
    {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
+   {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+   {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
  };
  
  static struct validate uzcl_validate = {
    uzcl_valobj,
!   12,
    "class",
    "class = '%s'",
    1,
    0,
+   access_zephyr,
    0,
    set_zephyr_modtime,
  };
***************
*** 5360,5368 ****
      RETRIEVE,
      "z",
      ZEPHYR_TABLE,
!     "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
      gzcl_fields,
!     12,
      "class LIKE '%s'",
      1,
      "class",
--- 5365,5373 ----
      RETRIEVE,
      "z",
      ZEPHYR_TABLE,
!     "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
      gzcl_fields,
!     14,
      "class LIKE '%s'",
      1,
      "class",
***************
*** 5377,5385 ****
      APPEND,
      "z",
      ZEPHYR_TABLE,
!     "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
      azcl_fields,
!     9,
      0,
      0,
      NULL,
--- 5382,5390 ----
      APPEND,
      "z",
      ZEPHYR_TABLE,
!     "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
      azcl_fields,
!     11,
      0,
      0,
      NULL,
***************
*** 5394,5402 ****
      UPDATE,
      "z",
      ZEPHYR_TABLE,
!     "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d",
      uzcl_fields,
!     9,
      "class = '%s'",
      1,
      NULL,
--- 5399,5407 ----
      UPDATE,
      "z",
      ZEPHYR_TABLE,
!     "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d, owner_type = '%s', owner_id = %d",
      uzcl_fields,
!     11,
      "class = '%s'",
      1,
      NULL,

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