mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-10-03 04:57:58 +03:00
Revert "Centralized function to get user name"
This commit is contained in:
@@ -234,7 +234,15 @@ static char *construct_auditlog_filename(apr_pool_t *mp, const char *uniqueid) {
|
|||||||
* This is required for mpm-itk & mod_ruid2, though should be harmless for other implementations
|
* This is required for mpm-itk & mod_ruid2, though should be harmless for other implementations
|
||||||
* It also changes the return statement.
|
* It also changes the return statement.
|
||||||
*/
|
*/
|
||||||
char *userinfo = get_username(mp);
|
char *userinfo;
|
||||||
|
apr_status_t rc;
|
||||||
|
apr_uid_t uid;
|
||||||
|
apr_gid_t gid;
|
||||||
|
apr_uid_current(&uid, &gid, mp);
|
||||||
|
rc = apr_uid_name_get(&userinfo, uid, mp);
|
||||||
|
if (rc != APR_SUCCESS) {
|
||||||
|
userinfo = apr_psprintf(mp, "%u", uid);
|
||||||
|
}
|
||||||
|
|
||||||
apr_time_exp_lt(&t, apr_time_now());
|
apr_time_exp_lt(&t, apr_time_now());
|
||||||
|
|
||||||
|
@@ -2843,14 +2843,3 @@ char* strtok_r(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Function compatible with Linux & Windows, also with mpm-itk & mod_ruid2
|
|
||||||
char* get_username(apr_pool_t* mp) {
|
|
||||||
char* username;
|
|
||||||
apr_uid_t uid;
|
|
||||||
apr_gid_t gid;
|
|
||||||
int rc = apr_uid_current(&uid, &gid, mp);
|
|
||||||
if (rc != APR_SUCCESS) return "apache";
|
|
||||||
rc = apr_uid_name_get(&username, uid, mp);
|
|
||||||
if (rc != APR_SUCCESS) return "apache";
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
|
@@ -159,8 +159,6 @@ int DSOLOCAL tree_contains_ip(apr_pool_t *mp, TreeRoot *rtree,
|
|||||||
int DSOLOCAL ip_tree_from_param(apr_pool_t *pool,
|
int DSOLOCAL ip_tree_from_param(apr_pool_t *pool,
|
||||||
char *param, TreeRoot **rtree, char **error_msg);
|
char *param, TreeRoot **rtree, char **error_msg);
|
||||||
|
|
||||||
char DSOLOCAL *get_username(apr_pool_t* mp);
|
|
||||||
|
|
||||||
#ifdef WITH_CURL
|
#ifdef WITH_CURL
|
||||||
int ip_tree_from_uri(TreeRoot **rtree, char *uri,
|
int ip_tree_from_uri(TreeRoot **rtree, char *uri,
|
||||||
apr_pool_t *mp, char **error_msg);
|
apr_pool_t *mp, char **error_msg);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user