| 59 | } |
| 60 | |
| 61 | static const char *authn_dbd_prepare(cmd_parms *cmd, void *cfg, const char *query) |
| 62 | { |
| 63 | static unsigned int label_num = 0; |
| 64 | char *label; |
| 65 | const char *err = ap_check_cmd_context(cmd, NOT_IN_HTACCESS); |
| 66 | if (err) |
| 67 | return err; |
| 68 | |
| 69 | if (authn_dbd_prepare_fn == NULL) { |
| 70 | authn_dbd_prepare_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_prepare); |
| 71 | if (authn_dbd_prepare_fn == NULL) { |
| 72 | return "You must load mod_dbd to enable AuthDBD functions"; |
| 73 | } |
| 74 | authn_dbd_acquire_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_acquire); |
| 75 | } |
| 76 | label = apr_psprintf(cmd->pool, "authn_dbd_%d", ++label_num); |
| 77 | |
| 78 | authn_dbd_prepare_fn(cmd->server, query, label); |
| 79 | |
| 80 | /* save the label here for our own use */ |
| 81 | return ap_set_string_slot(cmd, cfg, label); |
| 82 | } |
| 83 | |
| 84 | static const command_rec authn_dbd_cmds[] = |
| 85 | { |
nothing calls this directly
no test coverage detected