aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBertrand Jacquin <beber@meleeweb.net>2013-11-27 22:11:42 +0100
committerBertrand Jacquin <beber@meleeweb.net>2013-11-27 22:40:51 +0100
commitf9e4934189a28ca8aee24868dbc59b4311c62af1 (patch)
tree55b750296fe8456b94a61add430fdcf27fb0d818
parentMINOR: Add a proper Makefile to build project. (diff)
downloadmod_ruid2-f9e4934189a28ca8aee24868dbc59b4311c62af1.tar.gz
BUG/MEDIUM: make RGroups working in mode stat, not only config mode
Also copy the Rgroups from parent to child when merging configurations. That kind of configuration was broken : <VirtualHost *:80> DocumentRoot /var/www/localhost/htdocs RMode stat RGroups nogroup RMinUidGid #1000 #1000 RDefaultUidGid apache apache </VirtualHost>
-rw-r--r--mod_ruid2.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/mod_ruid2.c b/mod_ruid2.c
index 96f7bcb..b374f3a 100644
--- a/mod_ruid2.c
+++ b/mod_ruid2.c
@@ -148,17 +148,18 @@ static void *merge_dir_config(apr_pool_t *p, void *base, void *overrides)
} else {
conf->ruid_uid = (child->ruid_uid == UNSET) ? parent->ruid_uid : child->ruid_uid;
conf->ruid_gid = (child->ruid_gid == UNSET) ? parent->ruid_gid : child->ruid_gid;
- if (child->groupsnr == NONE) {
- conf->groupsnr = NONE;
- } else if (child->groupsnr > 0) {
- memcpy(conf->groups, child->groups, sizeof(child->groups));
- conf->groupsnr = child->groupsnr;
- } else if (parent->groupsnr > 0) {
- memcpy(conf->groups, parent->groups, sizeof(parent->groups));
- conf->groupsnr = parent->groupsnr;
- } else {
- conf->groupsnr = (child->groupsnr == UNSET) ? parent->groupsnr : child->groupsnr;
- }
+ }
+
+ if (child->groupsnr == NONE) {
+ conf->groupsnr = NONE;
+ } else if (child->groupsnr > 0) {
+ memcpy(conf->groups, child->groups, sizeof(child->groups));
+ conf->groupsnr = child->groupsnr;
+ } else if (parent->groupsnr > 0) {
+ memcpy(conf->groups, parent->groups, sizeof(parent->groups));
+ conf->groupsnr = parent->groupsnr;
+ } else {
+ conf->groupsnr = (child->groupsnr == UNSET) ? parent->groupsnr : child->groupsnr;
}
return conf;