From: Mike Taylor Date: Wed, 18 Jan 2006 13:56:12 +0000 (+0000) Subject: The special database name "*" is now recognised for scan as well as search. X-Git-Tag: YP2.0.0.2~11 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=108dc332d3b07180c7d5bc10cdddd187f732b3b1;p=metaproxy-moved-to-github.git The special database name "*" is now recognised for scan as well as search. The special target name "*" is also now recognised. --- diff --git a/src/filter_auth_simple.cpp b/src/filter_auth_simple.cpp index 7d94e19..f570c95 100644 --- a/src/filter_auth_simple.cpp +++ b/src/filter_auth_simple.cpp @@ -1,4 +1,4 @@ -/* $Id: filter_auth_simple.cpp,v 1.13 2006-01-18 13:32:59 mike Exp $ +/* $Id: filter_auth_simple.cpp,v 1.14 2006-01-18 13:56:12 mike Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -288,7 +288,8 @@ void yf::AuthSimple::process_scan(yp2::Package &package) const std::string user = m_p->userBySession[package.session()]; yf::AuthSimple::Rep::PasswordAndDBs pdb = m_p->userRegister[user]; for (int i = 0; i < req->num_databaseNames; i++) { - if (!contains(pdb.dbs, req->databaseNames[i])) { + if (!contains(pdb.dbs, req->databaseNames[i]) && + !contains(pdb.dbs, "*")) { // Make an Scan rejection APDU yp2::odr odr; Z_APDU *apdu = odr.create_scanResponse( @@ -341,7 +342,8 @@ void yf::AuthSimple::check_targets(yp2::Package & package) const std::list::const_iterator i; for (i = targets.begin(); i != targets.end(); i++) { printf("checking target '%s'\n", (*i).c_str()); - if (!contains(authorisedTargets, *i)) { + if (!contains(authorisedTargets, *i) && + !contains(authorisedTargets, "*")) { // ### check whether to quietly discard this target, or to reject return reject_init(package, YAZ_BIB1_ACCESS_TO_SPECIFIED_DATABASE_DENIED,