]> andersk Git - moira.git/blobdiff - server/qrtn.qc
Used /bin/sh format instead of /bin/csh format, by accident.
[moira.git] / server / qrtn.qc
index 23ac1cecdf6012e61c3820b15f470e161a97a00c..55559c626555d00be4fd27b2f652293cf960b6a6 100644 (file)
@@ -15,12 +15,12 @@ static char *rcsid_qrtn_qc = "$Header$";
 
 #include <mit-copyright.h>
 #include "query.h"
-#include "sms_server.h"
+#include "mr_server.h"
 
 char *Argv[16];
 
 int ingres_errno = 0;
-int sms_errcode = 0;
+int mr_errcode = 0;
 ## int query_timeout = 30;
 extern char *whoami;
 extern FILE *journal;
@@ -29,6 +29,7 @@ extern FILE *journal;
 #define INGRES_BAD_DATE 4302
 #define INGRES_DEADLOCK 4700
 #define INGRES_TIMEOUT 4702
+#define INGRES_NO_RANGE 2109
 
 /*
  * ingerr: (supposedly) called when Ingres indicates an error.
@@ -43,42 +44,53 @@ static int ingerr(num)
 
     switch (*num) {
     case INGRES_BAD_INT:
-       sms_errcode = SMS_INTEGER;
+       mr_errcode = MR_INTEGER;
        break;
     case INGRES_BAD_DATE:
-       sms_errcode = SMS_DATE;
+       mr_errcode = MR_DATE;
        break;
     case INGRES_DEADLOCK:
-       sms_errcode = SMS_DEADLOCK;
+       mr_errcode = MR_DEADLOCK;
        com_err(whoami, 0, "INGRES deadlock detected");
        break;
     case INGRES_TIMEOUT:
-       sms_errcode = SMS_BUSY;
+       mr_errcode = MR_BUSY;
        com_err(whoami, 0, "timed out getting lock");
        break;
+    case INGRES_NO_RANGE:
+       mr_errcode = MR_INGRES_SOFTFAIL;
+       com_err(whoami, 0, "INGRES missing range statement");
+       break;
     default:
-       sms_errcode = SMS_INGRES_ERR;
-       com_err(whoami, SMS_INGRES_ERR, " code %d\n", *num);
-       critical_alert("SMS", "SMS server encountered INGRES ERROR %d", *num);
+       mr_errcode = MR_INGRES_ERR;
+       com_err(whoami, MR_INGRES_ERR, " code %d\n", *num);
+       critical_alert("MOIRA", "Moira server encountered INGRES ERROR %d", *num);
        return (*num);
     }
     return (0);
 }
 
-int sms_open_database()
+int mr_open_database()
 {
     register int i;
     char *malloc();
+    static first_open = 1;
+
+    if (first_open) {
+       first_open = 0;
 
-    /* initialize local argv */
-    for (i = 0; i < 16; i++)
-       Argv[i] = malloc(ARGLEN);
-    incremental_init();
+       /* initialize local argv */
+       for (i = 0; i < 16; i++)
+         Argv[i] = malloc(ARGLEN);
 
-    IIseterr(ingerr);
+       IIseterr(ingerr);
+       incremental_init();
+       flush_cache();
+    }
        
     ingres_errno = 0;
-       
+    mr_errcode = 0;
+
     /* open the database */
 ##  ingres sms
 ##  set lockmode session where level = table, timeout = query_timeout
@@ -87,12 +99,13 @@ int sms_open_database()
     return ingres_errno;
 }
 
-int sms_close_database()
+int mr_close_database()
 {
+    flush_cache();
 ##  exit
 }
 
-sms_check_access(cl, name, argc, argv_ro)
+mr_check_access(cl, name, argc, argv_ro)
     client *cl;
     char *name;
     int argc;
@@ -102,15 +115,16 @@ sms_check_access(cl, name, argc, argv_ro)
     struct query *get_query_by_name();
 
     ingres_errno = 0;
+    mr_errcode = 0;
 
-    q = get_query_by_name(name, cl->args->sms_version_no);
+    q = get_query_by_name(name, cl->args->mr_version_no);
     if (q == (struct query *)0)
-       return(SMS_NO_HANDLE);
+       return(MR_NO_HANDLE);
 
-    return(sms_verify_query(cl, q, argc, argv_ro));
+    return(mr_verify_query(cl, q, argc, argv_ro));
 }
 
-sms_process_query(cl, name, argc, argv_ro, action, actarg)
+mr_process_query(cl, name, argc, argv_ro, action, actarg)
     client *cl;
     char *name;
     int argc;
@@ -125,7 +139,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
     char sort[32];
     char *pqual;
     char *psort;
-##  char *table;
+##  char *table, *rvar;
     struct save_queue *sq;
     struct query *get_query_by_name();
     int sq_save_args();
@@ -133,26 +147,27 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
     char *build_sort();
 
     ingres_errno = 0;
+    mr_errcode = 0;
 
     /* list queries command */
     if (!strcmp(name, "_list_queries")) {
-       list_queries(cl->args->sms_version_no, action, actarg);
-       return(SMS_SUCCESS);
+       list_queries(cl->args->mr_version_no, action, actarg);
+       return(MR_SUCCESS);
     }
 
     /* help query command */
     if (!strcmp(name, "_help")) {
        if (argc < 1)
-           return(SMS_ARGS);
-       q = get_query_by_name(argv_ro[0], cl->args->sms_version_no);
-       if (q == (struct query *)0) return(SMS_NO_HANDLE);
+           return(MR_ARGS);
+       q = get_query_by_name(argv_ro[0], cl->args->mr_version_no);
+       if (q == (struct query *)0) return(MR_NO_HANDLE);
        help_query(q, action, actarg);
-       return(SMS_SUCCESS);
+       return(MR_SUCCESS);
     }
 
     /* get query structure, return error if named query does not exist */
-    q = get_query_by_name(name, cl->args->sms_version_no);
-    if (q == (struct query *)0) return(SMS_NO_HANDLE);
+    q = get_query_by_name(name, cl->args->mr_version_no);
+    if (q == (struct query *)0) return(MR_NO_HANDLE);
     v = q->validate;
 
     if (q->type != RETRIEVE) {
@@ -160,13 +175,13 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
     }
 
     /* setup argument vector, verify access and arguments */
-    if ((status = sms_verify_query(cl, q, argc, argv_ro)) != SMS_SUCCESS)
+    if ((status = mr_verify_query(cl, q, argc, argv_ro)) != MR_SUCCESS)
        goto out;
 
     /* perform any special query pre-processing */
     if (v && v->pre_rtn) {
        status = (*v->pre_rtn)(q, Argv, cl, 0);
-       if (status != SMS_SUCCESS)
+       if (status != MR_SUCCESS)
            goto out;
     }
 
@@ -176,7 +191,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
           uniquely exists */
        if (v && v->field) {
            status = validate_row(q, Argv, v);
-           if (status != SMS_EXISTS) break;
+           if (status != MR_EXISTS) break;
        }
 
        /* build "where" clause if needed */
@@ -201,7 +216,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
            if (v && v->post_rtn) {
                sq = sq_create();
                status = do_retrieve(q, pqual, psort, sq_save_args, sq);
-               if (status != SMS_SUCCESS) {
+               if (status != MR_SUCCESS) {
                    sq_destroy(sq);
                    break;
                }
@@ -210,7 +225,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
                /* normal retrieve */
                status = do_retrieve(q, pqual, psort, action, actarg);
            }
-           if (status != SMS_SUCCESS) break;
+           if (status != MR_SUCCESS) break;
        } else {
            status = (*v->post_rtn)(q, Argv, cl, action, actarg);
        }
@@ -221,7 +236,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
        /* see if row already exists */
        if (v->field) {
            status = validate_row(q, Argv, v);
-           if (status != SMS_EXISTS) break;
+           if (status != MR_EXISTS) break;
        }
 
        /* build "where" clause and perform update */
@@ -231,7 +246,8 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
            incremental_before(q->rtable, qual, argv_ro);
            status = do_update(q, &Argv[q->argc], qual, action, actarg);
            incremental_after(q->rtable, qual, argv_ro);
-           if (status != SMS_SUCCESS) break;
+           if (status != MR_SUCCESS) break;
+           flush_name(argv_ro[0], q->rtable);
            table = q->rtable;
            if (strcmp(q->shortname, "sshi") && strcmp(q->shortname, "ssif")) {
 ##             repeat replace tblstats (updates = tblstats.updates + 1,
@@ -249,13 +265,13 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
        /* see if row already exists */
        if (v->field) {
            status = validate_row(q, Argv, v);
-           if (status != SMS_NO_MATCH) break;
+           if (status != MR_NO_MATCH) break;
        }
 
        /* increment id number if necessary */
        if (v->object_id) {
            status = set_next_object_id(v->object_id, q->rtable);
-           if (status != SMS_SUCCESS) break;
+           if (status != MR_SUCCESS) break;
        }
 
        /* build "where" clause if needed */
@@ -271,7 +287,7 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
        if (q->rvar) {
            incremental_clear_before();
            status = do_append(q, &Argv[q->argc], pqual, action, actarg);
-           if (status != SMS_SUCCESS) break;
+           if (status != MR_SUCCESS) break;
            if (v && v->object_id) {
                sprintf(qual, "%s.%s = values.value and values.name = \"%s\"",
                        q->rvar, v->object_id, v->object_id);
@@ -293,18 +309,21 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
        /* see if row already exists */
        if (v->field) {
            status = validate_row(q, Argv, v);
-           if (status != SMS_EXISTS) break;
+           if (status != MR_EXISTS) break;
        }
 
        /* build "where" clause and perform delete */
        /* if q->rvar = NULL, perform post_rtn only */
        if (q->rvar) {
            build_qual(q->qual, q->argc, Argv, qual);
+           table = q->rtable;
+           rvar = q->rvar;
+##         range of rvar is table
            incremental_before(q->rtable, qual, argv_ro);
            status = do_delete(q, qual, action, actarg);
            incremental_clear_after();
-           if (status != SMS_SUCCESS) break;
-           table = q->rtable;
+           if (status != MR_SUCCESS) break;
+           flush_name(argv_ro[0], q->rtable);
 ##         repeat replace tblstats (deletes = tblstats.deletes + 1,
 ##                                  modtime = "now")
 ##             where tblstats.#table = @table
@@ -317,8 +336,14 @@ sms_process_query(cl, name, argc, argv_ro, action, actarg)
     }
 
 out:
+    if (status == MR_SUCCESS && ingres_errno != 0) {
+       com_err(whoami, MR_INTERNAL, "Server didn't notice INGRES ERROR %d",
+                      ingres_errno);
+       status = mr_errcode;
+    }
+
     if (q->type != RETRIEVE) {
-        if (status == SMS_SUCCESS) {
+        if (status == MR_SUCCESS) {
 ##          end transaction    /* commit to this */
            if (journal) {
                char buf[1024], *bp;
@@ -327,7 +352,7 @@ out:
 
                fprintf(journal, "%% %s %s %s",
                        cl->clname, cl->entity, ctime(&now));
-               fprintf(journal, "%s[%d] ", q->name, cl->args->sms_version_no);
+               fprintf(journal, "%s[%d] ", q->name, cl->args->mr_version_no);
                for (i = 0; i < argc; i++) {
                    if (i != 0) {
                        putc(' ', journal);
@@ -348,13 +373,7 @@ out:
 ##      set lockmode session where readlock = system
     }
 
-    if (status == SMS_SUCCESS && ingres_errno != 0) {
-       critical_alert("SMS", "Server didn't notice INGRES ERROR %d",
-                      ingres_errno);
-       status = SMS_INTERNAL;
-    }
-
-    if (status != SMS_SUCCESS && log_flags & LOG_RES)
+    if (status != MR_SUCCESS && log_flags & LOG_RES)
        com_err(whoami, status, " (Query failed)");
     return(status);
 }
@@ -373,13 +392,13 @@ build_qual(fmt, argc, argv, qual)
     c = fmt;
     for (i = 0; i < argc; i++) {
        c = index(c, '%');
-       if (c++ == (char *)0) return(SMS_ARGS);
+       if (c++ == (char *)0) return(MR_ARGS);
        if (*c == 's')
            args[i] = argv[i];
        else if (*c == 'd')
            *(int *)&args[i] = *(int *)argv[i]; /* sigh */
        else
-           return(SMS_INGRES_ERR);
+           return(MR_INGRES_ERR);
     }
 
     switch (argc) {
@@ -403,7 +422,7 @@ build_qual(fmt, argc, argv, qual)
        sprintf(qual, fmt, args[0], args[1], args[2], args[3]);
        break;
     }
-    return(SMS_SUCCESS);
+    return(MR_SUCCESS);
 }
 
 char *
@@ -434,7 +453,7 @@ build_sort(v, sort)
 
 /* Build arguement vector, verify query and arguments */
 
-sms_verify_query(cl, q, argc, argv_ro)
+mr_verify_query(cl, q, argc, argv_ro)
     client *cl;
     struct query *q;
     int argc;
@@ -449,44 +468,44 @@ sms_verify_query(cl, q, argc, argv_ro)
 
     /* copy the arguments into a local argv that we can modify */
     if (argc >= QMAXARGS)
-      return(SMS_ARGS);
+      return(MR_ARGS);
     for (i = 0; i < argc; i++) {
        if ((len = strlen(argv_ro[i])) < ARGLEN)
            strcpy(Argv[i], argv_ro[i]);
        else
-           return(SMS_ARG_TOO_LONG);
+           return(MR_ARG_TOO_LONG);
        if (Argv[i][len-1] == '\\')
-         return(SMS_BAD_CHAR);
+         return(MR_BAD_CHAR);
     }
 
     /* check initial query access */
     status = check_query_access(q, Argv, cl);
-    if (status != SMS_SUCCESS && status != SMS_PERM)
+    if (status != MR_SUCCESS && status != MR_PERM)
        return(status);
-    if (status == SMS_SUCCESS)
+    if (status == MR_SUCCESS)
        privileged++;
 
     /* check argument count */
     argreq = q->argc;
     if (q->type == UPDATE || q->type == APPEND) argreq += q->vcnt;
-    if (argc != argreq) return(SMS_ARGS);
+    if (argc != argreq) return(MR_ARGS);
 
     /* validate arguments */
     if (v && v->valobj) {
        status = validate_fields(q, Argv, v->valobj, v->objcnt);
-       if (status != SMS_SUCCESS) return(status);
+       if (status != MR_SUCCESS) return(status);
     }
 
     /* perform special query access check */
     if (!privileged && v && v->acs_rtn) {
        status = (*v->acs_rtn)(q, Argv, cl);
-       if (status != SMS_SUCCESS && status != SMS_PERM)
+       if (status != MR_SUCCESS && status != MR_PERM)
            return(status);
-       if (status == SMS_SUCCESS)
+       if (status == MR_SUCCESS)
            privileged++;
     }
 
-    return(privileged ? SMS_SUCCESS : SMS_PERM);
+    return(privileged ? MR_SUCCESS : MR_PERM);
 }
 
 
@@ -519,59 +538,32 @@ check_query_access(q, argv, cl)
       acl_id = q->acl;
     else {
        name = q->shortname;
-##     repeat retrieve (acl_id = capacls.list_id) where capacls.tag = @name
+##     retrieve (acl_id = capacls.list_id) where capacls.tag = name
 ##     inquire_equel (rowcount = "rowcount", errorno = "errorno")
-       if (errorno != 0) return(SMS_INGRES_ERR);
-       if (rowcount == 0) return(SMS_PERM);
+       if (errorno != 0) return(MR_INGRES_ERR);
+       if (rowcount == 0) return(MR_PERM);
        q->acl = acl_id;
 
        /* check for default access */
-##     repeat retrieve (exists = any(imembers.#member_id where
-##                                   imembers.list_id = @acl_id and
-##                                   imembers.member_type = "USER" and
-##                                   imembers.#member_id = def_uid))
+##     retrieve (exists = any(imembers.#member_id where
+##                            imembers.list_id = acl_id and
+##                            imembers.member_type = "USER" and
+##                            imembers.#member_id = def_uid))
        q->everybody = exists;
     }
 
     if (q->everybody)
-      return(SMS_SUCCESS);
+      return(MR_SUCCESS);
 
-    if (client_is_member(cl, acl_id))
-      return(SMS_SUCCESS);
+    if (get_client(cl, &client_type, &client_id) != MR_SUCCESS)
+      return(MR_PERM);
+    if (find_member("LIST", acl_id, client_type, client_id, 0))
+      return(MR_SUCCESS);
     else
-      return(SMS_PERM);
+      return(MR_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;
@@ -580,16 +572,16 @@ get_client(cl, client_type, client_id)
     if (cl->users_id > 0) {
        *client_id = cl->users_id;
        *client_type = "USER";
-       return(SMS_SUCCESS);
+       return(MR_SUCCESS);
     }
 
     if (cl->client_id < 0) {
        *client_id = -cl->users_id;
        *client_type = "KERBEROS";
-       return(SMS_SUCCESS);
+       return(MR_SUCCESS);
     }
 
-    return(SMS_PERM);
+    return(MR_PERM);
 }
 
 ##find_member(list_type, list_id, member_type, member_id)
@@ -636,12 +628,12 @@ do_retrieve(q, pqual, psort, action, actarg)
        register int i;
 
        if ((vaddrs = (char **)malloc(sizeof(char *) * QMAXARGS)) == NULL) {
-           com_err(whoami, SMS_NO_MEM, "setting up static argv");
+           com_err(whoami, MR_NO_MEM, "setting up static argv");
            exit(1);
        }
        for (i = 0; i < QMAXARGS; i++) {
            if ((vaddrs[i] = malloc(QMAXARGSIZE)) == NULL) {
-               com_err(whoami, SMS_NO_MEM, "setting up static argv");
+               com_err(whoami, MR_NO_MEM, "setting up static argv");
                exit(1);
            }
        }
@@ -685,9 +677,9 @@ do_retrieve(q, pqual, psort, action, actarg)
        }
     }
 
-##  inquire_equel (rowcount = "rowcount", errorno = "errorno")
-    if (errorno != 0) return(SMS_INGRES_ERR);
-    return ((rowcount == 0) ? SMS_NO_MATCH : SMS_SUCCESS);
+    if (mr_errcode) return(mr_errcode);
+##  inquire_equel (rowcount = "rowcount")
+    return ((rowcount == 0) ? MR_NO_MATCH : MR_SUCCESS);
 ##}
 
 do_update(q, argv, qual, action, actarg)
@@ -710,12 +702,8 @@ do_update(q, argv, qual, action, actarg)
 ##  replace rvar (param (q->tlist, argv))
 ##  where cqual
 
-##  inquire_equel (errorno = "errorno")
-    if (errorno == INGRES_BAD_INT)
-       return(SMS_INTEGER);
-    else if (errorno != 0)
-       return(SMS_INGRES_ERR);
-    return(SMS_SUCCESS);
+    if (mr_errcode) return(mr_errcode);
+    return(MR_SUCCESS);
 ##}
 
 do_append(q, argv, pqual, action, actarg)
@@ -741,12 +729,8 @@ do_append(q, argv, pqual, action, actarg)
 ##      append to rtable (param (q->tlist, argv))
     }
 
-##  inquire_equel (errorno = "errorno")
-    if (errorno == INGRES_BAD_INT)
-       return(SMS_INTEGER);
-    else if (errorno != 0)
-       return(SMS_INGRES_ERR);
-    return(SMS_SUCCESS);
+    if (mr_errcode) return(mr_errcode);
+    return(MR_SUCCESS);
 ##}
 
 do_delete(q, qual, action, actarg)
@@ -767,9 +751,8 @@ do_delete(q, qual, action, actarg)
     cqual = qual;
 ##  delete rvar where cqual
 
-##  inquire_equel (errorno = "errorno")
-    if (errorno != 0) return(SMS_INGRES_ERR);
-    return(SMS_SUCCESS);
+    if (mr_errcode) return(mr_errcode);
+    return(MR_SUCCESS);
 ##}
 
 
@@ -793,16 +776,15 @@ set_next_object_id(object, table)
 
     name = object;
     tbl = table;
-##  range of v is values
-##  repeat retrieve (value = v.#value) where v.#name = @name
+##  repeat retrieve (value = values.#value) where values.#name = @name
 ##  inquire_equel(rowcount = "rowcount")
     if (rowcount != 1)
-       return(SMS_NO_ID);
+       return(MR_NO_ID);
 
 ##  retrieve (exists = any(tbl.name where tbl.name = value))
 ##  inquire_equel(rowcount = "rowcount")
     if (rowcount != 1)
-       return(SMS_NO_ID);
+       return(MR_NO_ID);
     while (exists) {
        value++;
        if (value > MAX_ID_VALUE)
@@ -812,31 +794,8 @@ set_next_object_id(object, table)
 
     if (LOG_RES)
         com_err(whoami, 0, "setting ID %s to %d", name, value);
-##  repeat replace v (#value = @value) where v.#name = @name
-    return(SMS_SUCCESS);
-##}
-
-
-/* This looks up a login name and returns the SMS internal ID.  It is used
- * by authenticate to put the users_id in the client structure.
- */
-
-int get_users_id(name)
-char *name;
-##{
-##  int id, rowcount;
-##  char *login;
-
-    login = name;
-
-##  range of u is users
-##  repeat retrieve (id = u.#users_id) where u.#login = @login
-##  inquire_equel (rowcount = "rowcount")
-    
-    if (rowcount == 1)
-       return(id);
-    else
-       return(0);
+##  repeat replace values (#value = @value) where values.#name = @name
+    return(MR_SUCCESS);
 ##}
 
 
@@ -844,7 +803,7 @@ char *name;
  * owns.  Sets the kerberos ID and user ID.
  */
 
-set_krb_mapping(name, login, ok, kid, uid)
+int set_krb_mapping(name, login, ok, kid, uid)
 char *name;
 char *login;
 int ok;
@@ -858,69 +817,32 @@ int *uid;
     *kid = 0;
     *uid = 0;
 
-##  range of k is krbmap
-##  range of s is strings
-##  repeat retrieve (u_id = k.#users_id, k_id = k.#string_id)
-##     where k.string_id = s.string_id and s.string = @krbname
+##  repeat retrieve (u_id = krbmap.#users_id, k_id = krbmap.#string_id)
+##     where krbmap.string_id = strings.string_id and strings.string = @krbname
 ##  inquire_equel (rowcount = "rowcount")
+    if (ingres_errno) return(mr_errcode);
     
     if (rowcount == 1) {
        *kid = -k_id;
        *uid = u_id;
-       return;
+       return(MR_SUCCESS);
     }
 
-##  repeat retrieve (k_id = s.#string_id) where s.string = @krbname
-##  inquire_equel (rowcount = "rowcount")
-
-    if (rowcount == 1) {
-       *kid = -k_id;
-    }
+    if (name_to_id(name, "STRINGS", &k_id) == MR_SUCCESS)
+      *kid = -k_id;
 
     if (!ok) {
        *uid = *kid;
-       return;
+       return(MR_SUCCESS);
     }
 
-    *uid = get_users_id(login);
+    if (name_to_id(login, "USERS", uid) != MR_SUCCESS)
+      *uid = 0;
+
     if (*kid == 0)
       *kid = *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;
+    if (ingres_errno) return(mr_errcode);
+    return(MR_SUCCESS);
 ##}
 
 
This page took 0.070176 seconds and 4 git commands to generate.