Bug 65438

Summary: mod_privileges.c / vhost_group not checking cfg->gid as intended
Product: Apache httpd-2 Reporter: steve algernon <salgernon>
Component: mod_privilegesAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.4.48   
Target Milestone: ---   
Hardware: All   
OS: Mac OS X 10.1   

Description steve algernon 2021-07-06 22:32:52 UTC
This is terribly trivial, but the check should be against the newly assigned cfg->gid rather than cfg->uid.

*** ./modules/arch/unix/mod_privileges.c.orig	2021-07-06 15:30:54.000000000 -0700
--- ./modules/arch/unix/mod_privileges.c	2021-07-06 15:31:05.000000000 -0700
***************
*** 432,438 ****
      priv_cfg *cfg = ap_get_module_config(cmd->server->module_config,
                                           &privileges_module);
      cfg->gid = ap_gname2id(arg);
!     if (cfg->uid == 0) {
          return apr_pstrcat(cmd->pool, "Invalid groupid for VHostGroup: ",
                             arg, NULL);
      }
--- 432,438 ----
      priv_cfg *cfg = ap_get_module_config(cmd->server->module_config,
                                           &privileges_module);
      cfg->gid = ap_gname2id(arg);
!     if (cfg->gid == 0) {
          return apr_pstrcat(cmd->pool, "Invalid groupid for VHostGroup: ",
                             arg, NULL);
      }