~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Monty Taylor
  • Date: 2010-10-02 22:34:03 UTC
  • mto: (1819.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1820.
  • Revision ID: mordred@inaugust.com-20101002223403-58mvwhhtb33la6jc
Made secure_file_priv be an fs::path from the beginning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
plugin::StorageEngine *heap_engine;
233
233
plugin::StorageEngine *myisam_engine;
234
234
 
235
 
char* opt_secure_file_priv= 0;
236
 
 
237
235
bool calling_initgroups= false; /**< Used in SIGSEGV handler. */
238
236
 
239
237
uint32_t drizzled_bind_timeout;
290
288
 
291
289
fs::path basedir(PREFIX);
292
290
fs::path pid_file;
 
291
fs::path secure_file_priv("");
 
292
 
293
293
char system_time_zone[30];
294
294
char *default_tz_name;
295
295
char glob_hostname[FN_REFLEN];
516
516
  module::Registry &modules= module::Registry::singleton();
517
517
  modules.shutdownModules();
518
518
  xid_cache_free();
519
 
  if (opt_secure_file_priv)
520
 
    free(opt_secure_file_priv);
521
519
 
522
520
  deinit_temporal_formats();
523
521
 
1287
1285
  N_("Pid file used by drizzled."))
1288
1286
  ("port-open-timeout", po::value<uint32_t>(&drizzled_bind_timeout)->default_value(0),
1289
1287
  N_("Maximum time in seconds to wait for the port to become free. "))
1290
 
  ("secure-file-priv", po::value<string>(),
 
1288
  ("secure-file-priv", po::value<fs::path>(&secure_file_priv),
1291
1289
  N_("Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files "
1292
1290
     "within specified directory"))
1293
1291
  ("server-id", po::value<uint32_t>(&server_id)->default_value(0),
1827
1825
  {"secure-file-priv", OPT_SECURE_FILE_PRIV,
1828
1826
   N_("Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files "
1829
1827
      "within specified directory"),
1830
 
   (char**) &opt_secure_file_priv, (char**) &opt_secure_file_priv, 0,
 
1828
   NULL, NULL, 0,
1831
1829
   GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1832
1830
  {"server-id", OPT_SERVER_ID,
1833
1831
   N_("Uniquely identifies the server instance in the community of "
2126
2124
{
2127
2125
  /* Things reset to zero */
2128
2126
  opt_tc_log_file= (char *)"tc.log";      // no hostname in tc_log file name !
2129
 
  opt_secure_file_priv= 0;
2130
2127
  cleanup_done= 0;
2131
2128
  dropping_tables= ha_open_options=0;
2132
2129
  test_flags.reset();
2365
2362
    }
2366
2363
  }
2367
2364
 
2368
 
  /*
2369
 
    Convert the secure-file-priv option to system format, allowing
2370
 
    a quick strcmp to check if read or write is in an allowed dir
2371
 
   */
2372
 
  if (vm.count("secure-file-priv"))
2373
 
  {
2374
 
    char buff[FN_REFLEN];
2375
 
 
2376
 
    internal::convert_dirname(buff, vm["secure-file-priv"].as<string>().c_str(), NULL);
2377
 
    free(opt_secure_file_priv);
2378
 
    opt_secure_file_priv= strdup(buff);
2379
 
    if (opt_secure_file_priv == NULL)
2380
 
      exit(1);
2381
 
  }
2382
2365
}
2383
2366
 
2384
2367
} /* namespace drizzled */