mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Missing function
This commit is contained in:
@@ -2850,3 +2850,14 @@ char* strtok_r(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// we cannot log an error message as this happens much too often
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user