diff options
author | venaas <venaas> | 2008-09-08 07:02:48 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-09-08 07:02:48 +0000 |
commit | df5a67b52637a059d2fbadf25ca348cd0c23b114 (patch) | |
tree | 87c132fc0eb9afa1b4b23ec064b506af3e11d3b3 | |
parent | 37f71f78b5633740ffdb09ca39035bec197db0a4 (diff) |
s/rewriteattr.*/rewriteusername.*/
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@363 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | radsecproxy.c | 28 | ||||
-rw-r--r-- | radsecproxy.h | 4 |
2 files changed, 16 insertions, 16 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 5977ac8..88eab93 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1594,9 +1594,9 @@ int rewriteusername(struct request *rq, char *in) { regmatch_t pmatch[10], *pfield; int i; unsigned char *result; - char *out = rq->from->conf->rewriteattrreplacement; + char *out = rq->from->conf->rewriteusernamereplacement; - if (regexec(rq->from->conf->rewriteattrregex, in, nmatch, pmatch, 0)) { + if (regexec(rq->from->conf->rewriteusernameregex, in, nmatch, pmatch, 0)) { debug(DBG_DBG, "rewriteattr: username not matching, no rewrite"); return 1; } @@ -1851,7 +1851,7 @@ void radsrv(struct request *rq) { username[ATTRVALLEN(attr)] = '\0'; radattr2ascii(userascii, sizeof(userascii), attr); - if (rq->from->conf->rewriteattrregex) { + if (rq->from->conf->rewriteusernameregex) { if (!rewriteusername(rq, username)) { debug(DBG_WARN, "radsrv: username malloc failed, ignoring request"); goto exit; @@ -2764,24 +2764,24 @@ int addrewriteattr(struct clsrvconf *conf, char *rewriteattr) { *w = '\0'; w++; - conf->rewriteattrregex = malloc(sizeof(regex_t)); - if (!conf->rewriteattrregex) { + conf->rewriteusernameregex = malloc(sizeof(regex_t)); + if (!conf->rewriteusernameregex) { debug(DBG_ERR, "malloc failed"); return 0; } - conf->rewriteattrreplacement = stringcopy(w, 0); - if (!conf->rewriteattrreplacement) { - free(conf->rewriteattrregex); - conf->rewriteattrregex = NULL; + conf->rewriteusernamereplacement = stringcopy(w, 0); + if (!conf->rewriteusernamereplacement) { + free(conf->rewriteusernameregex); + conf->rewriteusernameregex = NULL; return 0; } - if (regcomp(conf->rewriteattrregex, v, REG_ICASE | REG_EXTENDED)) { - free(conf->rewriteattrregex); - conf->rewriteattrregex = NULL; - free(conf->rewriteattrreplacement); - conf->rewriteattrreplacement = NULL; + if (regcomp(conf->rewriteusernameregex, v, REG_ICASE | REG_EXTENDED)) { + free(conf->rewriteusernameregex); + conf->rewriteusernameregex = NULL; + free(conf->rewriteusernamereplacement); + conf->rewriteusernamereplacement = NULL; debug(DBG_ERR, "failed to compile regular expression %s", v); return 0; } diff --git a/radsecproxy.h b/radsecproxy.h index 33d8dcb..e841da2 100644 --- a/radsecproxy.h +++ b/radsecproxy.h @@ -83,8 +83,8 @@ struct clsrvconf { char *secret; regex_t *certcnregex; regex_t *certuriregex; - regex_t *rewriteattrregex; - char *rewriteattrreplacement; + regex_t *rewriteusernameregex; + char *rewriteusernamereplacement; uint8_t statusserver; uint8_t retryinterval; uint8_t retrycount; |