From: mar Date: Thu, 31 Aug 1989 12:47:49 +0000 (+0000) Subject: removed client list caching code X-Git-Tag: ASRSNAP1001~57 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/db8a5dda59c0acfb07ce258bb8dad169290801ab removed client list caching code --- diff --git a/server/qrtn.qc b/server/qrtn.qc index 23ac1cec..a709f57a 100644 --- a/server/qrtn.qc +++ b/server/qrtn.qc @@ -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. */ diff --git a/server/qsupport.qc b/server/qsupport.qc index 61d0d680..5b95b7fe 100644 --- a/server/qsupport.qc +++ b/server/qsupport.qc @@ -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); ##}