Changeset 2212


Ignore:
Timestamp:
2001-03-20T21:48:12+12:00 (23 years ago)
Author:
sjboddie
Message:

Fixed a bug that was causing the local library server to attempt to write
files to gsdlhome (i.e. the cd-rom drive if served from a cd) under certain
circumstances.

Location:
trunk/gsdl/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/browsefilter.cpp

    r1702 r2212  
    7070
    7171  // get the filename for the database and make sure it exists
    72   gdbm_filename = filename_cat(collectdir,"index","text",collection);
     72  gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", collection);
    7373
    7474  if (littleEndian()) gdbm_filename += ".ldb";
  • trunk/gsdl/src/colservr/filter.cpp

    r1285 r2212  
    4646    else if (key == "collectdir") collectdir = value;
    4747    else if (key == "gsdlhome") gsdlhome = value;
     48    else if (key == "gdbmhome") gdbmhome = value;
    4849    else if ((key == "filteroptdefault") && (cfgline.size() == 2)) {
    4950      // see if this filter has an option with this name
     
    6970  }
    7071
     72  if (gdbmhome.empty()) gdbmhome = gsdlhome;
     73 
    7174  // get the collection directory name
    7275  if (collectdir.empty()) {
  • trunk/gsdl/src/colservr/filter.h

    r1285 r2212  
    3636protected:
    3737  text_t gsdlhome;
     38  text_t gdbmhome;
    3839  text_t collection;
    3940  text_t collectdir;
  • trunk/gsdl/src/colservr/mggdbmsource.cpp

    r1459 r2212  
    7878  // get the collection directory name
    7979  if (collectdir.empty()) {
    80     collectdir = filename_cat (gdbmhome, "collect", collection);
     80    collectdir = filename_cat (gsdlhome, "collect", collection);
    8181  }
    8282 
    8383  // get the filename for the database and make sure it exists
    84   gdbm_filename = filename_cat(collectdir,"index","text",collection);
    85 
     84  gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", collection);
    8685  if (littleEndian()) gdbm_filename += ".ldb";
    8786  else gdbm_filename += ".bdb";
  • trunk/gsdl/src/colservr/queryfilter.cpp

    r1860 r2212  
    339339
    340340  // get the filename for the database and make sure it exists
    341   gdbm_filename = filename_cat(collectdir,"index","text",collection);
     341  gdbm_filename = filename_cat(gdbmhome, "collect", collection, "index", "text", collection);
    342342
    343343  if (littleEndian()) gdbm_filename += ".ldb";
  • trunk/gsdl/src/recpt/action.cpp

    r1285 r2212  
    4242// configure should be called once for each configuration line
    4343void action::configure (const text_t &key, const text_tarray &cfgline) {
    44   if (key == "gsdlhome") {gsdlhome = cfgline[0];}
     44  if (key == "gsdlhome") {
     45    gsdlhome = cfgline[0];
     46    if (gdbmhome.empty()) gdbmhome = cfgline[0];
     47  }
     48  if (key == "gdbmhome") {gdbmhome = cfgline[0];}
    4549}
    4650
  • trunk/gsdl/src/recpt/action.h

    r1285 r2212  
    4848  cgiargsinfoclass argsinfo;
    4949  text_t gsdlhome;
     50  text_t gdbmhome;
    5051
    5152public:
  • trunk/gsdl/src/recpt/authenaction.cpp

    r1796 r2212  
    131131    else if (key == "keyfile") keyfile = cfgline[0];
    132132    else if (key == "keydecay") keydecay = cfgline[0].getint();
    133     else if (key == "gsdlhome") {
    134       if (usersfile.empty())
    135     usersfile = filename_cat (cfgline[0], "etc", "users.db");
    136       if (keyfile.empty())
    137     keyfile = filename_cat (cfgline[0], "etc", "key.db");
    138     }
    139133  }
    140134
     
    143137
    144138bool authenaction::init (ostream &logout) {
     139
     140  if (gdbmhome.empty()) {
     141    logout << "ERROR (authenaction::init) gdbmhome is not set\n";
     142    return false;
     143  }
     144
     145  if (usersfile.empty()) usersfile = filename_cat (gdbmhome, "etc", "users.db");
     146  if (keyfile.empty()) keyfile = filename_cat (gdbmhome, "etc", "key.db");
     147
    145148  return action::init (logout);
    146149}
  • trunk/gsdl/src/recpt/nullproto.cpp

    r2173 r2212  
    7272  // the protocol should not configure the collection set; it should be
    7373  // done direct to the collection server set
    74   if (key == "gsdlhome") {
     74  if (key == "gsdlhome" || key == "gdbmhome") {
    7575    cset->configure(key, cfgline);
    7676  }
  • trunk/gsdl/src/recpt/queryaction.cpp

    r1915 r2212  
    735735    text_t userid = args["z"];
    736736    text_tarray entries;
    737     if (get_history_info (userid, entries, gsdlhome, logout)) {
     737    if (get_history_info (userid, entries, gdbmhome, logout)) {
    738738      int count = 1;
    739739      text_tarray::iterator here = entries.begin();
     
    13971397  int hd = args.getintarg("hd");
    13981398  if (hd > 0) display=true;
    1399   if (set_history_info(userid, query, gsdlhome, display)) return true;
     1399  if (set_history_info(userid, query, gdbmhome, display)) return true;
    14001400  else return false;
    14011401
  • trunk/gsdl/src/recpt/receptionist.cpp

    r2113 r2212  
    206206    cgiarginfo *info = NULL;
    207207    if (key == "gsdlhome") configinfo.gsdlhome = cfgline[0];
     208    else if (key == "gdbmhome") configinfo.gdbmhome = cfgline[0];
    208209    else if (key == "collection") {
    209210      configinfo.collection = cfgline[0];
     
    660661  }
    661662
    662   text_t logfile = filename_cat (configinfo.gsdlhome, "etc");
    663   logfile = filename_cat (logfile, "usage.txt");
     663  text_t logfile = filename_cat (configinfo.gdbmhome, "etc", "usage.txt");
    664664
    665665  text_t logstr = script_name;
  • trunk/gsdl/src/recpt/statusaction.cpp

    r2113 r2212  
    906906                   ostream &textout, ostream &/*logout*/) {
    907907
    908   text_t maincfgfile = filename_cat (gsdlhome, "etc", "main.cfg");
     908  text_t maincfgfile = filename_cat (gdbmhome, "etc", "main.cfg");
    909909
    910910  textout << outconvert << disp << "_status:infoheader_(main.cfg)\n"
  • trunk/gsdl/src/recpt/usersaction.cpp

    r1285 r2212  
    148148  if (cfgline.size() == 1) {
    149149    if (key == "usersfile") usersfile = cfgline[0];
    150     else if (key == "gsdlhome") {
    151       if (usersfile.empty())
    152     usersfile = filename_cat (cfgline[0], "etc", "users.db");
    153     }
    154150  }
    155151
    156152  action::configure (key, cfgline);
     153}
     154
     155bool usersaction::init (ostream &logout) {
     156
     157  if (gdbmhome.empty()) {
     158    logout << "ERROR (usersaction::init) gdbmhome is not set\n";
     159    return false;
     160  }
     161
     162  if (usersfile.empty()) usersfile = filename_cat (gdbmhome, "etc", "users.db");
     163
     164  return action::init (logout);
    157165}
    158166
  • trunk/gsdl/src/recpt/usersaction.h

    r1285 r2212  
    4242
    4343  void configure (const text_t &key, const text_tarray &cfgline);
     44
     45  bool init (ostream &logout);
    4446 
    4547  text_t get_action_name () {return "um";}
  • trunk/gsdl/src/w32server/cgiwrapper.cpp

    r1918 r2212  
    228228}
    229229
    230 static void page_errorparseargs (const text_t &gsdlhome) {
     230static void page_errorparseargs (const text_t &/*gsdlhome*/) {
    231231
    232232  text_t message = "Error\n\n"
     
    238238}
    239239
    240 static void page_errorcgipage (const text_t &gsdlhome) {
     240static void page_errorcgipage (const text_t &/*gsdlhome*/) {
    241241
    242242  text_t message = "Error\n\n"
     
    351351  // required to create a collection specific receptionist
    352352  text_t collection = "";
    353   text_tset gsdlhomes;
     353  text_tset gdbmhomes;
    354354  text_tset collections;
    355355
     
    371371    // collection specific receptionist - one collection, one gsdlhome
    372372    collections.insert (collection);
    373     gsdlhomes.insert (gsdl_gsdlhome);
     373    gdbmhomes.insert (gsdl_gdbmhome);
    374374    collectioninfo_t tmp;
    375375    tmp.gsdl_gsdlhome = gsdl_gsdlhome;
     
    387387    colinfo_tmap::const_iterator end_info = gsdl_collectinfo.end();
    388388    while (this_info != end_info) {
    389       if (gsdlhomes.find ((*this_info).second.gsdl_gsdlhome) == gsdlhomes.end()) {
     389      if (gdbmhomes.find ((*this_info).second.gsdl_gdbmhome) == gdbmhomes.end()) {
    390390    these_collections.erase (these_collections.begin(), these_collections.end());
    391391    read_dir (filename_cat ((*this_info).second.gsdl_gsdlhome, "collect"), these_collections);
     
    411411      colhere ++;
    412412    }
    413     gsdlhomes.insert ((*this_info).second.gsdl_gsdlhome);
     413    gdbmhomes.insert ((*this_info).second.gsdl_gdbmhome);
    414414      }
    415415      this_info ++;
    416416    }
    417417 
    418     // then if necessary the main gsdlhome (this should only happen if the
    419     // gsdl.ini is a little screwed up and no volume gsdlhomes occurred
    420     if (gsdlhomes.find (gsdl_gsdlhome) == gsdlhomes.end()) {
     418    // then if necessary the main gdbmhome (this should only happen if the
     419    // gsdl.ini is a little screwed up and no volume gdbmhomes occurred)
     420    if (gdbmhomes.find (gsdl_gdbmhome) == gdbmhomes.end()) {
    421421      these_collections.erase (these_collections.begin(), these_collections.end());
    422       read_dir (filename_cat (gsdl_gsdlhome, "collect"), these_collections);
     422      read_dir (filename_cat (gsdl_gdbmhome, "collect"), these_collections);
    423423      colhere = these_collections.begin();
    424424      colend = these_collections.end();
     
    431431    colhere ++;
    432432      }
    433       gsdlhomes.insert (gsdl_gsdlhome);
     433      gdbmhomes.insert (gsdl_gdbmhome);
    434434    }
    435435  }
     
    525525  // set defaults
    526526  recpt.configure ("gsdlhome", gsdl_gsdlhome);
     527  recpt.configure ("gdbmhome", gsdl_gdbmhome);
    527528  recpt.configure ("collection", collection);
    528529
     
    543544  }
    544545
    545   // read in config files of each gsdlhome (in no particular order)
     546  // read in config files of each gdbmhome (in no particular order)
    546547  // those read in last will override those read earlier
    547548  // collections being used together in this way should be
    548549  // careful not to have main.cfg files that might
    549550  // screw with each other.
    550   text_tset::const_iterator thome = gsdlhomes.begin();
    551   text_tset::const_iterator ehome = gsdlhomes.end();
     551  text_tset::const_iterator thome = gdbmhomes.begin();
     552  text_tset::const_iterator ehome = gdbmhomes.end();
    552553  while (thome != ehome) {
    553554    if (!main_cfg_read (recpt, *thome, collection)) {
Note: See TracChangeset for help on using the changeset viewer.