~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.cc

  • Committer: Monty Taylor
  • Date: 2010-06-26 03:52:47 UTC
  • mfrom: (1637.1.5 staging)
  • Revision ID: mordred@inaugust.com-20100626035247-i0iq4sd6wqzfisyy
Merged in staging changes: Mark's syslog patch and vijay's program_options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
469
469
  system_config_dir_client.append("/drizzle/client.cnf");
470
470
  
471
471
  po::variables_map vm;
472
 
  po::store(po::command_line_parser(argc, argv).options(long_options).run(), vm);
 
472
  po::store(po::command_line_parser(argc, argv).options(long_options).
 
473
            extra_parser(parse_password_arg).run(), vm);
473
474
 
474
475
  ifstream user_import_ifs("~/.drizzle/drizzleimport.cnf");
475
476
  po::store(parse_config_file(user_import_ifs, import_options), vm);
498
499
    }
499
500
  }
500
501
 
501
 
  if (vm.count("password"))
 
502
  if( vm.count("password") )
502
503
  {
503
504
    if (!opt_password.empty())
504
505
      opt_password.erase();
505
 
    opt_password= password;
506
 
    if (opt_password.c_str() == NULL)
507
 
    {
508
 
      fprintf(stderr, _("Memory allocation error while copying password. "
509
 
                        "Aborting.\n"));
510
 
      exit(EXIT_OUT_OF_MEMORY);
511
 
    }
512
 
    char *start= (char *)password.c_str();
513
 
    char *temp_pass= (char *)password.c_str();
514
 
    while (*temp_pass)
515
 
    {
516
 
        /* Overwriting password with 'x' */
517
 
        *temp_pass++= 'x';
518
 
    }
519
 
    if (*start)
520
 
    {
521
 
      start[1]= 0;
 
506
    if (password == PASSWORD_SENTINEL)
 
507
    {
 
508
      opt_password= "";
 
509
    }
 
510
    else
 
511
    {
 
512
      opt_password= password;
 
513
      tty_password= false;
522
514
    }
523
515
  }
524
516
  else
526
518
      tty_password= true;
527
519
  }
528
520
 
 
521
 
529
522
  if (vm.count("version"))
530
523
  {
531
524
    printf("%s  Ver %s Distrib %s, for %s-%s (%s)\n" ,internal::my_progname,