Lines 1108-1114
Link Here
|
1108 |
return NULL; |
1108 |
return NULL; |
1109 |
|
1109 |
|
1110 |
username = (char *) mr->data; |
1110 |
username = (char *) mr->data; |
1111 |
|
|
|
1112 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, "='", username, "'", NULL); |
1111 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, "='", username, "'", NULL); |
1113 |
|
1112 |
|
1114 |
sql_log(DEBUG_WARN, "cache miss for user '%s'", realname); |
1113 |
sql_log(DEBUG_WARN, "cache miss for user '%s'", realname); |
Lines 1133-1139
Link Here
|
1133 |
} |
1132 |
} |
1134 |
|
1133 |
|
1135 |
if (!cmap.usercustom) { |
1134 |
if (!cmap.usercustom) { |
1136 |
where = sql_prepare_where(0, cmd, 2, usrwhere, cmap.userwhere, NULL); |
1135 |
where = sql_prepare_where(SQL_PREPARE_WHERE_FL_NO_TAGS, cmd, 2, usrwhere, |
|
|
1136 |
sql_prepare_where(0, cmd, 1, cmap.userwhere, NULL), NULL); |
1137 |
|
1137 |
|
1138 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 5, "default", |
1138 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 5, "default", |
1139 |
cmap.usrtable, cmap.usrfields, where, "1"), "sql_select"); |
1139 |
cmap.usrtable, cmap.usrfields, where, "1"), "sql_select"); |
Lines 1372-1378
Link Here
|
1372 |
return NULL; |
1372 |
return NULL; |
1373 |
} |
1373 |
} |
1374 |
|
1374 |
|
1375 |
where = sql_prepare_where(0, cmd, 2, grpwhere, cmap.groupwhere, NULL); |
1375 |
where = sql_prepare_where(SQL_PREPARE_WHERE_FL_NO_TAGS, cmd, 2, grpwhere, |
|
|
1376 |
sql_prepare_where(0, cmd, 1, cmap.groupwhere, NULL), NULL); |
1376 |
|
1377 |
|
1377 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 5, "default", |
1378 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 5, "default", |
1378 |
cmap.grptable, cmap.grpfield, where, "1"), "sql_select"); |
1379 |
cmap.grptable, cmap.grpfield, where, "1"), "sql_select"); |
Lines 1391-1397
Link Here
|
1391 |
grpwhere = pstrcat(cmd->tmp_pool, cmap.grpfield, " = '", groupname, "'", |
1392 |
grpwhere = pstrcat(cmd->tmp_pool, cmap.grpfield, " = '", groupname, "'", |
1392 |
NULL); |
1393 |
NULL); |
1393 |
|
1394 |
|
1394 |
where = sql_prepare_where(0, cmd, 2, grpwhere, cmap.groupwhere, NULL); |
1395 |
where = sql_prepare_where(SQL_PREPARE_WHERE_FL_NO_TAGS, cmd, 2, grpwhere, |
|
|
1396 |
sql_prepare_where(0, cmd, 1, cmap.groupwhere, NULL), NULL); |
1395 |
|
1397 |
|
1396 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 4, "default", |
1398 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 4, "default", |
1397 |
cmap.grptable, cmap.grpfields, where), "sql_select"); |
1399 |
cmap.grptable, cmap.grpfields, where), "sql_select"); |
Lines 1466-1472
Link Here
|
1466 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, " = '", _sql_realuser(cmd), |
1468 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, " = '", _sql_realuser(cmd), |
1467 |
"'", NULL); |
1469 |
"'", NULL); |
1468 |
|
1470 |
|
1469 |
where = sql_prepare_where(0, cmd, 2, usrwhere, cmap.userwhere, NULL); |
1471 |
where = sql_prepare_where(SQL_PREPARE_WHERE_FL_NO_TAGS, cmd, 2, usrwhere, |
|
|
1472 |
sql_prepare_where(0, cmd, 1, cmap.userwhere, NULL), NULL); |
1470 |
|
1473 |
|
1471 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 4, "default", cmap.usrtable, |
1474 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 4, "default", cmap.usrtable, |
1472 |
query, where), "sql_update"); |
1475 |
query, where), "sql_update"); |
Lines 1691-1697
Link Here
|
1691 |
|
1694 |
|
1692 |
if (strlen(tag) > 5 && |
1695 |
if (strlen(tag) > 5 && |
1693 |
strncmp(tag, "env:", 4) == 0) { |
1696 |
strncmp(tag, "env:", 4) == 0) { |
1694 |
char *env = pr_env_get(cmd->pool, tag + 4); |
1697 |
char *env; |
|
|
1698 |
|
1699 |
env = pr_env_get(cmd->pool, tag + 4); |
1695 |
return pstrdup(cmd->tmp_pool, env ? env : ""); |
1700 |
return pstrdup(cmd->tmp_pool, env ? env : ""); |
1696 |
} |
1701 |
} |
1697 |
|
1702 |
|
Lines 2130-2135
Link Here
|
2130 |
|
2135 |
|
2131 |
} else { |
2136 |
} else { |
2132 |
argp = resolve_short_tag(cmd, *tmp); |
2137 |
argp = resolve_short_tag(cmd, *tmp); |
|
|
2138 |
|
2133 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 2, "default", |
2139 |
mr = _sql_dispatch(_sql_make_cmd(cmd->tmp_pool, 2, "default", |
2134 |
argp), "sql_escapestring"); |
2140 |
argp), "sql_escapestring"); |
2135 |
if (check_response(mr) < 0) |
2141 |
if (check_response(mr) < 0) |
Lines 3609-3616
Link Here
|
3609 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, " = '", _sql_realuser(cmd), |
3615 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, " = '", _sql_realuser(cmd), |
3610 |
"'", NULL); |
3616 |
"'", NULL); |
3611 |
|
3617 |
|
3612 |
where = sql_prepare_where(0, cmd, 2, usrwhere, cmap.userwhere, NULL); |
3618 |
where = sql_prepare_where(SQL_PREPARE_WHERE_FL_NO_TAGS, cmd, 2, usrwhere, |
3613 |
|
3619 |
sql_prepare_where(0, cmd, 1, cmap.userwhere, NULL), NULL); |
|
|
3620 |
|
3614 |
query = pstrcat(cmd->tmp_pool, cmap.sql_fstor, ", ", |
3621 |
query = pstrcat(cmd->tmp_pool, cmap.sql_fstor, ", ", |
3615 |
cmap.sql_fretr, ", ", cmap.sql_bstor, ", ", |
3622 |
cmap.sql_fretr, ", ", cmap.sql_bstor, ", ", |
3616 |
cmap.sql_bretr, NULL); |
3623 |
cmap.sql_bretr, NULL); |
Lines 3644-3650
Link Here
|
3644 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, " = '", _sql_realuser(cmd), |
3651 |
usrwhere = pstrcat(cmd->tmp_pool, cmap.usrfield, " = '", _sql_realuser(cmd), |
3645 |
"'", NULL); |
3652 |
"'", NULL); |
3646 |
|
3653 |
|
3647 |
where = sql_prepare_where(0, cmd, 2, usrwhere, cmap.userwhere, NULL); |
3654 |
where = sql_prepare_where(SQL_PREPARE_WHERE_FL_NO_TAGS, cmd, 2, usrwhere, |
|
|
3655 |
sql_prepare_where(0, cmd, 1, cmap.userwhere, NULL), NULL); |
3648 |
|
3656 |
|
3649 |
query = pstrcat(cmd->tmp_pool, cmap.sql_frate, ", ", |
3657 |
query = pstrcat(cmd->tmp_pool, cmap.sql_frate, ", ", |
3650 |
cmap.sql_fcred, ", ", cmap.sql_brate, ", ", |
3658 |
cmap.sql_fcred, ", ", cmap.sql_brate, ", ", |