+
+ /* Check if the user has access to all databases (Seb) */
+ /* You could argue that this should happen later, after we have
+ * determined that the database(s) exist. */
+ if (zh->dbaccesslist) {
+ for (i = 0; i < num_bases; i++) {
+ const char *db = basenames[i];
+ char *p, *pp;
+ for (p = zh->dbaccesslist; p && *p; p = pp) {
+ int len;
+ if ((pp = strchr(p, '+'))) {
+ len = pp - p;
+ pp++;
+ }
+ else
+ len = strlen(p);
+ if (len == strlen(db) && !strncmp(db, p, len))
+ break;
+ }
+ if (!p) {
+ zh->errCode = YAZ_BIB1_ACCESS_TO_SPECIFIED_DATABASE_DENIED;
+ return ZEBRA_FAIL;
+ }
+ }
+ }
+