[2052] in Moira

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

ghst with all wild cards.

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Thu Dec 4 15:43:27 2003

Message-Id: <200312042043.hB4KhNBJ028319@brad-majors.mit.edu>
To: moiradev@MIT.EDU
Date: Thu, 04 Dec 2003 15:43:23 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>

A ghst with 4 wildcard arguments will never succeed, but we still allow
people on the query acl to perform the query.  This moves the check from
the access function to a new setup function for ghst, thus applying it
to all users.

Sent here since it might be vaguely controversial.

Garry

Index: mr_server.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/mr_server.h,v
retrieving revision 1.60
diff -u -r1.60 mr_server.h
--- mr_server.h	14 Aug 2003 02:43:55 -0000	1.60
+++ mr_server.h	4 Dec 2003 20:36:32 -0000
@@ -235,6 +235,7 @@
 int setup_dqot(struct query *q, char *argv[], client *cl);
 int setup_asnt(struct query *q, char *argv[], client *cl);
 int setup_dsnt(struct query *q, char *argv[], client *cl);
+int setup_ghst(struct query *q, char *argv[], client *cl);
 int setup_ahst(struct query *q, char *argv[], client *cl);
 int setup_ahal(struct query *q, char *argv[], client *cl);
 int setup_uhha(struct query *q, char *argv[], client *cl);
Index: qaccess.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qaccess.pc,v
retrieving revision 2.30
diff -u -r2.30 qaccess.pc
--- qaccess.pc	22 May 2003 17:03:55 -0000	2.30
+++ qaccess.pc	4 Dec 2003 20:37:43 -0000
@@ -486,15 +486,6 @@
   else
     idx = 2;
   
-  if (q->type == RETRIEVE)
-    {
-      if (strcmp(argv[0], "*") || strcmp(argv[1], "*") ||
-	  strcmp(argv[2], "*") || strcmp(argv[3], "*"))
-	return MR_SUCCESS;
-      else
-	return MR_PERM;
-    }
-
   if (q->type == APPEND)
     {
       /* Non-query owner must set use to zero */
Index: qsetup.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qsetup.pc,v
retrieving revision 2.56
diff -u -r2.56 qsetup.pc
--- qsetup.pc	14 May 2003 13:07:36 -0000	2.56
+++ qsetup.pc	4 Dec 2003 20:37:26 -0000
@@ -1055,6 +1055,18 @@
 }
 
 
+/* setup_ghst():
+ */
+
+int setup_ghst(struct query *q, char **argv, client *cl)
+{
+  if (strcmp(argv[0], "*") || strcmp(argv[1], "*") ||
+      strcmp(argv[2], "*") || strcmp(argv[3], "*"))
+    return MR_SUCCESS;
+  else
+    return MR_PERM;
+}
+
 /* setup_ahst():
  */
 
Index: queries2.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/queries2.c,v
retrieving revision 2.99
diff -u -r2.99 queries2.c
--- queries2.c	20 Oct 2003 19:42:10 -0000	2.99
+++ queries2.c	4 Dec 2003 20:35:05 -0000
@@ -1028,7 +1028,7 @@
   0,
   0,
   access_host,
-  0,
+  setup_ghst,
   followup_ghst,
 };
 

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