@@ -6666,7 +6666,9 @@ struct my_option my_long_options[]=
66666666 " names at once (in 'datadir') and is normally the only option you need "
66676667 " for specifying log files. Sets names for --log-bin, --log-bin-index, "
66686668 " --relay-log, --relay-log-index, --general-log-file, "
6669- " --log-slow-query-file, --log-error-file, and --pid-file" ,
6669+ " --log-slow-query-file, --log-error-file, and --pid-file. "
6670+ " If log-basename includes a path, the path will apply for all above "
6671+ " variables except pid-file that will use it without the path" ,
66706672 &opt_log_basename, &opt_log_basename, 0 , GET_STR, REQUIRED_ARG,
66716673 0 , 0 , 0 , 0 , 0 , 0 },
66726674 {" log-bin" , OPT_BIN_LOG,
@@ -8161,10 +8163,12 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
81618163 case (int ) OPT_LOG_BASENAME:
81628164 {
81638165 if (opt_log_basename[0 ] == 0 || strchr (opt_log_basename, FN_EXTCHAR) ||
8164- strchr (opt_log_basename,FN_LIBCHAR) ||
8166+ ! my_basename (opt_log_basename)[ 0 ] ||
81658167 !is_filename_allowed (opt_log_basename, strlen (opt_log_basename), FALSE ))
81668168 {
8167- sql_print_error (" Wrong argument for --log-basename. It can't be empty or contain '.' or '" FN_DIRSEP " '. It must be valid filename." );
8169+ sql_print_error (" Wrong argument for --log-basename. It can't be empty, "
8170+ " contain '.' or be a directory name'. "
8171+ " It must be valid filename." );
81688172 return 1 ;
81698173 }
81708174 if (log_error_file_ptr != disabled_my_option)
@@ -8198,7 +8202,8 @@ mysqld_get_one_option(const struct my_option *opt, const char *argument,
81988202 {
81998203 SYSVAR_AUTOSIZE (pidfile_name_ptr, pidfile_name);
82008204 /* PID file */
8201- strmake (pidfile_name, argument, sizeof (pidfile_name)-5 );
8205+ strmake (pidfile_name, my_basename (opt_log_basename),
8206+ sizeof (pidfile_name)-5 );
82028207 strmov (fn_ext (pidfile_name)," .pid" );
82038208 }
82048209 break ;
0 commit comments