without ever filling it out.
PR: 7271
Submitted by: Taketo Kabe <kabe@sra-tohoku.co.jp> and Cliff Woolley <cliffwoolley@yahoo.com>]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88279
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.12-dev
+ *) Fix a seg fault in mod_userdir.c. We used to use the pw structure
+ without ever filling it out. This fixes PR 7271.
+ [Taketo Kabe <kabe@sra-tohoku.co.jp> and
+ Cliff Woolley <cliffwoolley@yahoo.com>]
+
*) Add a couple of GCC attribute tags to printf style functions.
[Jon Travis <jtravis@covalent.net>]
#ifdef HAVE_UNIX_SUEXEC
static ap_unix_identity_t *get_suexec_id_doer(const request_rec *r)
{
- const char *username = apr_table_get(r->notes, "mod_userdir_user");
- struct passwd *pw = NULL;
ap_unix_identity_t *ugid = NULL;
+#if APR_HAS_USER
+ const char *username = apr_table_get(r->notes, "mod_userdir_user");
if (username == NULL) {
return NULL;
return NULL;
}
- ugid->uid = pw->pw_uid;
- ugid->gid = pw->pw_gid;
-
+ if (apr_get_userid(&ugid->uid, &ugid->gid, username, r->pool) != APR_SUCCESS) {
+ return NULL;
+ }
+
+#endif
return ugid;
}
#endif /* HAVE_UNIX_SUEXEC */