]> andersk Git - moira.git/commitdiff
removed client list caching code
authormar <mar>
Thu, 31 Aug 1989 12:47:49 +0000 (12:47 +0000)
committermar <mar>
Thu, 31 Aug 1989 12:47:49 +0000 (12:47 +0000)
server/qrtn.qc
server/qsupport.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.
  */
index 61d0d680d88488fc2dc9e7d075bd43d536bb6920..5b95b7feefc3c1a9abbf546c11c0f9a3defa0280 100644 (file)
@@ -116,13 +116,6 @@ access_list(q, argv, cl)
          return(SMS_PERM);
     }
 
-    if (!strcmp(strtrim(acl_type), "LIST")) {
-       if (!client_is_member(cl, acl_id))
-         return(SMS_PERM);
-       else
-         return(SMS_SUCCESS);
-    }
-
     /* check for client in access control list */
     status = find_member(acl_type, acl_id, client_type, client_id, 0);
     if (!status) return(SMS_PERM);
@@ -158,13 +151,6 @@ access_visible_list(q, argv, cl)
        return(SMS_SUCCESS);
 
 
-    if (!strcmp(strtrim(acl_type), "LIST")) {
-       if (!client_is_member(cl, acl_id))
-         return(SMS_PERM);
-       else
-         return(SMS_SUCCESS);
-    }
-
     /* parse client structure */
     if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS)
        return(status);
@@ -206,13 +192,6 @@ access_vis_list_by_name(q, argv, cl)
     if (!flags)
        return(SMS_SUCCESS);
 
-    if (!strcmp(strtrim(acl_type), "LIST")) {
-       if (!client_is_member(cl, acl_id))
-         return(SMS_PERM);
-       else
-         return(SMS_SUCCESS);
-    }
-
     /* parse client structure */
     if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS)
        return(status);
@@ -284,13 +263,6 @@ access_service(q, argv, cl)
     if (rowcount > 1)
       return(SMS_PERM);
 
-    if (!strcmp(strtrim(acl_type), "LIST")) {
-       if (!client_is_member(cl, acl_id))
-         return(SMS_PERM);
-       else
-         return(SMS_SUCCESS);
-    }
-
     /* parse client structure */
     if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS)
        return(status);
@@ -327,10 +299,13 @@ access_filesys(q, argv, cl)
       return(SMS_PERM);
     if (users_id == cl->users_id)
       return(SMS_SUCCESS);
-    if (!client_is_member(cl, list_id))
-      return(SMS_PERM);
-    else
+    if ((status = get_client(cl, &client_type, &client_id)) != SMS_SUCCESS)
+      return(status);
+    status = find_member("LIST", list_id, client_type, client_id, 0);
+    if (status)
       return(SMS_SUCCESS);
+    else
+      return(SMS_PERM);
 ##}
 
     
This page took 0.038009 seconds and 5 git commands to generate.