pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Import www/ap2-encoding



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d7b49de54b25
branches:  trunk
changeset: 351844:d7b49de54b25
user:      manu <manu%pkgsrc.org@localhost>
date:      Tue Aug 30 12:34:39 2016 +0000

description:
Import www/ap2-encoding

This module improves non-ascii filename interoperability of apache
(and mod_dav), by supporting various client encoding.

Current license is troublesome because of its clause 4:
> 4. Products derived from this software may not be called "mod_encoding"
>    nor may "mod_encoding" appear in their names without prior written
>    permission of Internet Initiative Japan Inc. For written permission,
>    please contact tai%iij.ad.jp@localhost (Taisuke Yamada).

LICENSE is however left intionnaly blank, as Internet Initiative Japan, Inc.
may revise it in the near future. This is approved by wiz@ and soda@.

diffstat:

 doc/CHANGES-2016                              |    3 +-
 www/Makefile                                  |    3 +-
 www/ap2-encoding/DESCR                        |   20 +
 www/ap2-encoding/Makefile                     |   27 +
 www/ap2-encoding/PLIST                        |    4 +
 www/ap2-encoding/distinfo                     |    7 +
 www/ap2-encoding/patches/patch-mod_encoding.c |  541 ++++++++++++++++++++++++++
 7 files changed, 603 insertions(+), 2 deletions(-)

diffs (truncated from 650 to 300 lines):

diff -r 1e9eaf4c89cd -r d7b49de54b25 doc/CHANGES-2016
--- a/doc/CHANGES-2016  Tue Aug 30 11:01:12 2016 +0000
+++ b/doc/CHANGES-2016  Tue Aug 30 12:34:39 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES-2016,v 1.3596 2016/08/30 10:59:06 plunky Exp $
+$NetBSD: CHANGES-2016,v 1.3597 2016/08/30 12:34:39 manu Exp $
 
 Changes to the packages collection and infrastructure in 2016:
 
@@ -5140,3 +5140,4 @@
        Removed cad/qcad-manual-hu [plunky 2016-08-30]
        Updated cad/qcad to 3.15.5.4 [plunky 2016-08-30]
        Updated cad/qcad-partlibrary to 20160819 [plunky 2016-08-30]
+       Added www/ap2-encoding 20021209 [manu 2016-08-30]
diff -r 1e9eaf4c89cd -r d7b49de54b25 www/Makefile
--- a/www/Makefile      Tue Aug 30 11:01:12 2016 +0000
+++ b/www/Makefile      Tue Aug 30 12:34:39 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1190 2016/08/25 00:17:04 markd Exp $
+# $NetBSD: Makefile,v 1.1191 2016/08/30 12:34:39 manu Exp $
 #
 
 COMMENT=       Packages related to the World Wide Web
@@ -31,6 +31,7 @@
 SUBDIR+=       ap2-authn-otp
 SUBDIR+=       ap2-bw
 SUBDIR+=       ap2-cband
+SUBDIR+=       ap2-encoding
 SUBDIR+=       ap2-fcgid
 SUBDIR+=       ap2-jk
 SUBDIR+=       ap2-limitipconn
diff -r 1e9eaf4c89cd -r d7b49de54b25 www/ap2-encoding/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap2-encoding/DESCR    Tue Aug 30 12:34:39 2016 +0000
@@ -0,0 +1,20 @@
+This module improves non-ascii filename interoperability of apache
+(and mod_dav).
+
+It seems many WebDAV clients send filename in its platform-local
+encoding. But since mod_dav expects everything, even HTTP request
+line, to be in UTF-8, this causes an interoperability problem.
+
+I believe this is a future issue for specification (RFC?) to
+standardize encoding used in HTTP request-line and HTTP header, but
+life would be much easier if mod_dav (and others) can handle various
+encodings sent by clients, TODAY. This module does just that.
+
+This module adds following directives: EncodingEngine, SetServerEncoding,
+AddClientEncoding, DefaultClientEncoding, and NormalizeUsername.
+
+Note by maintainer:
+       It also solves the problem with the "hostname\\username"
+       way of authentication that Windows machines do when they
+       attach to a DAV server. See the use of the NormalizeUsername
+       directive.
diff -r 1e9eaf4c89cd -r d7b49de54b25 www/ap2-encoding/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap2-encoding/Makefile Tue Aug 30 12:34:39 2016 +0000
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1 2016/08/30 12:34:39 manu Exp $
+
+DISTNAME=              mod_encoding-20021209
+PKGNAME=               ${APACHE_PKG_PREFIX}-${DISTNAME:S/mod_//}
+CATEGORIES=            www
+MASTER_SITES=          http://webdav.todo.gr.jp/download/
+
+MAINTAINER=            pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=              http://webdav.todo.gr.jp/
+COMMENT=               Non-ascii filename interoperability
+#LICENSE=              # Pending change from Internet Initiative Japan, Inc.
+
+PKG_APACHE_ACCEPTED=   apache22 apache24
+
+APACHE_MODULE_NAME=    ${DISTNAME:C/-.*//}.la
+GNU_CONFIGURE=         yes
+
+DOC_DIR=               share/doc/${DISTNAME:C/-.*//}
+INSTALLATION_DIRS+=    lib/httpd ${DOC_DIR}
+PLIST_SUBST+=           DOC_DIR=${DOC_DIR}
+
+post-install:
+       ${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/${DOC_DIR}
+       ${INSTALL_DATA} ${WRKSRC}/README.JP ${DESTDIR}${PREFIX}/${DOC_DIR}
+
+.include "../../mk/apache.module.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 1e9eaf4c89cd -r d7b49de54b25 www/ap2-encoding/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap2-encoding/PLIST    Tue Aug 30 12:34:39 2016 +0000
@@ -0,0 +1,4 @@
+@comment $NetBSD: PLIST,v 1.1 2016/08/30 12:34:39 manu Exp $
+lib/httpd/mod_encoding.so
+${DOC_DIR}/README
+${DOC_DIR}/README.JP
diff -r 1e9eaf4c89cd -r d7b49de54b25 www/ap2-encoding/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap2-encoding/distinfo Tue Aug 30 12:34:39 2016 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2016/08/30 12:34:39 manu Exp $
+
+SHA1 (mod_encoding-20021209.tar.gz) = 019d112d14e9b3d38aca84010726f8af480a43f5
+RMD160 (mod_encoding-20021209.tar.gz) = b0d731f427bb724c402503e4cbc98d78878b94fe
+SHA512 (mod_encoding-20021209.tar.gz) = 64ba7e15ac62c86560b522fc261d3f1b819af65a56f90016f64c840f1f3997efaa9578b5efcee8a05b4f2a97cecafae107e4d745e88bba76384f6589bf44dba6
+Size (mod_encoding-20021209.tar.gz) = 260587 bytes
+SHA1 (patch-mod_encoding.c) = ac5cd0c12aa9e27fcc4b3f44e00fdef787224c3c
diff -r 1e9eaf4c89cd -r d7b49de54b25 www/ap2-encoding/patches/patch-mod_encoding.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ap2-encoding/patches/patch-mod_encoding.c     Tue Aug 30 12:34:39 2016 +0000
@@ -0,0 +1,541 @@
+$NetBSD: patch-mod_encoding.c,v 1.1 2016/08/30 12:34:40 manu Exp $
+
+Patches for Apache 2 from https://github.com/aosm/apache_mod_encoding2
+
+--- mod_encoding.c.orig
++++ mod_encoding.c
+@@ -4,4 +4,68 @@
+  *
+  */
++/*
++ * mod_encoding core module test implementation for Apache2.
++ *  by Kunio Miyamoto (wakatono%todo.gr.jp@localhost)
++ * Original security fix port 2002/06/06
++ *  by Kunio Miyamoto (wakatono%todo.gr.jp@localhost)
++ * Port new function of 20020611a
++ *  by Kunio Miyamoto (wakatono%todo.gr.jp@localhost)
++ * Port new function of 20020611a
++ *  by Kunio Miyamoto (wakatono%todo.gr.jp@localhost)
++ * Add COPYING statement for redistribute only this code.
++ *  by Kunio Miyamoto (wakatono%todo.gr.jp@localhost)
++ */
++/*
++
++
++Copyright (c) 2000-2004
++Internet Initiative Japan Inc. and Kunio Miyamoto All rights reserved.
++
++Redistribution and use in source and binary forms, with or without
++modification, are permitted provided that the following conditions
++are met:
++
++1. Redistributions of source code must retain the above copyright
++   notice, this list of conditions and the following disclaimer. 
++
++2. Redistributions in binary form must reproduce the above copyright
++   notice, this list of conditions and the following disclaimer in
++   the documentation and/or other materials provided with the
++   distribution.
++
++3. All advertising materials mentioning features or use of this
++   software must display the following acknowledgment:
++
++     This product includes software developed by Internet
++     Initiative Japan Inc. and Kunio Miyamoto for use in the 
++     mod_encoding module for Apache2.
++
++4. Products derived from this software may not be called "mod_encoding"
++   nor may "mod_encoding" appear in their names without prior written
++   permission of Internet Initiative Japan Inc. For written permission,
++   please contact tai%iij.ad.jp@localhost (Taisuke Yamada).
++
++5. Redistributions of any form whatsoever must retain the following
++   acknowledgment:
++
++     This product includes software developed by Internet
++     Initiative Japan Inc. and Kunio Miyamoto for use in the
++     mod_encoding module for Apache2 (http://www.apache.org/).
++
++THIS SOFTWARE IS PROVIDED BY INTERNET INITIATIVE JAPAN INC. AND KUNIO
++MIYAMOTO ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
++BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
++INTERNET INITIATIVE JAPAN INC., KUNIO MIYAMOTO OR ITS CONTRIBUTORS
++BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
++OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
++OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
++BUSINESS INTERRUPTION)
++HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
++OF THE POSSIBILITY OF SUCH DAMAGE.
++
++*/
+ 
+ #include <httpd.h>
+@@ -21,26 +88,21 @@
+  *
+  * Note UTF-8 is the implicit default and will be tried first,
+  * regardless of user configuration.
+  */
++#define DEBUG 0
+ 
+ #ifndef MOD_ENCODING_DEBUG
+-#ifdef DEBUG
++#if DEBUG
+ #define MOD_ENCODING_DEBUG 1
+ #else
+ #define MOD_ENCODING_DEBUG 0
+ #endif
+ #endif
+ 
+ #define DBG(expr) if (MOD_ENCODING_DEBUG) { expr; }
+ 
+-#ifdef __GNUC__
+-#define LOG(level, server, args...) \
+-        ap_log_error(APLOG_MARK, APLOG_NOERRNO|level, server, ##args)
+-#else
+-#define LOG(level, server, ...) \
+-        ap_log_error(APLOG_MARK, APLOG_NOERRNO|level, server, __VA_ARGS__)
+-#endif
++/* FIXME: remove gcc-dependency */
+ 
+ #define ENABLE_FLAG_UNSET 0
+ #define ENABLE_FLAG_OFF   1
+ #define ENABLE_FLAG_ON    2
+@@ -54,15 +116,15 @@
+  */
+ typedef struct {
+   int           enable_function;  /* flag to enable this module */
+   char         *server_encoding;  /* server-side filesystem encoding */
+-  array_header *client_encoding;  /* useragent-to-encoding-list sets */
+-  array_header *default_encoding; /* useragent-to-encoding-list sets */
++  apr_array_header_t *client_encoding;  /* useragent-to-encoding-list sets */
++  apr_array_header_t *default_encoding; /* useragent-to-encoding-list sets */
+ 
+-  int           strip_msaccount;  /* normalize wierd WinXP username */
++ int strip_msaccount;                   /* normalize wierd WinXP username */
+ } encoding_config;
+ 
+-module MODULE_VAR_EXPORT encoding_module;
++module AP_MODULE_DECLARE_DATA encoding_module;
+ 
+ /***************************************************************************
+  * utility methods
+  ***************************************************************************/
+@@ -82,24 +144,21 @@
+   char   *outbuf, *marker;
+   size_t  outlen;
+ 
+   if (srclen == 0) {
+-    LOG(APLOG_DEBUG, r->server, "iconv_string: skipping zero-length input");
+     return srcbuf;
+   }
+ 
+   /* Allocate space for conversion. Note max bloat factor is 4 of UCS-4 */
+-  marker = outbuf = (char *)ap_palloc(r->pool, outlen = srclen * 4 + 1);
++  marker = outbuf = (char *)apr_palloc(r->pool, outlen = srclen * 4 + 1);
+ 
+   if (outbuf == NULL) {
+-    LOG(APLOG_WARNING, r->server, "iconv_string: no more memory");
+     return NULL;
+   }
+ 
+   /* Convert every character within input string. */
+   while (srclen > 0) {
+     if (iconv(cd, &srcbuf, &srclen, &outbuf, &outlen) == (size_t)(-1)) {
+-      LOG(APLOG_DEBUG, r->server, "iconv_string: conversion error");
+       return NULL;
+     }
+   }
+ 
+@@ -139,13 +198,13 @@
+   ap_getparents(r->uri); /* normalize given path for security */
+ 
+   /* Normalize encoding in HTTP request header(s) */
+   for (i = 0 ; keys[i] ; i++) {
+-    if ((buff = (char *)ap_table_get(r->headers_in, keys[i])) != NULL) {
++    if ((buff = (char *)apr_table_get(r->headers_in, keys[i])) != NULL) {
+       ap_unescape_url(buff);
+       if ((buff = iconv_string(r, cd, buff, strlen(buff))) == NULL)
+       return -1;
+-      ap_table_set(r->headers_in, keys[i], buff);
++      apr_table_set(r->headers_in, keys[i], buff);
+     }
+   }
+ 
+   return 0;
+@@ -158,45 +217,39 @@
+  * @param r      Apache request object structure
+  * @param encmap Table of UA-to-encoding(s)
+  * @param lookup Name of the useragent to look for
+  */
+-static array_header *
++static apr_array_header_t *
+ get_client_encoding(request_rec *r,
+-                  array_header *encmap, const char *lookup) {
++                  apr_array_header_t *encmap, const char *lookup) {
+   void         **list = (void **)encmap->elts;
+-  array_header  *encs = ap_make_array(r->pool, 1, sizeof(char *));
++  apr_array_header_t  *encs = apr_array_make(r->pool, 1, sizeof(char *));
+ 
+   int i;
+ 
+-  LOG(APLOG_DEBUG, r->server, "get_client_encoding: entered");
+ 
+   /* push UTF-8 as the first candidate of expected encoding */
+-  *((char **)ap_push_array(encs)) = ap_pstrdup(r->pool, "UTF-8");
++  *((char **)apr_array_push(encs)) = apr_pstrdup(r->pool, "UTF-8");
+ 
+   if (! lookup)
+     return encs;



Home | Main Index | Thread Index | Old Index