| 10201 | extern "C" { |
| 10202 | |
| 10203 | int path_starts_from_data_home_dir(const char *path) |
| 10204 | { |
| 10205 | size_t dir_len= strlen(path); |
| 10206 | DBUG_ENTER("path_starts_from_data_home_dir"); |
| 10207 | |
| 10208 | if (mysql_unpacked_real_data_home_len<= dir_len) |
| 10209 | { |
| 10210 | if (dir_len > mysql_unpacked_real_data_home_len && |
| 10211 | path[mysql_unpacked_real_data_home_len] != FN_LIBCHAR) |
| 10212 | DBUG_RETURN(0); |
| 10213 | |
| 10214 | if (lower_case_file_system) |
| 10215 | { |
| 10216 | if (!default_charset_info->strnncoll(path, |
| 10217 | mysql_unpacked_real_data_home_len, |
| 10218 | mysql_unpacked_real_data_home, |
| 10219 | mysql_unpacked_real_data_home_len)) |
| 10220 | { |
| 10221 | DBUG_PRINT("error", ("Path is part of mysql_real_data_home")); |
| 10222 | DBUG_RETURN(1); |
| 10223 | } |
| 10224 | } |
| 10225 | else if (!memcmp(path, mysql_unpacked_real_data_home, |
| 10226 | mysql_unpacked_real_data_home_len)) |
| 10227 | { |
| 10228 | DBUG_PRINT("error", ("Path is part of mysql_real_data_home")); |
| 10229 | DBUG_RETURN(1); |
| 10230 | } |
| 10231 | } |
| 10232 | DBUG_RETURN(0); |
| 10233 | } |
| 10234 | |
| 10235 | } |
| 10236 | |