#define MIN_UID 100
#define MIN_GID 100
+const char USERDIR[] = "web_scripts";
#define MAX_FAILURES 5
return HTTP_INTERNAL_SERVER_ERROR;
}
+ if (reqc->uid != NULL) {
+ char *username;
+ char *userdir_val;
+ uid_t uid = (uid_t) atoll(reqc->uid);
+
+ if ((code = reconfigure_directive(r->pool, server, "UserDir", USERDIR)) != 0)
+ return code;
+
+ /* Deal with ~ expansion */
+ if ((code = reconfigure_directive(r->pool, server, "UserDir", "disabled")) != 0)
+ return code;
+
+ if (apr_uid_name_get(&username, uid, r->pool) != APR_SUCCESS) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
+ "could not get username for uid %d", uid);
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+ userdir_val = apr_pstrcat(r->pool, "enabled ", username, (const char *)NULL);
+
+ if ((code = reconfigure_directive(r->pool, server, "UserDir", userdir_val)) != 0)
+ return code;
+ }
+
ap_fixup_virtual_host(r->pool, r->server, server);
r->server = server;