X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/87081d5b285c2bafee44817eb70d41bd295880c4..6e442c4594b9e7db2c90b3dcc7e3b13b09c5ed15:/server/qrtn.pc diff --git a/server/qrtn.pc b/server/qrtn.pc index cfcd0226..bdb16f16 100644 --- a/server/qrtn.pc +++ b/server/qrtn.pc @@ -44,7 +44,7 @@ extern int QueryCount, max_version; extern struct query Queries[]; /* Put this in a variable so that we can patch it if necessary */ -int max_row_count = 4096; +int max_row_count = 8192; int mr_verify_query(client *cl, struct query *q, int argc, char *argv_ro[]); int do_retrieve(struct query *q, char *pqual, @@ -425,7 +425,8 @@ char *build_qual(char *fmt_buf, int argc, char *argv[]) while (*fmt) { - if (!like && !arg) + + if ((!like && !arg) || argc == 0) { /* only plain text remains */ strcpy(res, fmt); @@ -558,20 +559,16 @@ int mr_verify_query(client *cl, struct query *q, int argc, char *argv_ro[]) if (*fr) return MR_ARG_TOO_LONG; *to = '\0'; - - if (to > Argv[i] && *--to == '\\') - return MR_BAD_CHAR; } - /* check initial query access, unless we're acting as a proxy */ - if (!cl->proxy_id) - { - status = check_query_access(q, Argv, cl); - if (status != MR_SUCCESS && status != MR_PERM) - return status; - if (status == MR_SUCCESS) - privileged++; - } + /* Check initial query access. If we're acting as a proxy, only allow + * access if the query has "default" as a capacl. + */ + status = check_query_access(q, Argv, cl); + if (status != MR_SUCCESS && status != MR_PERM) + return status; + if (status == MR_SUCCESS && (!cl->proxy_id || q->everybody)) + privileged++; /* validate arguments */ if (v && v->valobj) @@ -1010,6 +1007,10 @@ int name_to_id(char *name, enum tables type, int *id) } EXEC SQL SELECT string_id INTO :j FROM strings WHERE string = :iname; break; + case CONTAINERS_TABLE: + EXEC SQL SELECT cnt_id INTO :j FROM containers WHERE LOWER(name) = + LOWER(:iname); + break; default: return MR_INTERNAL; } @@ -1064,6 +1065,9 @@ int id_to_name(int id, enum tables type, char **name) case STRINGS_TABLE: EXEC SQL SELECT string INTO :iname FROM strings WHERE string_id = :j; break; + case CONTAINERS_TABLE: + EXEC SQL SELECT name INTO :iname FROM containers WHERE cnt_id = :j; + break; default: return MR_INTERNAL; }