| 100 |
&privileges_module); |
&privileges_module); |
| 101 |
|
|
| 102 |
/* ugly hack: grab default uid and gid from unixd */ |
/* ugly hack: grab default uid and gid from unixd */ |
| 103 |
extern unixd_config_rec unixd_config; |
extern unixd_config_rec ap_unixd_config; |
| 104 |
|
|
| 105 |
/* if either user or group are not the default, restore them */ |
/* if either user or group are not the default, restore them */ |
| 106 |
if (cfg->uid || cfg->gid) { |
if (cfg->uid || cfg->gid) { |
| 108 |
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
| 109 |
"PRIV_ON failed restoring default user/group"); |
"PRIV_ON failed restoring default user/group"); |
| 110 |
} |
} |
| 111 |
if (cfg->uid && (setuid(unixd_config.user_id) == -1)) { |
if (cfg->uid && (setuid(ap_unixd_config.user_id) == -1)) { |
| 112 |
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
| 113 |
"Error restoring default userid"); |
"Error restoring default userid"); |
| 114 |
} |
} |
| 115 |
if (cfg->gid && (setgid(unixd_config.group_id) == -1)) { |
if (cfg->gid && (setgid(ap_unixd_config.group_id) == -1)) { |
| 116 |
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, |
| 117 |
"Error restoring default group"); |
"Error restoring default group"); |
| 118 |
} |
} |