Merge branch 'v2/master' into v2/mst/nullcheck2

This commit is contained in:
Marc Stern
2024-04-04 16:08:59 +02:00
committed by GitHub
23 changed files with 361 additions and 101 deletions

View File

@@ -2850,14 +2850,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;
}