Gentoo Archives: gentoo-commits

From: "Benedikt Boehm (hollow)" <hollow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-apache/mod_fcgid/files: mod_fcgid-2.2-vhost-granularity.patch
Date: Fri, 24 Jul 2009 12:14:35
Message-Id: E1MUJfV-0006dT-07@stork.gentoo.org
1 hollow 09/07/24 12:14:32
2
3 Added: mod_fcgid-2.2-vhost-granularity.patch
4 Log:
5 add virtualhost granularity patch for suexec and mpm-itk compatibility
6 (Portage version: 2.2_rc33/cvs/Linux i686)
7
8 Revision Changes Path
9 1.1 www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-apache/mod_fcgid/files/mod_fcgid-2.2-vhost-granularity.patch?rev=1.1&content-type=text/plain
13
14 Index: mod_fcgid-2.2-vhost-granularity.patch
15 ===================================================================
16 diff --git a/arch/unix/fcgid_pm_unix.c b/arch/unix/fcgid_pm_unix.c
17 index 01932aa..2c0c4c4 100644
18 --- a/arch/unix/fcgid_pm_unix.c
19 +++ b/arch/unix/fcgid_pm_unix.c
20 @@ -386,6 +386,7 @@ void procmgr_init_spawn_cmd(fcgid_command * command, request_rec * r,
21 command->deviceid = deviceid;
22 command->inode = inode;
23 command->share_grp_id = share_grp_id;
24 + command->virtualhost = r->server->server_hostname;
25
26 /* Update fcgid_command with wrapper info */
27 command->wrapperpath[0] = '\0';
28 diff --git a/arch/unix/fcgid_proctbl_unix.c b/arch/unix/fcgid_proctbl_unix.c
29 index bb8a46b..852c0c4 100644
30 --- a/arch/unix/fcgid_proctbl_unix.c
31 +++ b/arch/unix/fcgid_proctbl_unix.c
32 @@ -279,7 +279,7 @@ void proctable_print_debug_info(server_rec * main_server)
33 current_node != g_proc_array;
34 current_node = &g_proc_array[current_node->next_index]) {
35 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
36 - "mod_fcgid: idle node index: %td",
37 + "mod_fcgid: idle node index: %d",
38 current_node - g_proc_array);
39 }
40
41 @@ -287,7 +287,7 @@ void proctable_print_debug_info(server_rec * main_server)
42 current_node != g_proc_array;
43 current_node = &g_proc_array[current_node->next_index]) {
44 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
45 - "mod_fcgid: busy node index: %td",
46 + "mod_fcgid: busy node index: %d",
47 current_node - g_proc_array);
48 }
49
50 @@ -295,7 +295,7 @@ void proctable_print_debug_info(server_rec * main_server)
51 current_node != g_proc_array;
52 current_node = &g_proc_array[current_node->next_index]) {
53 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
54 - "mod_fcgid: error node index: %td",
55 + "mod_fcgid: error node index: %d",
56 current_node - g_proc_array);
57 }
58 }
59 diff --git a/fcgid_bridge.c b/fcgid_bridge.c
60 index e4fc184..5a960ff 100644
61 --- a/fcgid_bridge.c
62 +++ b/fcgid_bridge.c
63 @@ -34,6 +34,7 @@ static fcgid_procnode *apply_free_procnode(server_rec * main_server,
64 uid_t uid = command->uid;
65 gid_t gid = command->gid;
66 apr_size_t share_grp_id = command->share_grp_id;
67 + char *virtualhost = command->virtualhost;
68
69 proc_table = proctable_get_table_array();
70 previous_node = proctable_get_idle_list();
71 @@ -47,6 +48,7 @@ static fcgid_procnode *apply_free_procnode(server_rec * main_server,
72 if (current_node->inode == inode
73 && current_node->deviceid == deviceid
74 && current_node->share_grp_id == share_grp_id
75 + && current_node->virtualhost == virtualhost
76 && current_node->uid == uid && current_node->gid == gid) {
77 /* Unlink from idle list */
78 previous_node->next_index = current_node->next_index;
79 @@ -124,6 +126,7 @@ count_busy_processes(server_rec * main_server, fcgid_command * command)
80 if (current_node->inode == command->inode
81 && current_node->deviceid == command->deviceid
82 && current_node->share_grp_id == command->share_grp_id
83 + && current_node->virtualhost == command->virtualhost
84 && current_node->uid == command->uid
85 && current_node->gid == command->gid) {
86 result++;
87 diff --git a/fcgid_pm.h b/fcgid_pm.h
88 index a157156..0c34f78 100644
89 --- a/fcgid_pm.h
90 +++ b/fcgid_pm.h
91 @@ -11,6 +11,7 @@ typedef struct {
92 apr_ino_t inode;
93 dev_t deviceid;
94 apr_size_t share_grp_id;
95 + char *virtualhost; /* Virtualhost granularity */
96 uid_t uid; /* For suEXEC */
97 gid_t gid; /* For suEXEC */
98 int userdir; /* For suEXEC */
99 diff --git a/fcgid_pm_main.c b/fcgid_pm_main.c
100 index 9618aec..fddab47 100644
101 --- a/fcgid_pm_main.c
102 +++ b/fcgid_pm_main.c
103 @@ -386,7 +386,7 @@ fastcgi_spawn(fcgid_command * command, server_rec * main_server,
104 if (free_list_header->next_index == 0) {
105 safe_unlock(main_server);
106 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, main_server,
107 - "mod_fcgid: too much proecess, please increase FCGID_MAX_APPLICATION");
108 + "mod_fcgid: too much processes, please increase FCGID_MAX_APPLICATION");
109 return;
110 }
111 procnode = &proctable_array[free_list_header->next_index];
112 @@ -398,12 +398,14 @@ fastcgi_spawn(fcgid_command * command, server_rec * main_server,
113 procnode->deviceid = command->deviceid;
114 procnode->inode = command->inode;
115 procnode->share_grp_id = command->share_grp_id;
116 + procnode->virtualhost = command->virtualhost;
117 procnode->uid = command->uid;
118 procnode->gid = command->gid;
119 procnode->start_time = procnode->last_active_time = apr_time_now();
120 procnode->requests_handled = 0;
121 procnode->diewhy = FCGID_DIE_KILLSELF;
122 procnode->proc_pool = NULL;
123 +
124 procinfo.cgipath = command->cgipath;
125 procinfo.configpool = configpool;
126 procinfo.main_server = main_server;
127 @@ -447,8 +449,8 @@ fastcgi_spawn(fcgid_command * command, server_rec * main_server,
128 link_node_to_list(main_server, idle_list_header,
129 procnode, proctable_array);
130 ap_log_error(APLOG_MARK, APLOG_INFO, 0, main_server,
131 - "mod_fcgid: server %s(%" APR_PID_T_FMT ") started",
132 - command->cgipath, procnode->proc_id->pid);
133 + "mod_fcgid: server %s:%s(%" APR_PID_T_FMT ") started",
134 + command->virtualhost, command->cgipath, procnode->proc_id->pid);
135 register_spawn(main_server, procnode);
136 }
137 }
138 diff --git a/fcgid_proctbl.h b/fcgid_proctbl.h
139 index 04d954b..f1807ba 100644
140 --- a/fcgid_proctbl.h
141 +++ b/fcgid_proctbl.h
142 @@ -28,6 +28,7 @@ typedef struct {
143 gid_t gid; /* for suEXEC */
144 uid_t uid; /* for suEXEC */
145 apr_size_t share_grp_id; /* cgi wrapper share group id */
146 + char *virtualhost; /* the virtualhost this process belongs to */
147 apr_time_t start_time; /* the time of this process create */
148 apr_time_t last_active_time; /* the time this process last active */
149 int requests_handled; /* number of requests process has handled */
150 diff --git a/fcgid_spawn_ctl.c b/fcgid_spawn_ctl.c
151 index 17039eb..d21c7d0 100644
152 --- a/fcgid_spawn_ctl.c
153 +++ b/fcgid_spawn_ctl.c
154 @@ -9,6 +9,7 @@ struct fcgid_stat_node {
155 uid_t uid;
156 gid_t gid;
157 apr_size_t share_grp_id;
158 + char *virtualhost;
159 int score;
160 int process_counter;
161 apr_time_t last_stat_time;
162 @@ -42,6 +43,7 @@ register_life_death(server_rec * main_server,
163 if (current_node->inode == procnode->inode
164 && current_node->deviceid == procnode->deviceid
165 && current_node->share_grp_id == procnode->share_grp_id
166 + && current_node->virtualhost == procnode->virtualhost
167 && current_node->uid == procnode->uid
168 && current_node->gid == procnode->gid)
169 break;
170 @@ -81,6 +83,7 @@ register_life_death(server_rec * main_server,
171 current_node->deviceid = procnode->deviceid;
172 current_node->inode = procnode->inode;
173 current_node->share_grp_id = procnode->share_grp_id;
174 + current_node->virtualhost = procnode->virtualhost;
175 current_node->uid = procnode->uid;
176 current_node->gid = procnode->gid;
177 current_node->last_stat_time = apr_time_now();
178 @@ -152,6 +155,7 @@ int is_spawn_allowed(server_rec * main_server, fcgid_command * command)
179 if (current_node->inode == command->inode
180 && current_node->deviceid == command->deviceid
181 && current_node->share_grp_id == command->share_grp_id
182 + && current_node->virtualhost == command->virtualhost
183 && current_node->uid == command->uid
184 && current_node->gid == command->gid)
185 break;
186 @@ -218,6 +222,7 @@ int is_kill_allowed(fcgid_procnode * procnode)
187 if (current_node->inode == procnode->inode
188 && current_node->deviceid == procnode->deviceid
189 && current_node->share_grp_id == procnode->share_grp_id
190 + && current_node->virtualhost == procnode->virtualhost
191 && current_node->uid == procnode->uid
192 && current_node->gid == procnode->gid)
193 break;