| 231 | ACL_USER(THD *, const LEX_USER &, const Account_options &, const privilege_t); |
| 232 | |
| 233 | ACL_USER *copy(MEM_ROOT *root) |
| 234 | { |
| 235 | ACL_USER *dst; |
| 236 | AUTH *dauth; |
| 237 | if (!multi_alloc_root(root, &dst, sizeof(ACL_USER), |
| 238 | &dauth, sizeof(AUTH)*nauth, NULL)) |
| 239 | return 0; |
| 240 | *dst= *this; |
| 241 | dst->user= safe_lexcstrdup_root(root, user); |
| 242 | dst->ssl_cipher= safe_strdup_root(root, ssl_cipher); |
| 243 | dst->x509_issuer= safe_strdup_root(root, x509_issuer); |
| 244 | dst->x509_subject= safe_strdup_root(root, x509_subject); |
| 245 | dst->auth= dauth; |
| 246 | for (uint i=0; i < nauth; i++, dauth++) |
| 247 | { |
| 248 | if (auth[i].plugin.str == native_password_plugin_name.str || |
| 249 | auth[i].plugin.str == old_password_plugin_name.str) |
| 250 | dauth->plugin= auth[i].plugin; |
| 251 | else |
| 252 | dauth->plugin= safe_lexcstrdup_root(root, auth[i].plugin); |
| 253 | dauth->auth_string= safe_lexcstrdup_root(root, auth[i].auth_string); |
| 254 | if (auth[i].salt.length == 0) |
| 255 | dauth->salt= auth[i].salt; |
| 256 | else |
| 257 | dauth->salt= safe_lexcstrdup_root(root, auth[i].salt); |
| 258 | } |
| 259 | dst->host.hostname= safe_strdup_root(root, host.hostname); |
| 260 | dst->default_rolename= safe_lexcstrdup_root(root, default_rolename); |
| 261 | bzero(&dst->role_grants, sizeof(role_grants)); |
| 262 | return dst; |
| 263 | } |
| 264 | |
| 265 | bool wild_eq(const char *user2, const char *host2, const char *ip2) |
| 266 | { |
no test coverage detected