Commit 190b2e94 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Merge remote-tracking branch 'origin/master' into erp5-cluster

parents 8e7b502c fd2c4d47
[buildout]
parts =
binutils
extends =
../bison/buildout.cfg
../zlib/buildout.cfg
[binutils]
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/binutils/binutils-2.21.1.tar.bz2
md5sum = bde820eac53fa3a8d8696667418557ad
environment =
PATH=${bison:location}/bin:%(PATH)s
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
......@@ -10,8 +10,8 @@ parts =
[dbus]
recipe = slapos.recipe.cmmi
url = http://dbus.freedesktop.org/releases/dbus/dbus-1.8.10.tar.gz
md5sum = 6be5ef99ae784de9d04589eb067fe038
url = http://dbus.freedesktop.org/releases/dbus/dbus-1.8.12.tar.gz
md5sum = 0ca23fc84c09cb3d29b9c27811ff4475
location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-options =
--disable-static
......
......@@ -2,10 +2,8 @@
# Mostly required to support languages different than C or C++
[buildout]
extends =
../m4/buildout.cfg
../gmp/buildout.cfg
../xz-utils/buildout.cfg
../zip/buildout.cfg
parts =
gcc
......
......@@ -2,7 +2,6 @@
extends =
../fontconfig/buildout.cfg
../freetype/buildout.cfg
../libjpeg/buildout.cfg
../libtiff/buildout.cfg
../libxml2/buildout.cfg
../pkgconfig/buildout.cfg
......
......@@ -6,19 +6,14 @@ parts =
graphviz
extends =
../bzip2/buildout.cfg
../fontconfig/buildout.cfg
../freetype/buildout.cfg
../libpng/buildout.cfg
../glib/buildout.cfg
../gtk-2/buildout.cfg
../pkgconfig/buildout.cfg
../xorg/buildout.cfg
../zlib/buildout.cfg
[graphviz]
recipe = slapos.recipe.cmmi
url = http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.36.0.tar.gz
md5sum = 1f41664dba0c93109ac8b71216bf2b57
url = http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.38.0.tar.gz
md5sum = 5b6a829b2ac94efcd5fa3c223ed6d3ae
pkg_config_depends = ${pango:location}/lib/pkgconfig:${pango:pkg_config_depends}
configure-options =
--with-included-ltdl
......
[buildout]
extends =
../autoconf/buildout.cfg
../libtool/buildout.cfg
../automake/buildout.cfg
../bzip2/buildout.cfg
../fontconfig/buildout.cfg
......@@ -12,7 +11,7 @@ extends =
../libjpeg/buildout.cfg
../libpng/buildout.cfg
../libtiff/buildout.cfg
../libxml2/buildout.cfg
../libtool/buildout.cfg
../perl/buildout.cfg
../pkgconfig/buildout.cfg
../xorg/buildout.cfg
......
[buildout]
extends =
../bzip2/buildout.cfg
../fontconfig/buildout.cfg
../freetype/buildout.cfg
../glibmm/buildout.cfg
../gtk-2/buildout.cfg
../libpng/buildout.cfg
../libxml2/buildout.cfg
../perl/buildout.cfg
../xorg/buildout.cfg
../xz-utils/buildout.cfg
../zlib/buildout.cfg
parts =
gtkmm
......
......@@ -5,7 +5,6 @@ extends =
../bzip2/buildout.cfg
../freetype/buildout.cfg
../garbage-collector/buildout.cfg
../gcc/buildout.cfg
../gettext/buildout.cfg
../glibmm/buildout.cfg
../gtk-2/buildout.cfg
......
Description: CVE-2014-9029: Heap overflows in libjasper
Origin: vendor
Forwarded: no
Author: Tomas Hoger <thoger@redhat.com>
Reviewed-by: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2014-11-28
--- a/src/libjasper/jpc/jpc_dec.c
+++ b/src/libjasper/jpc/jpc_dec.c
@@ -1280,7 +1280,7 @@ static int jpc_dec_process_coc(jpc_dec_t
jpc_coc_t *coc = &ms->parms.coc;
jpc_dec_tile_t *tile;
- if (JAS_CAST(int, coc->compno) > dec->numcomps) {
+ if (JAS_CAST(int, coc->compno) >= dec->numcomps) {
jas_eprintf("invalid component number in COC marker segment\n");
return -1;
}
@@ -1306,7 +1306,7 @@ static int jpc_dec_process_rgn(jpc_dec_t
jpc_rgn_t *rgn = &ms->parms.rgn;
jpc_dec_tile_t *tile;
- if (JAS_CAST(int, rgn->compno) > dec->numcomps) {
+ if (JAS_CAST(int, rgn->compno) >= dec->numcomps) {
jas_eprintf("invalid component number in RGN marker segment\n");
return -1;
}
@@ -1355,7 +1355,7 @@ static int jpc_dec_process_qcc(jpc_dec_t
jpc_qcc_t *qcc = &ms->parms.qcc;
jpc_dec_tile_t *tile;
- if (JAS_CAST(int, qcc->compno) > dec->numcomps) {
+ if (JAS_CAST(int, qcc->compno) >= dec->numcomps) {
jas_eprintf("invalid component number in QCC marker segment\n");
return -1;
}
......@@ -13,6 +13,7 @@ patches =
${:_profile_base_location_}/misc-fixes.patch#1202be8418907dfe58f819f7b47da24f
${:_profile_base_location_}/fix-filename-buffer-overflow.patch#38403f9c82a18547beca16c9c6f4ce7a
${:_profile_base_location_}/CVE-2011-4516-and-CVE-2011-4517.patch#a9676718ed016f66a3c76acf764c9e72
${:_profile_base_location_}/CVE-2014-9029.patch#d69195cf17878f024cc0b580045ec314
# jasper configure script is not executable by default
configure-command =
/bin/sh ./configure --prefix=${buildout:parts-directory}/${:_buildout_section_name_} --disable-static --enable-shared --disable-opengl
......
......@@ -6,7 +6,6 @@ extends =
../bzip2/buildout.cfg
../imagemagick/buildout.cfg
../jbigkit/buildout.cfg
../libpng/buildout.cfg
../zlib/buildout.cfg
parts =
libdmtx
......
......@@ -2,13 +2,11 @@
parts = librsvg
extends =
../bzip2/buildout.cfg
../pkgconfig/buildout.cfg
../libpng/buildout.cfg
../libxml2/buildout.cfg
../zlib/buildout.cfg
../gtk-2/buildout.cfg
../xorg/buildout.cfg
../libxml2/buildout.cfg
../pkgconfig/buildout.cfg
../xz-utils/buildout.cfg
../zlib/buildout.cfg
[libcroco]
recipe = slapos.recipe.cmmi
......
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
parts =
make
[make]
# make 3.82 breaks too many things. Stick with 3.81.
......
......@@ -11,8 +11,8 @@ parts = nginx-output
[nginx-common]
recipe = slapos.recipe.cmmi
url = http://nginx.org/download/nginx-1.7.7.tar.gz
md5sum = 3beaa25fc87ff2a75ab1b46174dc5ebf
url = http://nginx.org/download/nginx-1.7.8.tar.gz
md5sum = fd5ab813fc1853cd8efe580ead577c3e
[nginx]
<= nginx-common
......
......@@ -4,8 +4,6 @@ extends =
../gcc/buildout.cfg
../libatlas/buildout.cfg
version = versions
[numpy-env]
PATH = ${gcc-fortran:location}/bin:%(PATH)s
BLAS = ${libatlas:location}/lib/libcblas.a
......
......@@ -3,12 +3,10 @@ parts = poppler
extends =
../bzip2/buildout.cfg
../fontconfig/buildout.cfg
../freetype/buildout.cfg
../jbigkit/buildout.cfg
../libjpeg/buildout.cfg
../libpng/buildout.cfg
../libtiff/buildout.cfg
../libxml2/buildout.cfg
../pkgconfig/buildout.cfg
../xz-utils/buildout.cfg
../zlib/buildout.cfg
......
......@@ -41,6 +41,7 @@ patch-options = -p1
patches =
${:_profile_base_location_}/tls_sni.patch#c95af105e6e96aaa58a50137595872a0
${:_profile_base_location_}/tls_sni_httplib.patch#5c9d00d23b85169df792a936a056cbcc
${:_profile_base_location_}/fix_compiler_module_issue_20613.patch#94443a77f903e9de880a029967fa6aa7
url =
http://python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.xz
configure-options =
......
This diff is collapsed.
......@@ -5,7 +5,6 @@ extends =
../../stack/slapos.cfg
../../component/dash/buildout.cfg
../../component/binutils/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/apache/buildout.cfg
../../component/gzip/buildout.cfg
......@@ -25,7 +24,6 @@ parts +=
template
template-apache-frontend
template-apache-replicate
binutils
apache-2.2
apache-antiloris-apache-2.2
......
......@@ -12,7 +12,7 @@ gitdb = 0.5.4
plone.recipe.command = 1.1
pycrypto = 2.6.1
rdiff-backup = 1.0.5
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
slapos.toolbox = 0.40.4
smmap = 0.8.2
......
......@@ -61,7 +61,7 @@ md5sum = 22ffc8e212dcf2db8ad94cf0e5ac4772
PyXML = 0.8.5
erp5.util = 0.4.42
slapos.cookbook = 0.92
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
# Required by:
# slapos.cookbook==0.92
......
......@@ -48,4 +48,4 @@ PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3
collective.recipe.template = 1.11
plone.recipe.command = 1.1
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
......@@ -76,7 +76,7 @@ eggs =
PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3
plone.recipe.command = 1.1
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
z3c.recipe.scripts = 1.0.1
apache-libcloud = 0.16.0
......
......@@ -43,4 +43,4 @@ mode = 0644
[versions]
plone.recipe.command = 1.1
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
......@@ -64,4 +64,4 @@ PyRSS2Gen = 1.1
cns.recipe.symlink = 0.2.3
collective.recipe.template = 1.11
plone.recipe.command = 1.1
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
......@@ -47,4 +47,4 @@ mode = 0644
[versions]
plone.recipe.command = 1.1
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
......@@ -12,4 +12,4 @@ Pygments = 1.6
collective.recipe.environment = 0.2.0
collective.recipe.template = 1.10
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
......@@ -83,4 +83,4 @@ mode = 640
Pygments = 1.6
collective.recipe.template = 1.10
plone.recipe.command = 1.1
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
......@@ -59,7 +59,7 @@ eggs = collective.recipe.template
collective.recipe.template = 1.11
plone.recipe.command = 1.1
slapos.recipe.build = 0.13
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
# Replicate slapos stack, but without shacache to not have to compile the entire world for a simple test.
[buildout]
......
......@@ -81,7 +81,7 @@ WSGIUtils = 0.7
plone.recipe.command = 1.1
python-magic = 0.4.6
rdiff-backup = 1.0.5
slapos.recipe.template = 2.5
slapos.recipe.template = 2.6
# Required by:
# PasteScript==1.7.5
......
......@@ -48,7 +48,7 @@ mode = 0644
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
download-only = true
md5sum = cb2f15850d3dc82459a0044adb4416cf
md5sum = 5b12e864f1762d7984f7d4863d0b795d
destination = ${buildout:parts-directory}/monitor-template-monitor-bin
filename = monitor.py.in
mode = 0644
......
#!{{ python_executable }}
import datetime
import json
import os
import subprocess
......@@ -36,30 +35,32 @@ option_list = [
]
class Popen(subprocess.Popen):
__timeout = None
def timeout(self, delay, delay_before_kill=5):
if self.__timeout is not None: self.__timeout.cancel()
self.__timeout = threading.Timer(delay, self.stop, [delay_before_kill])
self.__timeout.start()
def waiter():
self.wait()
self.__timeout.cancel()
threading.Thread(target=waiter).start()
def stop(self, delay_before_kill=5):
if self.__timeout is not None: self.__timeout.cancel()
self.terminate()
t = threading.Timer(delay_before_kill, self.kill)
t.start()
r = self.wait()
t.cancel()
return r
def init_db():
db = sqlite3.connect(db_path)
c = db.cursor()
c.executescript("""
def set_timeout(self, timeout):
self.set_timeout = None # assert we're not called twice
event = threading.Event()
event.__killed = False # we just need a mutable
def t():
# do not call wait() or poll() because they're not thread-safe
if not event.wait(timeout) and self.returncode is None:
# race condition if waitpid completes just before the signal sent ?
self.terminate()
event.__killed = True
if event.wait(5):
return
if self.returncode is None:
self.kill() # same race as for terminate ?
t = threading.Thread(target=t)
t.daemon = True
t.start()
def killed():
event.set()
t.join()
return event.__killed
return killed
def init_db(db):
db.executescript("""
CREATE TABLE IF NOT EXISTS status (
timestamp INTEGER UNIQUE,
status VARCHAR(255));
......@@ -69,8 +70,6 @@ CREATE TABLE IF NOT EXISTS individual_status (
element VARCHAR(255),
output TEXT);
""")
db.commit()
db.close()
def getListOfScripts(directory):
"""
......@@ -109,59 +108,43 @@ def runServices(directory):
def runScripts(directory):
scripts = getListOfScripts(directory)
# XXX script_timeout could be passed as parameters
script_timeout = 60 # in seconds
result = {}
for script in scripts:
command = [os.path.join(promise_dir, script)]
script = os.path.basename(command[0])
result[script] = ''
process_handler = Popen(command,
cwd=instance_path,
env=None if sys.platform == 'cygwin' else {},
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE)
process_handler.stdin.flush()
process_handler.stdin.close()
process_handler.stdin = None
process_handler.timeout(script_timeout)
process_handler.wait()
if process_handler.poll() is None:
process_handler.terminate()
result[script] = "Time Out"
elif process_handler.poll() != 0:
stderr = process_handler.communicate()[1]
if stderr is not None:
with open(os.devnull, 'r+') as f:
for script in getListOfScripts(directory):
command = os.path.join(promise_dir, script),
script = os.path.basename(script)
result[script] = ''
p = Popen(command, cwd=instance_path,
env=None if sys.platform == 'cygwin' else {},
stdin=f, stdout=f, stderr=subprocess.PIPE)
killed = p.set_timeout(script_timeout)
stderr = p.communicate()[1]
if killed():
result[script] = "Time Out"
elif p.returncode:
result[script] = stderr.strip()
return result
def writeFiles(monitors):
timestamp = int(time.time())
date = datetime.datetime.now().ctime()
init_db()
db = sqlite3.connect(db_path)
fail = False
init_db(db)
status = SUCCESS
for key, value in monitors.iteritems():
element_status = SUCCESS
if value != "" :
fail = True
element_status = FAILURE
if value:
element_status = status = FAILURE
else:
element_status = SUCCESS
db.execute("insert into individual_status(timestamp, element, output, status) values (?, ?, ?, ?)", (timestamp, key, value, element_status))
db.commit()
status = SUCCESS
if fail:
status = FAILURE
db.execute("insert into status(timestamp, status) values (?, ?)", (timestamp, status))
db.commit()
db.close()
monitors['datetime'] = date
open(monitoring_file_json, "w+").write(json.dumps(monitors))
monitors['datetime'] = time.ctime(timestamp)
json.dump(monitors, open(monitoring_file_json, "w+"))
def main():
parser = OptionParser(option_list=option_list)
......@@ -183,10 +166,6 @@ def main():
print json.dumps(monitors)
else:
writeFiles(monitors)
if len(monitors) == 0:
exit(0)
else:
exit(1)
if __name__ == "__main__":
......
......@@ -100,7 +100,7 @@ eggs =
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.7.1-dev-SlapOS-003
zc.buildout = 1.7.1-dev-SlapOS-004
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 1.3.2nxd001
# Use own version of h.r.download to be able to open xz-like archives
......@@ -111,7 +111,7 @@ MarkupSafe = 0.23
Werkzeug = 0.9.6
buildout-versions = 1.7
cffi = 0.8.6
cmd2 = 0.6.7
cmd2 = 0.6.8
cryptography = 0.6
itsdangerous = 0.24
lxml = 3.4.1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment