~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

  • Committer: Monty Taylor
  • Date: 2010-06-25 04:57:18 UTC
  • mfrom: (1637.2.5 build)
  • mto: This revision was merged to the branch mainline in revision 1639.
  • Revision ID: mordred@inaugust.com-20100625045718-135ct9m6axucrw2t
Merged in syslog changes from Mark and client program_options fixes from
Vijay.

Show diffs side-by-side

added added

removed removed

Lines of Context:
986
986
 
987
987
 
988
988
    po::variables_map vm;
989
 
    po::store(po::parse_command_line(argc,argv,long_options),vm);
 
989
    po::store(po::command_line_parser(argc, argv).options(long_options).
 
990
            extra_parser(parse_password_arg).run(), vm);
990
991
 
991
992
    ifstream user_slap_ifs("~/.drizzle/drizzleslap.cnf");
992
993
    po::store(parse_config_file(user_slap_ifs, slap_options), vm);
1033
1034
      }
1034
1035
    }
1035
1036
 
1036
 
    if( vm.count("password") )
 
1037
  if( vm.count("password") )
 
1038
  {
 
1039
    if (!opt_password.empty())
 
1040
      opt_password.erase();
 
1041
    if (password == PASSWORD_SENTINEL)
1037
1042
    {
1038
 
      char *start= vm["password"].as<char *>();
1039
 
      if (!opt_password.empty())
1040
 
        opt_password.erase();
1041
 
      opt_password = strdup(vm["password"].as<char *>());
1042
 
      if (opt_password.c_str() == NULL)
1043
 
      {
1044
 
        fprintf(stderr, "Memory allocation error while copying password. "
1045
 
            "Aborting.\n");
1046
 
        exit(ENOMEM);
1047
 
      }
1048
 
 
1049
 
      while (*password)
1050
 
      {
1051
 
        /* Overwriting password with 'x' */
1052
 
        *password++= 'x';
1053
 
      }
1054
 
 
1055
 
      if (*start)
1056
 
      {
1057
 
        /* Cut length of argument */
1058
 
        start[1]= 0;
1059
 
      }
1060
 
      tty_password= 0;
 
1043
      opt_password= "";
1061
1044
    }
1062
1045
    else
1063
 
      tty_password= 1;
 
1046
    {
 
1047
      opt_password= password;
 
1048
      tty_password= false;
 
1049
    }
 
1050
  }
 
1051
  else
 
1052
  {
 
1053
      tty_password= true;
 
1054
  }
 
1055
 
1064
1056
 
1065
1057
 
1066
1058
    if( vm.count("version") )