#include "options.h"
#include "priv.h"
#include <my_sys.h>
#include <my_getopt.h>
#include <m_string.h>
#include <mysql_com.h>
Go to the source code of this file.
Defines | |
| #define | QUOTE(x) QUOTE2(x) |
| #define | QUOTE2(x) #x |
Enumerations | |
| enum | options { OPT_LOG = 256, OPT_PID_FILE, OPT_SOCKET, OPT_PASSWORD_FILE, OPT_MYSQLD_PATH, OPT_RUN_AS_SERVICE, OPT_USER, OPT_MONITORING_INTERVAL, OPT_PORT, OPT_BIND_ADDRESS } |
Functions | |
| static C_MODE_START my_bool | get_one_option (int optid, const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused))) |
| static void | passwd () |
| static void | usage () |
| static void | version () |
Variables | |
| static const char * | default_groups [] = { "manager", 0 } |
| static struct my_option | my_long_options [] |
|
|
Definition at line 31 of file options.cc. |
|
|
Definition at line 30 of file options.cc. |
|
|
Definition at line 52 of file options.cc. 00052 { 00053 OPT_LOG= 256, 00054 OPT_PID_FILE, 00055 OPT_SOCKET, 00056 OPT_PASSWORD_FILE, 00057 OPT_MYSQLD_PATH, 00058 OPT_RUN_AS_SERVICE, 00059 OPT_USER, 00060 OPT_MONITORING_INTERVAL, 00061 OPT_PORT, 00062 OPT_BIND_ADDRESS 00063 };
|
|
||||||||||||||||
|
Definition at line 185 of file options.cc. References exit, passwd, usage, and version(). 00188 { 00189 switch(optid) { 00190 case 'V': 00191 version(); 00192 exit(0); 00193 case 'P': 00194 passwd(); 00195 exit(0); 00196 case '?': 00197 usage(); 00198 exit(0); 00199 } 00200 return 0; 00201 }
|
|
|
Definition at line 151 of file options.cc. References get_tty_password(), make_scrambled_password(), p, SCRAMBLED_PASSWORD_CHAR_LENGTH, strchr(), and user. 00152 { 00153 char user[1024], *p; 00154 const char *pw1, *pw2; 00155 char pw1msg[]= "Enter password: "; 00156 char pw2msg[]= "Re-type password: "; 00157 char crypted_pw[SCRAMBLED_PASSWORD_CHAR_LENGTH + 1]; 00158 00159 fprintf(stderr, "Creating record for new user.\n"); 00160 fprintf(stderr, "Enter user name: "); 00161 if (!fgets(user, sizeof(user), stdin)) 00162 { 00163 fprintf(stderr, "Unable to read user.\n"); 00164 return; 00165 } 00166 if ((p= strchr(user, '\n'))) *p= 0; 00167 00168 pw1= get_tty_password(pw1msg); 00169 pw2= get_tty_password(pw2msg); 00170 00171 if (strcmp(pw1, pw2)) 00172 { 00173 fprintf(stderr, "Sorry, passwords do not match.\n"); 00174 return; 00175 } 00176 00177 make_scrambled_password(crypted_pw, pw1); 00178 printf("%s:%s\n", user, crypted_pw); 00179 }
|
|
|
Definition at line 136 of file options.cc. References default_groups, my_print_help(), my_print_variables(), my_progname, print_defaults(), and version(). 00137 { 00138 version(); 00139 00140 printf("Copyright (C) 2003, 2004 MySQL AB\n" 00141 "This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n" 00142 "and you are welcome to modify and redistribute it under the GPL license\n"); 00143 printf("Usage: %s [OPTIONS] \n", my_progname); 00144 00145 my_print_help(my_long_options); 00146 print_defaults("my", default_groups); 00147 my_print_variables(my_long_options); 00148 }
|
|
|
|
Definition at line 133 of file options.cc. Referenced by Options::load(), and usage(). |
|
|
Definition at line 65 of file options.cc. |
1.4.3