Documentation Source Text

Check-in [c84d76df63]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In althttpd.c, make sure all file descriptors other than 0, 1, and 2 are closed prior to launching CGI.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:c84d76df63f4b07e8e0f05477f25df909488e270be512859dc666bcd5a9d48a0
User & Date: drh 2018-08-01 07:08:09
Context
2018-08-06
01:42
Fix typos in the windowfunction documentation. check-in: ab3b52646c user: drh tags: trunk
2018-08-01
07:08
In althttpd.c, make sure all file descriptors other than 0, 1, and 2 are closed prior to launching CGI. check-in: c84d76df63 user: drh tags: trunk
2018-07-27
23:56
Sublists in the change log are a-b-c instead of 1-2-3. check-in: 3e5cf6efac user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to misc/althttpd.c.

  1687   1687           close(1);
  1688   1688           if( dup(px[1])!=1 ){
  1689   1689             Malfunction(450, /* LOG: dup(1) failed */
  1690   1690                    "Unable to duplicate file descriptor %d to 1",
  1691   1691                    px[1]);
  1692   1692           }
  1693   1693           close(px[1]);
         1694  +        for(i=3; close(i)==0; i++){}
  1694   1695           execl(zBaseFilename, zBaseFilename, (char*)0);
  1695   1696           exit(0);
  1696   1697         }
  1697   1698         close(px[1]);
  1698   1699         in = fdopen(px[0], "r");
  1699   1700       }
  1700   1701       if( in==0 ){