| 76 | } |
| 77 | |
| 78 | static const char *authz_dbd_prepare(cmd_parms *cmd, void *cfg, |
| 79 | const char *query) |
| 80 | { |
| 81 | static unsigned int label_num = 0; |
| 82 | char *label; |
| 83 | const char *err = ap_check_cmd_context(cmd, NOT_IN_HTACCESS); |
| 84 | if (err) |
| 85 | return err; |
| 86 | |
| 87 | if (dbd_prepare == NULL) { |
| 88 | dbd_prepare = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_prepare); |
| 89 | if (dbd_prepare == NULL) { |
| 90 | return "You must load mod_dbd to enable AuthzDBD functions"; |
| 91 | } |
| 92 | dbd_handle = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_acquire); |
| 93 | } |
| 94 | label = apr_psprintf(cmd->pool, "authz_dbd_%d", ++label_num); |
| 95 | |
| 96 | dbd_prepare(cmd->server, query, label); |
| 97 | |
| 98 | /* save the label here for our own use */ |
| 99 | return ap_set_string_slot(cmd, cfg, label); |
| 100 | } |
| 101 | |
| 102 | static const command_rec authz_dbd_cmds[] = { |
| 103 | AP_INIT_FLAG("AuthzDBDLoginToReferer", ap_set_flag_slot, |
nothing calls this directly
no test coverage detected