]> andersk Git - moira.git/blobdiff - server/qrtn.qc
removed client list caching code
[moira.git] / server / qrtn.qc
index 23ac1cecdf6012e61c3820b15f470e161a97a00c..a709f57a02bc81085169a4264e48acd92daab7d5 100644 (file)
@@ -536,42 +536,15 @@ check_query_access(q, argv, cl)
     if (q->everybody)
       return(SMS_SUCCESS);
 
-    if (client_is_member(cl, acl_id))
+    if (get_client(cl, &client_type, &client_id) != SMS_SUCCESS)
+      return(SMS_PERM);
+    if (find_member("LIST", acl_id, client_type, client_id, 0))
       return(SMS_SUCCESS);
     else
       return(SMS_PERM);
 ##}
 
 
-/* If this client has cached list information, use that.  Otherwise, 
- * use the general get_client & find_member routines to determine if
- * the user is a member of the list.
- */
-
-int client_is_member(cl, id)
-client *cl;
-int id;
-{
-    char *client_type;
-    int client_id, status;
-
-    if (cl->lists[0]) {
-       register int i;
-       for (i = 0; cl->lists[i] && i < NLISTS; i++)
-         if (cl->lists[i] == id)
-           return(1);
-       return(0);
-    }
-
-    /* parse client name */
-    if (get_client(cl, &client_type, &client_id) != SMS_SUCCESS)
-      return(0);
-
-    /* see if client is in the list (or any of its sub-lists) */
-    return(find_member("LIST", id, client_type, client_id, 0));
-}
-
-
 get_client(cl, client_type, client_id)
     client *cl;
     char **client_type;
@@ -888,42 +861,6 @@ int *uid;
 ##}
 
 
-/* Cache the lists that the client is a member of.  These will be used
- * to speed up access checking later.
- */
-
-set_client_lists(cl)
-client *cl;
-##{
-##  int lid, mid;
-##  char *type;
-    int count = 0;
-
-    cl->lists[count] = 0;
-    if (cl->users_id != 0) {
-       type = "USER";
-       mid = cl->users_id;
-    } else if (cl->client_id != 0) {
-       type = "KERBEROS";
-       mid = -cl->client_id;
-    } else
-      return;
-
-##  range of m is members
-##  repeat retrieve (lid = m.list_id) where m.member_type = @type and 
-##     m.member_id = @mid {
-           cl->lists[count++] = lid;
-           if (count >= NLISTS)
-##           endretrieve
-##  }
-    if (count >= NLISTS) {
-       cl->lists[0] = 0;
-       com_err(whoami, 0, "too many lists to cache");
-    } else
-      cl->lists[count] = 0;
-##}
-
-
 /* For now this just checks the argc's.  It should also see that there
  * are no duplicate names.
  */
This page took 0.032489 seconds and 4 git commands to generate.