[Remove entries to the current 2.0 section below, when backported]
+ *) mod_authz_groupfile: Strip trailing spaces of group names. This
+ hopefully saves some hours of searching for typos. PR 12863.
+ [André Malo]
+
*) Remove an extra bit of unnecessary code from the recently
committed fix for PR 13946 (in mod_rewrite). Reported by
Andre Malo. [Paul J. Reder]
*/
#include "apr_strings.h"
+#include "apr_lib.h" /* apr_isspace */
#include "ap_config.h"
#include "httpd.h"
char l[MAX_STRING_LEN];
const char *group_name, *ll, *w;
apr_status_t status;
+ apr_size_t group_len;
if ((status = ap_pcfg_openfile(&f, p, grpfile)) != APR_SUCCESS) {
return status ;
apr_pool_clear(sp);
group_name = ap_getword(sp, &ll, ':');
+ group_len = strlen(group_name);
+
+ while (group_len && apr_isspace(*(group_name + group_len - 1))) {
+ --group_len;
+ }
while (ll[0]) {
w = ap_getword_conf(sp, &ll);
if (!strcmp(w, user)) {
- apr_table_setn(grps, apr_pstrdup(p, group_name), "in");
+ apr_table_setn(grps, apr_pstrmemdup(p, group_name, group_len),
+ "in");
break;
}
}