Changeset 2025
- Timestamp:
- 11/12/2007 04:12:50 PM (6 months ago)
- Files:
-
- trunk/NEWS (modified) (3 diffs)
- trunk/src/spawn-fcgi.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/NEWS
r2015 r2025 10 10 * fixed network-backend-solaris-sendfilev (EINVAL in writev()) 11 11 * fixed initgroups() called after chroot (#1384) 12 * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428) 12 13 13 14 - 1.5.0-r19.. - … … 15 16 * replaced mod_fastcgi, mod_scgi, mod_proxy with mod_proxy_core + backends 16 17 * added query-string parsing for mod_uploadprogress 17 * added threaded stat() 18 * added threaded stat() 18 19 * added threaded disk-read() support 19 20 * added dir-listing.set-footer in mod_dirlisting (#1277) 20 21 * added logging of the PID and UID of the sending process for SIGTERM and SIGINT 21 22 * added support for AJP13 to mod_proxy_core 22 * fixed the out-of-fd support 23 * fixed the out-of-fd support 23 24 * fixed crash in mod_expire if 'modification' is used and stat() failed (#1063) 24 25 * fixed hardcoded font-sizes in mod_dirlisting (#1267) … … 35 36 * fixed missing check for base64 encoded string in mod_auth and Basic auth 36 37 (reported by Stefan Esser) 37 * fixed possible crash in Auth-Digest header parser on trailing WS in 38 * fixed possible crash in Auth-Digest header parser on trailing WS in 38 39 mod_auth (reported by Stefan Esser) trunk/src/spawn-fcgi.c
r2022 r2025 42 42 43 43 #ifdef HAVE_SYS_UN_H 44 int fcgi_spawn_connection(char *appPath, char * addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) {44 int fcgi_spawn_connection(char *appPath, char **appArgv, char *addr, unsigned short port, const char *unixsocket, int fork_count, int child_count, int pid_fd, int nofork) { 45 45 int fcgi_fd; 46 46 int socket_type, status; … … 144 144 case 0: { 145 145 char cgi_childs[64]; 146 char *b;147 146 int max_fd = 0; 148 147 … … 181 180 182 181 /* fork and replace shell */ 183 b = malloc(strlen("exec ") + strlen(appPath) + 1); 184 strcpy(b, "exec "); 185 strcat(b, appPath); 186 187 /* exec the cgi */ 188 execl("/bin/sh", "sh", "-c", b, (char *)NULL); 182 if (appArgv) { 183 execv(appArgv[0], appArgv); 184 185 } else { 186 char *b = malloc(strlen("exec ") + strlen(appPath) + 1); 187 strcpy(b, "exec "); 188 strcat(b, appPath); 189 190 /* exec the cgi */ 191 execl("/bin/sh", "sh", "-c", b, (char *)NULL); 192 } 189 193 190 194 exit(errno); … … 265 269 266 270 void show_help () { 267 char *b = "spawn-fcgi" "-" PACKAGE_VERSION \ 268 " - spawns fastcgi processes\n" \ 269 "usage:\n" \ 271 char *b = \ 272 "Usage: spawn-fcgi [options] -- <fcgiapp> [fcgi app arguments]\n" \ 273 "\n" \ 274 "spawn-fcgi v" PACKAGE_VERSION " - spawns fastcgi processes\n" \ 275 "\n" \ 276 "Options:\n" \ 270 277 " -f <fcgiapp> filename of the fcgi-application\n" \ 271 278 " -a <addr> bind to ip address\n" \ … … 291 298 *groupname = NULL, *unixsocket = NULL, *pid_file = NULL, 292 299 *addr = NULL; 300 char **fcgi_app_argv = { NULL }; 293 301 unsigned short port = 0; 294 302 int child_count = 5; … … 301 309 i_am_root = (getuid() == 0); 302 310 303 while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) {311 while (-1 != (o = getopt(argc, argv, "c:f:g:hna:p:u:vC:F:s:P:"))) { 304 312 switch(o) { 305 313 case 'f': fcgi_app = optarg; break; … … 322 330 } 323 331 324 if (fcgi_app == NULL || (port == 0 && unixsocket == NULL)) { 332 if (optind < argc) { 333 fcgi_app_argv = &argv[optind]; 334 } 335 336 if ((fcgi_app == NULL && fcgi_app_argv == NULL) || (port == 0 && unixsocket == NULL)) { 325 337 show_help(); 326 338 return -1; … … 462 474 } 463 475 464 return fcgi_spawn_connection(fcgi_app, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork);476 return fcgi_spawn_connection(fcgi_app, fcgi_app_argv, addr, port, unixsocket, fork_count, child_count, pid_fd, nofork); 465 477 } 466 478 #else

