Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport memcached from trunk (pull req against trunk) to resolve CVEs #536

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions devel/memcached/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.50 2015/12/08 17:41:56 adam Exp $
# $NetBSD: Makefile,v 1.53 2017/02/16 11:10:53 adam Exp $

DISTNAME= memcached-1.4.25
DISTNAME= memcached-1.5.3
CATEGORIES= devel
MASTER_SITES= http://www.memcached.org/files/

Expand Down
17 changes: 8 additions & 9 deletions devel/memcached/distinfo
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
$NetBSD: distinfo,v 1.26 2015/12/08 17:41:56 adam Exp $
$NetBSD: distinfo,v 1.27 2017/02/16 11:10:53 adam Exp $

SHA1 (memcached-1.4.25.tar.gz) = 7fd0ba9283c61204f196638ecf2e9295688b2314
RMD160 (memcached-1.4.25.tar.gz) = 409abd843ec01d06f0e5cc64aeaa46ec2668699f
SHA512 (memcached-1.4.25.tar.gz) = e037c3bbb68c4077f814f855663501af418ce3b1f8bc20f8e7eba3249aea378e55b3291457952fa4511779ec3702496fdaab5799edae7d59bc64eb6fd54ee14e
Size (memcached-1.4.25.tar.gz) = 359709 bytes
SHA1 (patch-Makefile.am) = 184b10f693f7aa85e3a5922790d1d2c1451c0329
SHA1 (patch-Makefile.in) = 4c21920e41bdad77dc8ff39c62001aea0d73c78a
SHA1 (patch-aa) = c26799e8963177e7ed173c080048dd829c03170e
SHA1 (patch-ab) = 76af28c72db1e2b15da61f04e64464d3b42c5c10
SHA1 (memcached-1.5.3.tar.gz) = 9331ef99f1b7fedfe476062faed8c0ffb5528d8f
RMD160 (memcached-1.5.3.tar.gz) = 037c34da08ffd282709f0dfbd3c6c2f963cba59e
SHA512 (memcached-1.5.3.tar.gz) = b28282c579891e7c5508eb5ab4680b933aa76e8e4a8fe575c996fd4e750f2b4b35ee734d01ae0f280cf4cf6e0530f7f6a95c2e07be3660b07c5ade6ad3c835e2
Size (memcached-1.5.3.tar.gz) = 409131 bytes
SHA1 (patch-Makefile.in) = d1c67f0e4333c16e1541ea5f2e0bc47b9dc2002f
SHA1 (patch-configure) = d44e07c0c38029df4f10bb5411049595b5a8ffbb
SHA1 (patch-items.c) = ee082c7ebe234b3e8cc170e01bca56ed4275e6de
SHA1 (patch-logger.h) = 130c573e07b7d9b6caff1c98e40b36a96cb3c064
SHA1 (patch-memcached.c) = 3c39c873332704c8d269de4a3c7049281bf101c6
3 changes: 1 addition & 2 deletions devel/memcached/files/smf/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='@SMF_NAME@'>
<service_bundle type='manifest' name='export'>
<service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
<create_default_instance enabled='false' />
<single_instance />
Expand All @@ -21,7 +21,6 @@
<propval name='user' type='astring' value='@MEMCACHED_USER@' />
<propval name='memory' type='integer' value='64' />
</property_group>
<stability value='Evolving' />
<template>
<common_name>
<loctext xml:lang='C'>memcached</loctext>
Expand Down
15 changes: 0 additions & 15 deletions devel/memcached/patches/patch-Makefile.am

This file was deleted.

15 changes: 3 additions & 12 deletions devel/memcached/patches/patch-Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@ $NetBSD: patch-Makefile.in,v 1.4 2015/05/21 14:07:10 rodent Exp $
Don't build programs that won't be installed
List test prerequisite.

--- Makefile.in.orig 2015-01-01 07:53:30.000000000 +0000
--- Makefile.in.orig 2017-11-04 21:53:37.000000000 +0000
+++ Makefile.in
@@ -112,7 +112,7 @@ CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+PROGRAMS = $(bin_PROGRAMS)
am__memcached_SOURCES_DIST = memcached.c memcached.h hash.c hash.h \
jenkins_hash.c jenkins_hash.h murmur3_hash.c murmur3_hash.h \
slabs.c slabs.h items.c items.h assoc.c assoc.h thread.c \
@@ -1478,7 +1478,7 @@ memcached_dtrace.o: $(memcached_OBJECTS)
@@ -1729,7 +1729,7 @@ memcached_dtrace.o: $(memcached_OBJECTS)
memcached_debug_dtrace.o: $(memcached_debug_OBJECTS)
$(DTRACE) $(DTRACEFLAGS) -G -o memcached_debug_dtrace.o -s ${srcdir}/memcached_dtrace.d $(memcached_debug_OBJECTS)

-test: memcached-debug sizes testapp
+test: memcached-debug sizes testapp timedrun
$(srcdir)/sizes
$(srcdir)/testapp
prove $(srcdir)/t
@if test -n "${PARALLEL}"; then \
15 changes: 0 additions & 15 deletions devel/memcached/patches/patch-ab

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
$NetBSD: patch-aa,v 1.9 2015/12/08 17:41:56 adam Exp $
$NetBSD: patch-items.c,v 1.1 2017/02/16 11:10:53 adam Exp $

time_t changes

--- items.c.orig 2015-11-20 01:18:56.000000000 +0000
--- items.c.orig 2017-11-04 21:49:54.000000000 +0000
+++ items.c
@@ -460,9 +460,9 @@ char *item_cachedump(const unsigned int
@@ -588,10 +588,10 @@ char *item_cachedump(const unsigned int
/* Copy the key since it may not be null-terminated in the struct */
strncpy(key_temp, ITEM_key(it), it->nkey);
key_temp[it->nkey] = 0x00; /* terminate */
- len = snprintf(temp, sizeof(temp), "ITEM %s [%d b; %lu s]\r\n",
- len = snprintf(temp, sizeof(temp), "ITEM %s [%d b; %llu s]\r\n",
+ len = snprintf(temp, sizeof(temp), "ITEM %s [%d b; %jd s]\r\n",
key_temp, it->nbytes - 2,
- (unsigned long)it->exptime + process_started);
it->exptime == 0 ? 0 :
- (unsigned long long)it->exptime + process_started);
+ (intmax_t)it->exptime + process_started);
if (bufcurr + len + 6 > memlimit) /* 6 is END\r\n\0 */
break;
memcpy(buffer + bufcurr, temp, len);
@@ -576,13 +576,13 @@ void item_stats(ADD_STAT add_stats, void
if (settings.expirezero_does_not_evict)
APPEND_NUM_FMT_STAT(fmt, n, "number_noexp", "%u", lru_size_map[3]);
@@ -768,13 +768,13 @@ void item_stats(ADD_STAT add_stats, void
APPEND_NUM_FMT_STAT(fmt, n, "age_hot", "%u", age_hot);
APPEND_NUM_FMT_STAT(fmt, n, "age_warm", "%u", age_warm);
}
- APPEND_NUM_FMT_STAT(fmt, n, "age", "%u", age);
+ APPEND_NUM_FMT_STAT(fmt, n, "age", "%jd", age);
Expand Down
15 changes: 15 additions & 0 deletions devel/memcached/patches/patch-logger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$NetBSD: patch-logger.h,v 1.1 2017/02/16 11:10:53 adam Exp $

time_t changes

--- logger.h.orig 2017-02-16 11:07:55.000000000 +0000
+++ logger.h
@@ -11,7 +11,7 @@
#define GET_LOGGER() ((logger *) pthread_getspecific(logger_key));

/* Inlined from memcached.h - should go into sub header */
-typedef unsigned int rel_time_t;
+typedef intmax_t rel_time_t;

enum log_entry_type {
LOGGER_ASCII_CMD = 0,