1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-19 08:13:21 +00:00

Change type of pointers from int to uintptr_t for support 64 bit platforms.

Use system regexp library.
Add implementation of REPORT method.

While I'm here, convert pkginstall script into USERS/GROUPS macro and
remove needless script.  Use bsd.options.mk.

Bump PORTREVISION.

Tested by:	Dmitry Afanasiev <KOT@MATPOCKuH.Ru>
Approved by:	maintainer (timeout > 2 weeks)
PRs:		163317, 164018
This commit is contained in:
Sergey A. Osokin 2012-02-02 13:05:19 +00:00
parent cef3e449d2
commit 1c96f7c440
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=290294
4 changed files with 271 additions and 10 deletions

1
UIDs
View File

@ -228,4 +228,5 @@ zenoss:*:949:949::0:0:& user:/usr/local/zenoss:/bin/sh
openerpd:*:951:951::0:0:Openerpd user:/nonexistent:/usr/sbin/nologin
bitten-slave:*:952:952:daemon:0:0:Bitten slave user:/var/lib/bitten-slave:/usr/sbin/nologin
_neubot:*:953:953::0:0:neubot daemon:/nonexistent:/usr/sbin/nologin
oops:*:954:65534::0:0:oops user:/nonexistent:/usr/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin

View File

@ -1,13 +1,13 @@
# New ports collection makefile for: oops
# Date created: 15 August 2000
# Whom: Sergey Osokin aka oZZ <osa@FreeBSD.org.ru>
# Whom: osa
#
# $FreeBSD$
#
PORTNAME= oops
PORTVERSION= ${OOPSVERSION}
PORTREVISION= 7
PORTREVISION= 8
CATEGORIES= www
MASTER_SITES= http://oops-cache.org/ \
ftp://kucha.ru/pub/misc/oops/
@ -26,13 +26,17 @@ CONFIGURE_ARGS?=--sbindir=${PREFIX}/sbin \
--sysconfdir=${PREFIX}/etc/oops \
--localstatedir=${OOPSVAR} \
--libdir=${PREFIX}/libexec/oops \
--enable-oops-user=oops \
--enable-large-files
--enable-oops-user=${USERS} \
--enable-large-files \
--with-regexp=system
CONFIGURE_ENV+= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}"
CFLAGS+= -fPIC
CXXFLAGS+= -fPIC
USERS= oops
GROUPS= nobody
OOPSVAR= /var/run/oops
OOPSLOG= /var/log/oops
.if !defined(NO_INSTALL_MANPAGES)
@ -49,7 +53,7 @@ OPTIONS= GIGABASE "GigaBase storage" on \
PGSQL "PostgreSQL auth support" off \
PCRE "PCRE support" off
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
.if !defined(WITHOUT_GIGABASE)
.if defined (WITH_DB4)
@ -87,15 +91,11 @@ CONFIGURE_ARGS+= --with-regexp=pcre
pre-configure:
@cd ${WRKSRC} && ${AUTOHEADER}
pre-install:
@PKG_PREFIX=${PREFIX} BATCH=${BATCH} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
.if !defined(NO_INSTALL_MANPAGES)
@${INSTALL_MAN} ${WRKSRC}/doc/oops.8 ${PREFIX}/man/man8
@${INSTALL_MAN} ${WRKSRC}/doc/oopsctl.8 ${PREFIX}/man/man8
.endif
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${MKDIR} -m 750 ${OOPSVAR}
@${CHOWN} oops ${OOPSVAR}
@${MKDIR} -m 750 ${OOPSLOG}
@ -106,4 +106,4 @@ post-install:
post-clean:
@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -0,0 +1,38 @@
diff -ruN oops.orig/files/patch-src_methodreport oops/files/patch-src_methodreport
--- oops.orig/files/patch-src_methodreport 1970-01-01 03:00:00.000000000 +0300
+++ oops/files/patch-src_methodreport 2012-01-11 18:09:44.517662295 +0400
@@ -0,0 +1,34 @@
+diff -ruN src.orig/http_utils.c src/http_utils.c
+--- src.orig/http_utils.c 2012-01-11 18:04:20.773665172 +0400
++++ src/http_utils.c 2012-01-11 18:07:47.378664712 +0400
+@@ -120,6 +120,7 @@
+ else if ( rq->meth == METH_MOVE ) meth="MOVE";
+ else if ( rq->meth == METH_LOCK ) meth="LOCK";
+ else if ( rq->meth == METH_UNLOCK ) meth="UNLOCK";
++ else if ( rq->meth == METH_REPORT ) meth="REPORT";
+ else
+ return;
+ IF_STRDUP(rq->tag, "TCP_MISS");
+diff -ruN src.orig/oops.h src/oops.h
+--- src.orig/oops.h 2012-01-11 18:04:20.752662579 +0400
++++ src/oops.h 2012-01-11 18:05:59.183668229 +0400
+@@ -224,6 +224,7 @@
+ #define METH_OPTIONS 15
+ #define METH_PURGE_SITE 16
+ #define METH_PURGE_SITE_R 17
++#define METH_REPORT 18
+
+ #define AND_PUT 1
+ #define AND_USE 2
+diff -ruN src.orig/run_client.c src/run_client.c
+--- src.orig/run_client.c 2012-01-11 18:04:20.816667134 +0400
++++ src/run_client.c 2012-01-11 18:08:03.998664367 +0400
+@@ -1201,6 +1201,8 @@
+ rq->meth = METH_PURGE_SITE_R;
+ else if (!strcasecmp(src, "OPTIONS"))
+ rq->meth = METH_OPTIONS;
++ else if (!strcasecmp(src, "REPORT"))
++ rq->meth = METH_REPORT;
+ else {
+ my_xlog(OOPS_LOG_SEVERE, "parse_http_request(): Unrecognized method `%s'.\n", src);
+ *p = ' ';

222
www/oops/files/patch-x64 Normal file
View File

@ -0,0 +1,222 @@
diff -ruN src.orig/hash.c src/hash.c
--- src.orig/hash.c 2011-12-15 19:50:59.084410154 +0400
+++ src/hash.c 2011-12-15 19:27:15.384413000 +0400
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <string.h>
#include <strings.h>
#include "hash.h"
@@ -37,7 +38,7 @@
int
hash_put(hash_t *hash, void *key, void *data, hash_entry_t **res)
{
-unsigned int index = 0;
+uintptr_t index = 0;
hash_entry_t *he = NULL;
hash_row_t *row = NULL;
int rc = 0;
@@ -48,7 +49,7 @@
if ( hash->valid != HASH_VALID ) return(EINVAL);
switch(hash->type) {
case HASH_KEY_INT:
- index = (unsigned int)key % hash->rows;
+ index = (uintptr_t)key % hash->rows;
break;
case HASH_KEY_STRING:
index = string_hash((char*)key) % hash->rows;
@@ -65,7 +66,7 @@
while ( he ) {
switch(hash->type) {
case(HASH_KEY_INT):
- if ( (int)he->key == (int)key ) {
+ if ( he->key == key ) {
rc = EEXIST;
goto done;
}
@@ -122,7 +123,7 @@
int
hash_get(hash_t *hash, void *key, hash_entry_t **he_res)
{
-unsigned int index = 0;
+uintptr_t index = 0;
hash_entry_t *he = NULL;
hash_row_t *row = NULL;
int rc = 0;
@@ -134,7 +135,7 @@
if ( hash->valid != HASH_VALID ) return(EINVAL);
switch(hash->type) {
case HASH_KEY_INT:
- index = (unsigned int)key % hash->rows;
+ index = (uintptr_t)key % hash->rows;
break;
case HASH_KEY_STRING:
index = string_hash((char*)key) % hash->rows;
@@ -155,7 +156,7 @@
}
switch(hash->type) {
case(HASH_KEY_INT):
- if ( (int)he->key == (int)key ) {
+ if ( he->key == key ) {
he->ref_count++;
*he_res = he;
goto done;
diff -ruN src.orig/icp.c src/icp.c
--- src.orig/icp.c 2011-12-15 19:50:59.097408824 +0400
+++ src/icp.c 2011-12-15 19:23:18.626418000 +0400
@@ -36,7 +36,7 @@
int version:8;
short msg_len;
} w0;
- int rq_n;
+ uintptr_t rq_n;
int opt;
int opt_data;
int sender;
@@ -45,15 +45,15 @@
struct icp_lookup {
struct sockaddr_in sa;
char type;
- int rq_n;
+ uintptr_t rq_n;
};
static struct peer *peer_by_addr(struct sockaddr_in*);
static int process_hit(struct icp_lookup *icp_lookup, struct icp_queue_elem *qe);
static void process_icp_msg(int so, char *buf, int len, struct sockaddr_in *, struct sockaddr_in *);
static int process_miss(struct icp_lookup *icp_lookup, struct icp_queue_elem *qe);
-static void send_icp_op(int so, struct sockaddr_in *sa, int op, int rq_n, char *urlp);
-static void send_icp_op_err(int so, struct sockaddr_in *sa, int rq_n);
+static void send_icp_op(int so, struct sockaddr_in *sa, int op, uintptr_t rq_n, char *urlp);
+static void send_icp_op_err(int so, struct sockaddr_in *sa, uintptr_t rq_n);
#define icp_opcode icp_hdr->w0.opcode
@@ -473,7 +473,7 @@
}
static void
-send_icp_op_err(int so, struct sockaddr_in *sa, int rq_n)
+send_icp_op_err(int so, struct sockaddr_in *sa, uintptr_t rq_n)
{
char buf[5*4];
int len = sizeof(buf);
@@ -488,7 +488,7 @@
}
static void
-send_icp_op(int so, struct sockaddr_in *sa, int op, int rq_n, char *urlp)
+send_icp_op(int so, struct sockaddr_in *sa, int op, uintptr_t rq_n, char *urlp)
{
char *buf;
int len = strlen(urlp)+1 + sizeof(struct icp_hdr);
@@ -545,7 +545,7 @@
static int
process_miss(struct icp_lookup *icp_lookup, struct icp_queue_elem *qe)
{
-int rq_n;
+uintptr_t rq_n;
if ( !qe || !icp_lookup ) return(0);
rq_n = icp_lookup->rq_n;
@@ -578,7 +578,7 @@
static int
process_hit(struct icp_lookup *icp_lookup, struct icp_queue_elem *qe)
{
-int rq_n;
+uintptr_t rq_n;
if ( !qe || !icp_lookup ) return(0);
rq_n = icp_lookup->rq_n;
diff -ruN src.orig/oops.h src/oops.h
--- src.orig/oops.h 2011-12-15 19:50:59.092410511 +0400
+++ src/oops.h 2011-12-15 19:32:49.781410000 +0400
@@ -839,8 +839,8 @@
struct acls *http;
struct acls *icp;
struct badports *badports;
- int bandwidth;
- int miss_deny; /* TRUE if deny */
+ uintptr_t bandwidth;
+ uintptr_t miss_deny; /* TRUE if deny */
struct l_string_list *auth_mods; /* auth modules */
l_mod_call_list_t *redir_mods; /* redir modules */
pthread_mutex_t group_mutex;
@@ -852,10 +852,10 @@
struct denytime *denytimes;
hash_t *dstdomain_cache; /* cashe for dstdom checks */
acl_chk_list_hdr_t *networks_acl;
- int maxreqrate; /* max request rate */
- int per_sess_bw; /* max bandw per session */
- int per_ip_bw; /* bandw per ip address (or client) */
- int per_ip_conn; /* max number of conns per ip */
+ uintptr_t maxreqrate; /* max request rate */
+ uintptr_t per_sess_bw; /* max bandw per session */
+ uintptr_t per_ip_bw; /* bandw per ip address (or client) */
+ uintptr_t per_ip_conn; /* max number of conns per ip */
struct sockaddr_in conn_from_sa; /* connect from address */
};
@@ -922,7 +922,7 @@
/* url in icp format */
char *url;
/* request number - id of request */
- int rq_n;
+ uintptr_t rq_n;
/* how much peers was sent request to *
* (we will wait that many answers) */
int requests_sent;
@@ -1014,7 +1014,7 @@
#define IS_HUPED(a) (((a)->answer)&FD_POLL_HU)
struct pollarg {
- int fd;
+ uintptr_t fd;
short request;
short answer;
};
diff -ruN src.orig/parser.y src/parser.y
--- src.orig/parser.y 2011-12-15 19:50:59.089409966 +0400
+++ src/parser.y 2011-12-15 19:45:36.266416000 +0400
@@ -69,7 +69,7 @@
%}
%union {
- int INT;
+ uintptr_t INT;
char *STRPTR;
char CHAR;
struct cidr_net *NETPTR;
@@ -907,26 +907,26 @@
new_grp->badports = ops->val;
break;
case OP_BANDWIDTH:
- new_grp->bandwidth = (int)ops->val;
+ new_grp->bandwidth = (uintptr_t)ops->val;
break;
case OP_PER_SESS_BW:
- new_grp->per_sess_bw = (int)ops->val;
+ new_grp->per_sess_bw = (uintptr_t)ops->val;
break;
case OP_PER_IP_BW:
- new_grp->per_ip_bw = (int)ops->val;
+ new_grp->per_ip_bw = (uintptr_t)ops->val;
break;
case OP_PER_IP_CONN:
- new_grp->per_ip_conn = (int)ops->val;
+ new_grp->per_ip_conn = (uintptr_t)ops->val;
break;
case OP_CONN_FROM:
memcpy(&new_grp->conn_from_sa, ops->val, sizeof(new_grp->conn_from_sa));
free(ops->val);
break;
case OP_MISS:
- new_grp->miss_deny = (int)ops->val;
+ new_grp->miss_deny = (uintptr_t)ops->val;
break;
case OP_MAXREQRATE:
- new_grp->maxreqrate = (int)ops->val;
+ new_grp->maxreqrate = (uintptr_t)ops->val;
break;
case OP_AUTH_MODS:
if ( ops->val ) {