./www/cgic, Thomas Boutells ANSI C library for CGI Programming

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 2.06, Package name: cgic-2.06, Maintainer: pkgsrc

This is the code written to accompany Thomas Boutell's book "CGI
Programming in C & Perl". It provides a library of routines for use
in CGI programming, and unlike cgilib-0.5, this library handles the
"multipart/form-data" encoding required to use the FILE input control
type as defined in the HTML specification.

NOTE: It should be aware that there were a few developer visible changes
made from Thomas Boutell's original distribution when integrating it
with the NetBSD packages environment. They are:

1) Instead of being yet another source file which is used in building
the application, the package have been converted totally into a
library format. This library is linked using "-lcgic".
2) As a result of the first item, the developer no longer writes their
entry point under the function name of cgiMain(). Instead, the
user will provide their own main(), and will need to call cgiInit()
before any other cgic function is called.


Required to build:
[pkgtools/cwrappers]

Master sites:

Filesize: 48.991 KB

Version history: (Expand)


CVS history: (Expand)


   2021-10-26 13:31:15 by Nia Alarie | Files touched by this commit (1030)
Log message:
www: Replace RMD160 checksums with BLAKE2s checksums

All checksums have been double-checked against existing RMD160 and
SHA512 hashes

Not committed (merge conflicts):
www/nghttp2/distinfo

Unfetchable distfiles (almost certainly fetched conditionally...):
./www/nginx-devel/distinfo array-var-nginx-module-0.05.tar.gz
./www/nginx-devel/distinfo echo-nginx-module-0.62.tar.gz
./www/nginx-devel/distinfo encrypted-session-nginx-module-0.08.tar.gz
./www/nginx-devel/distinfo form-input-nginx-module-0.12.tar.gz
./www/nginx-devel/distinfo headers-more-nginx-module-0.33.tar.gz
./www/nginx-devel/distinfo lua-nginx-module-0.10.19.tar.gz
./www/nginx-devel/distinfo naxsi-1.3.tar.gz
./www/nginx-devel/distinfo nginx-dav-ext-module-3.0.0.tar.gz
./www/nginx-devel/distinfo nginx-rtmp-module-1.2.2.tar.gz
./www/nginx-devel/distinfo nginx_http_push_module-1.2.10.tar.gz
./www/nginx-devel/distinfo ngx_cache_purge-2.5.1.tar.gz
./www/nginx-devel/distinfo ngx_devel_kit-0.3.1.tar.gz
./www/nginx-devel/distinfo ngx_http_geoip2_module-3.3.tar.gz
./www/nginx-devel/distinfo njs-0.5.0.tar.gz
./www/nginx-devel/distinfo set-misc-nginx-module-0.32.tar.gz
./www/nginx/distinfo array-var-nginx-module-0.05.tar.gz
./www/nginx/distinfo echo-nginx-module-0.62.tar.gz
./www/nginx/distinfo encrypted-session-nginx-module-0.08.tar.gz
./www/nginx/distinfo form-input-nginx-module-0.12.tar.gz
./www/nginx/distinfo headers-more-nginx-module-0.33.tar.gz
./www/nginx/distinfo lua-nginx-module-0.10.19.tar.gz
./www/nginx/distinfo naxsi-1.3.tar.gz
./www/nginx/distinfo nginx-dav-ext-module-3.0.0.tar.gz
./www/nginx/distinfo nginx-rtmp-module-1.2.2.tar.gz
./www/nginx/distinfo nginx_http_push_module-1.2.10.tar.gz
./www/nginx/distinfo ngx_cache_purge-2.5.1.tar.gz
./www/nginx/distinfo ngx_devel_kit-0.3.1.tar.gz
./www/nginx/distinfo ngx_http_geoip2_module-3.3.tar.gz
./www/nginx/distinfo njs-0.5.0.tar.gz
./www/nginx/distinfo set-misc-nginx-module-0.32.tar.gz
   2021-10-07 17:09:00 by Nia Alarie | Files touched by this commit (1033)
Log message:
www: Remove SHA1 hashes for distfiles
   2015-11-04 03:47:43 by Alistair G. Crooks | Files touched by this commit (758)
Log message:
Add SHA512 digests for distfiles for www category

Problems found locating distfiles:
	Package haskell-cgi: missing distfile haskell-cgi-20001206.tar.gz
	Package nginx: missing distfile array-var-nginx-module-0.04.tar.gz
	Package nginx: missing distfile encrypted-session-nginx-module-0.04.tar.gz
	Package nginx: missing distfile headers-more-nginx-module-0.261.tar.gz
	Package nginx: missing distfile nginx_http_push_module-0.692.tar.gz
	Package nginx: missing distfile set-misc-nginx-module-0.29.tar.gz
	Package nginx-devel: missing distfile echo-nginx-module-0.58.tar.gz
	Package nginx-devel: missing distfile form-input-nginx-module-0.11.tar.gz
	Package nginx-devel: missing distfile lua-nginx-module-0.9.16.tar.gz
	Package nginx-devel: missing distfile nginx_http_push_module-0.692.tar.gz
	Package nginx-devel: missing distfile set-misc-nginx-module-0.29.tar.gz
	Package php-owncloud: missing distfile owncloud-8.2.0.tar.bz2

Otherwise, existing SHA1 digests verified and found to be the same on
the machine holding the existing distfiles (morden).  All existing
SHA1 digests retained for now as an audit trail.
   2014-04-07 17:01:44 by Adam Ciarcinski | Files touched by this commit (4) | Package updated
Log message:
Changes 2.06:
* In main(), when parsing form input fails, the CGI script exits without
  producing any output whatsoever.  Wouldn't it be better to actually
  emit an error status, instead of expecting the server to do something
  sane with a script that produces no output?

* In mpRead(), a check is done to insure the requested length is not
  greater than the amount of data still available, and to adjust it
  if necessary.  However, this check is currently done _after_ reading
  data from the putback buffer, in which process len is decremented by
  the amount of putback data read, but mpp->offset is not correspondingly
  incremented (this happens later).  As a result, the check uses too
  small a value for len, and so fails to stop reading soon enough if
  the requested length is greater than what is available _and_ there
  was any data in the putback buffer.
  The fix is to move the check to the beginning of mpRead()

* Further, if a read request is satisfied _entirely_ from the putback
  buffer, mpp->offset is not updated at all, resulting in a similar
  problem.  The solution is to update mpp->offset in the "else if (got)"
  case.

* In cgiParsePostMultipartInput(), if the Content-Disposition of a part
  is not "form-data", afterNextBoundary() is not called before beginning
  to process the next part.  As a result, parsing of the next part headers
  begins with the body of the unwanted part.  It is necessary in this case
  to call afterNextBoundary() before continuing with the next cycle.

* In handling out-of-memory conditions in afterNextBoundary(), *outP is
  set to '\0'.  While this is technically legal ('\0' is "an integral
  constant expression with the value 0"), it looks funny.

* In cgiCookieString(), a change was introduced in v2.02 which purports
  to prevent an overrun in cases where cgiCookie is exactly equal to
  the requested cookie name.  In fact, the problem can also occur if
  the requested name occurs with no values at the end of cgiCookie.
  Further, the change from v2.02 does not fix the problem, because it
  compares the _pointers_ p and n to NULL, which they will never equal,
  rather than comparing the pointers they point at to NUL.

* Also in cgiCookieString(), there is a comment suggesting that the main
  loop never terminates except with a return.  This is not the case.
  For example, it will terminate if the requested cookie is not found
  and the cgiCookie string ends in a semicolon.

* Why did days[] (formerly daysOfWeek[]) and months[] become non-static?
  This pollutes the namespace of programs using CGIC.

* In cgiReadEnvironment(), when reading in the contents of an uploaded
  file, it is possible that a temporary file is successfully created
  but then cannot be opened.  In this case, no attempt is made to remove
  the tempoary file.

* Further, when a form entry does _not_ include an uploaded file,
  e->tfileName is set to malloc'd but uninitialized memory.  It should
  be set to an empty string, by setting e->tfileName[0] to zero after
  the 1-byte buffer is allocated.
   2012-10-28 07:31:10 by Aleksej Saushev | Files touched by this commit (600)
Log message:
Drop superfluous PKG_DESTDIR_SUPPORT, "user-destdir" is default these days.
   2012-02-16 20:58:59 by Hans Rosenfeld | Files touched by this commit (1)
Log message:
Make sure the correct install tool is used.
   2009-06-15 00:00:42 by Joerg Sonnenberger | Files touched by this commit (316)
Log message:
Convert @exec/@unexec to @pkgdir or drop it.
   2009-03-20 20:25:55 by Joerg Sonnenberger | Files touched by this commit (1252)
Log message:
Simply and speed up buildlink3.mk files and processing.
This changes the buildlink3.mk files to use an include guard for the
recursive include. The use of BUILDLINK_DEPTH, BUILDLINK_DEPENDS,
BUILDLINK_PACKAGES and BUILDLINK_ORDER is handled by a single new
variable BUILDLINK_TREE. Each buildlink3.mk file adds a pair of
enter/exit marker, which can be used to reconstruct the tree and
to determine first level includes. Avoiding := for large variables
(BUILDLINK_ORDER) speeds up parse time as += has linear complexity.
The include guard reduces system time by avoiding reading files over and
over again. For complex packages this reduces both %user and %sys time to
half of the former time.