Revert "Centralized function to get user name"

This commit is contained in:
Ervin Hegedus
2024-02-07 23:08:06 +01:00
committed by GitHub
parent 4629057fc9
commit 3f8d21c4b1
4 changed files with 850 additions and 822 deletions

View File

@@ -2843,14 +2843,3 @@ char* strtok_r(
}
#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;
}