initial import
This commit is contained in:
76
partimage/PKGBUILD
Normal file
76
partimage/PKGBUILD
Normal file
@@ -0,0 +1,76 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=partimage
|
||||
pkgver=0.6.9
|
||||
_debver=$pkgver
|
||||
_debrel=8
|
||||
pkgrel=12
|
||||
pkgdesc="Partition Image saves partitions in many formats to an image file."
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://www.partimage.org/'
|
||||
license=('GPL-2')
|
||||
depends=('libnewt' 'bzip2' 'libressl')
|
||||
makedepends=('quilt')
|
||||
backup=('etc/partimaged/partimagedusers'
|
||||
'etc/conf.d/partimaged')
|
||||
install='partimage.install'
|
||||
source=("https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
|
||||
"https://deb.debian.org/debian/pool/main/p/partimage/partimage_${_debver}-${_debrel}.debian.tar.xz"
|
||||
"partimage-0.6.9-zlib-1.2.6.patch"
|
||||
"use-SSLv3-by-default.patch"
|
||||
"partimaged-gencrt"
|
||||
"partimaged.confd"
|
||||
"partimaged.initd")
|
||||
sha512sums=('252885921b23933fdcdf0bb6efa4b82066b08ca95cc653296912d384ae875b421c1d39f347a90115315139176d4eab4a930c24919c2d38cf00ed29c764cd14d9'
|
||||
'9a3e77425f7482e0e08225af27d6c2375317c377a9c81710ea246c5f621076cb6c608b4c78875c4bbbacdbdb8855a8f89afa4561172b72f112bae84f7b05432c'
|
||||
'257354c109fda489ad1aa30da19d3bc5189d6098bd5641aa079a3319201e30fc8501fef7952cb9ae59eca8760b18f94fc5570a0a27773b595cabea2815156c27'
|
||||
'580d9ef868b423fd77282839f619239f92789e202fc25cb2ee409ecc43424f89bd5d31314a6aba183ef36a61b427cb24a0ca1f62f53235b5bc60f574c5469a1b'
|
||||
'3b8085ca27d550c00312a5059daceae10d33a863a15883181182eaf5f3ffac2e60b802cacb20f56a40388f97d85769549e408dbe4b387ad332786c04e9dfdc75'
|
||||
'1be320a8dceb3076e6aa2d8b1a8a4d01a380ad1209133997fd0d87cf1d0974fc4877c3c8b41c07fbb99249c8a00132f2c5fa7ffadf26f4e41cc2abfcd6b62116'
|
||||
'59165d373271b3f47d21217891cc5f5b37d9c57ae667c4a763aedd69cbcb54d2da190d67da0e08a161f91e5d99461dde7e142378d7a9c91968d7eb765555ba95')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
quilt push -av
|
||||
else
|
||||
patch -Np1 -i "${srcdir}/partimage-0.6.9-zlib-1.2.6.patch"
|
||||
patch -Np1 -i "${srcdir}/use-SSLv3-by-default.patch"
|
||||
|
||||
sed -e 's/CRYPTO_lock/X509_new/g' -i configure
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
install -Dm0644 COPYING "${pkgdir}/usr/share/licenses/partimage/COPYING"
|
||||
|
||||
install -Dm0755 "${srcdir}/partimaged-gencrt" "${pkgdir}/usr/sbin/partimaged-gencrt"
|
||||
|
||||
chmod 644 "${pkgdir}/etc/partimaged/partimagedusers"
|
||||
chown 110:110 "${pkgdir}/etc/partimaged/partimagedusers"
|
||||
|
||||
install -Dm0644 "${srcdir}/partimaged.confd" "${pkgdir}/etc/conf.d/partimaged"
|
||||
install -Dm0755 "${srcdir}/partimaged.initd" "${pkgdir}/etc/init.d/partimaged"
|
||||
}
|
||||
35
partimage/partimage-0.6.9-zlib-1.2.6.patch
Normal file
35
partimage/partimage-0.6.9-zlib-1.2.6.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
diff --git a/src/client/imagefile.cpp b/src/client/imagefile.cpp
|
||||
index dd83411..62d0f72 100644
|
||||
--- a/src/client/imagefile.cpp
|
||||
+++ b/src/client/imagefile.cpp
|
||||
@@ -783,7 +783,7 @@ void CImage::openWriting()
|
||||
else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
|
||||
{
|
||||
showDebug(1, "open gzip\n");
|
||||
- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h");
|
||||
+ m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h");
|
||||
if (m_gzImageFile == NULL)
|
||||
{
|
||||
showDebug(1, "error:%d %s\n", errno, strerror(errno));
|
||||
@@ -1098,7 +1098,7 @@ void CImage::openReading(CVolumeHeader *vh /* = NULL */)
|
||||
}
|
||||
else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
|
||||
{
|
||||
- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb");
|
||||
+ m_gzImageFile = gzdopen(m_nFdImage, "rb");
|
||||
if (m_gzImageFile == NULL)
|
||||
THROW(ERR_ERRNO, errno);
|
||||
else
|
||||
diff --git a/src/client/imagefile.h b/src/client/imagefile.h
|
||||
index 4ba8910..6adb098 100644
|
||||
--- a/src/client/imagefile.h
|
||||
+++ b/src/client/imagefile.h
|
||||
@@ -41,7 +41,7 @@ class CImage
|
||||
COptions m_options;
|
||||
|
||||
FILE *m_fImageFile;
|
||||
- gzFile *m_gzImageFile;
|
||||
+ gzFile m_gzImageFile;
|
||||
BZFILE *m_bzImageFile;
|
||||
|
||||
int m_nFdImage;
|
||||
28
partimage/partimage.install
Normal file
28
partimage/partimage.install
Normal file
@@ -0,0 +1,28 @@
|
||||
post_install() {
|
||||
if ! getent group partimag &>/dev/null; then
|
||||
groupadd -g 110 partimag >/dev/null
|
||||
fi
|
||||
if ! getent passwd partimag &>/dev/null; then
|
||||
useradd -u 110 -g partimag -G adm -c "Partimage user" -d /dev/null -s /bin/nologin partimag >/dev/null
|
||||
fi
|
||||
if ! groups partimag | grep adm &>/dev/null; then
|
||||
gpasswd -a partimag adm >/dev/null
|
||||
fi
|
||||
partimag_shell=$(getent passwd partimag | cut -d: -f7)
|
||||
if [ "$partimag_shell" != '/bin/nologin' ]; then
|
||||
chsh -s /bin/nologin partimag &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent passwd partimag &>/dev/null; then
|
||||
userdel partimag >/dev/null
|
||||
fi
|
||||
if getent group partimag &>/dev/null; then
|
||||
groupdel partimag >/dev/null
|
||||
fi
|
||||
}
|
||||
18
partimage/partimaged-gencrt
Normal file
18
partimage/partimaged-gencrt
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ `whoami` != "root" ]; then
|
||||
echo "You must be root to generate certificates."
|
||||
exit
|
||||
fi
|
||||
|
||||
echo -n "==> Generating certificate for Partimage/PartimageD SSL... "
|
||||
cd /etc/partimaged
|
||||
openssl req -new -x509 -outform PEM > partimaged.csr
|
||||
openssl rsa -in privkey.pem -out partimaged.key
|
||||
rm privkey.pem
|
||||
openssl x509 -in partimaged.csr -out partimaged.cert -signkey partimaged.key
|
||||
rm partimaged.csr
|
||||
chmod 600 partimaged.key
|
||||
chmod 600 partimaged.cert
|
||||
chown partimag:partimag partimaged.key
|
||||
chown partimag:partimag partimaged.cert
|
||||
9
partimage/partimaged.confd
Normal file
9
partimage/partimaged.confd
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright 2005 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# You can define the following optional arguments:
|
||||
# -d <dest> Destination directory for the backup images
|
||||
# -pX Server port
|
||||
# -r <dest> Chroot directory for improved security
|
||||
|
||||
#PARTIMAGED_OPTS=""
|
||||
23
partimage/partimaged.initd
Normal file
23
partimage/partimaged.initd
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2005-2010 Gentoo Foundation
|
||||
# Copyright 2019 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License, v2 or later
|
||||
|
||||
PARTIMAGED="/usr/sbin/partimaged"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting partimaged"
|
||||
start-stop-daemon --start --exec ${PARTIMAGED} \
|
||||
-- ${PARTIMAGED_OPTS} --daemon
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping partimaged"
|
||||
start-stop-daemon --stop --exec ${PARTIMAGED}
|
||||
eend $?
|
||||
}
|
||||
80
partimage/use-SSLv3-by-default.patch
Normal file
80
partimage/use-SSLv3-by-default.patch
Normal file
@@ -0,0 +1,80 @@
|
||||
From 8b05af027723ff3a64040275d4050ff0e992d629 Mon Sep 17 00:00:00 2001
|
||||
From: Marko Kohtala <marko.kohtala@gmail.com>
|
||||
Date: Sun, 9 Feb 2014 22:54:11 +0200
|
||||
Subject: [PATCH] Use SSLv3 by default
|
||||
|
||||
SSLv2_client_method may be hidden. Use the SSLv23_client_method instead.
|
||||
|
||||
This is a fix from Debian package partimage-0.6.8-2.2.
|
||||
|
||||
Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
|
||||
---
|
||||
src/client/netclient.cpp | 3 +--
|
||||
src/client/netclient.h | 6 ------
|
||||
src/server/netserver.cpp | 3 +--
|
||||
src/server/netserver.h | 6 ------
|
||||
4 files changed, 2 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/client/netclient.cpp b/src/client/netclient.cpp
|
||||
index 30b8d5c..43b2672 100644
|
||||
--- a/src/client/netclient.cpp
|
||||
+++ b/src/client/netclient.cpp
|
||||
@@ -43,9 +43,8 @@ CNetClient::CNetClient(bool bMustLogin, bool bUseSSL):CNet()
|
||||
{
|
||||
showDebug(3, "initializing client ssl\n");
|
||||
SSLeay_add_ssl_algorithms();
|
||||
- meth = SSLv2_client_method();
|
||||
SSL_load_error_strings();
|
||||
- ctx = SSL_CTX_new(meth);
|
||||
+ ctx = SSL_CTX_new(SSLv23_client_method());
|
||||
if (!ctx)
|
||||
THROW(ERR_SSL_CTX);
|
||||
m_bUseSSL = (ctx != NULL);
|
||||
diff --git a/src/client/netclient.h b/src/client/netclient.h
|
||||
index 8423798..9d98b39 100644
|
||||
--- a/src/client/netclient.h
|
||||
+++ b/src/client/netclient.h
|
||||
@@ -35,12 +35,6 @@ class CNetClient : public CNet
|
||||
#ifdef HAVE_SSL
|
||||
SSL_CTX * ctx;
|
||||
X509 * server_cert;
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
- SSL_METHOD const * meth;
|
||||
-#else
|
||||
- SSL_METHOD * meth;
|
||||
-#endif // OPENSSL_VERSION_NUMBER
|
||||
-
|
||||
#endif
|
||||
bool m_bUseSSL;
|
||||
bool m_bMustLogin;
|
||||
diff --git a/src/server/netserver.cpp b/src/server/netserver.cpp
|
||||
index a542760..28c43cc 100644
|
||||
--- a/src/server/netserver.cpp
|
||||
+++ b/src/server/netserver.cpp
|
||||
@@ -39,8 +39,7 @@ CNetServer::CNetServer( uint32_t ip4_addr, unsigned short int port):CNet()
|
||||
{
|
||||
SSL_load_error_strings();
|
||||
SSLeay_add_ssl_algorithms();
|
||||
- meth = SSLv23_server_method();
|
||||
- ctx = SSL_CTX_new(meth);
|
||||
+ ctx = SSL_CTX_new(SSLv23_server_method());
|
||||
if (!ctx)
|
||||
{
|
||||
ERR_print_errors_fp(stderr);
|
||||
diff --git a/src/server/netserver.h b/src/server/netserver.h
|
||||
index 01f6b6c..29d2a32 100644
|
||||
--- a/src/server/netserver.h
|
||||
+++ b/src/server/netserver.h
|
||||
@@ -41,12 +41,6 @@ class CNetServer : public CNet
|
||||
#ifdef HAVE_SSL
|
||||
SSL_CTX * ctx;
|
||||
X509 * client_cert;
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
||||
- SSL_METHOD const * meth;
|
||||
-#else
|
||||
- SSL_METHOD * meth;
|
||||
-#endif // OPENSSL_VERSION_NUMBER
|
||||
-
|
||||
int err;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user