Skip to content

Commit c8e1904

Browse files
author
Marc Stern
committed
Missing function
1 parent 1014e47 commit c8e1904

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

apache2/msc_util.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,3 +2850,14 @@ char* strtok_r(
28502850
}
28512851
#endif
28522852

2853+
// we cannot log an error message as this happens much too often
2854+
char* get_username(apr_pool_t* mp) {
2855+
char* username;
2856+
apr_uid_t uid;
2857+
apr_gid_t gid;
2858+
int rc = apr_uid_current(&uid, &gid, mp);
2859+
if (rc != APR_SUCCESS) return "apache";
2860+
rc = apr_uid_name_get(&username, uid, mp);
2861+
if (rc != APR_SUCCESS) return "apache";
2862+
return username;
2863+
}

0 commit comments

Comments
 (0)