mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-01-23 09:22:14 +08:00
more glib2 stack movement.
This commit is contained in:
parent
f8ccdb5830
commit
cb0a650133
@ -15,7 +15,7 @@ url="https://launchpad.net/burg"
|
||||
license="GPL3"
|
||||
arch=('i686' 'x86_64')
|
||||
if [ "$CARCH" = "i686" ]; then
|
||||
depends=('gettext' 'freetype2')
|
||||
depends=('freetype2')
|
||||
pkgdesc="Brand-new Universal loadeR from GRUB2 - Built for i386 BIOS"
|
||||
fi
|
||||
if [ "$CARCH" = "x86_64" ]; then
|
||||
|
@ -4,8 +4,6 @@
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
# include global config
|
||||
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
|
||||
|
||||
pkgname=cmake
|
||||
pkgver=2.8.7
|
||||
|
@ -4,8 +4,9 @@
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
|
||||
pkgname=gobject-introspection
|
||||
pkgver=0.10.8
|
||||
pkgver=1.30.0
|
||||
pkgrel=1
|
||||
pkgdesc="Introspection system for GObject-based libraries"
|
||||
url="http://live.gnome.org/GObjectInstrospection"
|
||||
@ -14,8 +15,9 @@ license=('LGPL' 'GPL')
|
||||
depends=('libffi' 'glib2' 'python2')
|
||||
makedepends=('cairo')
|
||||
options=('!libtool')
|
||||
source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/0.10/${pkgname}-${pkgver}.tar.bz2)
|
||||
sha256sums=('5b1387ff37f03db880a2b1cbd6c6b6dfb923a29468d4d8367c458abf7704c61e')
|
||||
source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/1.30/${pkgname}-${pkgver}.tar.xz)
|
||||
sha256sums=('8e4274579096e983fad3148cdab50295a4701e45cd9a4e02f7242fc0a04c47b2')
|
||||
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
@ -4,22 +4,27 @@
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
|
||||
pkgname=libcroco
|
||||
pkgver=0.6.2
|
||||
pkgrel=2
|
||||
pkgdesc="GNOME CSS2 parsing and manipulation toolkit"
|
||||
pkgver=0.6.3
|
||||
pkgrel=1
|
||||
pkgdesc="A CSS parsing library"
|
||||
arch=('x86_64' 'i686')
|
||||
depends=('glib2>=2.18.4' 'libxml2>=2.7.3')
|
||||
makedepends=('intltool' 'pkgconfig')
|
||||
depends=('glib2' 'libxml2')
|
||||
makedepends=('intltool')
|
||||
license=('LGPL')
|
||||
options=('!libtool')
|
||||
source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/0.6/${pkgname}-${pkgver}.tar.bz2)
|
||||
source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/0.6/$pkgname-$pkgver.tar.xz)
|
||||
url="http://www.gnome.org"
|
||||
md5sums=('1429c597aa4b75fc610ab3a542c99209')
|
||||
sha256sums=('8b7c565bf3eae1dff0a09d128fc3726acc1a492a7de23b25dce803a4f93d42c1')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
./configure --prefix=/usr --disable-static || return 1
|
||||
make || return 1
|
||||
make DESTDIR="${pkgdir}" install || return 1
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
./configure --prefix=/usr --disable-static
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
|
@ -4,52 +4,56 @@
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
# include global config
|
||||
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
|
||||
|
||||
pkgname=syslog-ng
|
||||
pkgver=3.2.4
|
||||
pkgver=3.3.4
|
||||
pkgrel=2
|
||||
pkgdesc="Next-generation syslogd with advanced networking and filtering capabilities"
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL2')
|
||||
groups=('base')
|
||||
url="http://www.balabit.com/network-security/syslog-ng/"
|
||||
depends=('glib2' 'eventlog' 'tcp_wrappers' 'openssl' 'libcap' 'awk')
|
||||
makedepends=('flex' 'pkgconfig')
|
||||
optdepends=('logrotate')
|
||||
depends=('glib2' 'eventlog' 'openssl' 'libcap' 'awk')
|
||||
makedepends=('flex' 'pkg-config')
|
||||
optdepends=('logrotate: for rotating log files')
|
||||
provides=('logger')
|
||||
options=('!libtool')
|
||||
backup=('etc/syslog-ng/modules.conf' 'etc/syslog-ng/scl.conf' \
|
||||
'etc/syslog-ng/syslog-ng.conf' 'etc/logrotate.d/syslog-ng')
|
||||
source=(http://www.balabit.com/downloads/files/syslog-ng/sources/$pkgver/source/$pkgname\_$pkgver.tar.gz
|
||||
source=("http://www.balabit.com/downloads/files/syslog-ng/sources/$pkgver/source/${pkgname}_$pkgver.tar.gz"
|
||||
syslog-ng.conf
|
||||
syslog-ng.logrotate
|
||||
syslog-ng.rc
|
||||
cap_syslog.patch)
|
||||
md5sums=('5995f7dad0053a478b60a63f6f754203'
|
||||
'344dddfff946300f5576b13a7e8ea19f'
|
||||
'735636090be4582885974542d2a75855'
|
||||
'9bd98250cfa49e13fa3fa731b6040549'
|
||||
'46e5dcff71f820d497898331a3f608fe')
|
||||
syslog-ng.rc)
|
||||
sha1sums=('3437a50af027f281747087ab47a45aa5fbabbf14'
|
||||
'98074e0facfc6ef036202662cc86d04b38a2c142'
|
||||
'949128fe3d7f77a7aab99048061f885bc758000c'
|
||||
'a6ad26912b5bcbe1b47b003309945d733613b98f')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
# fix #22555 for kernels >=2.6.38
|
||||
patch -p1 -i ../cap_syslog.patch
|
||||
./configure --prefix=/usr --sysconfdir=/etc/syslog-ng \
|
||||
--libexecdir=/usr/lib --localstatedir=/var/lib/syslog-ng \
|
||||
--enable-tcp-wrapper \
|
||||
--with-pidfile-dir=/var/run \
|
||||
--disable-spoof-source
|
||||
cd "$pkgname-$pkgver"
|
||||
|
||||
make || return 1
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc/syslog-ng \
|
||||
--libexecdir=/usr/lib \
|
||||
--localstatedir=/var/lib/syslog-ng \
|
||||
--with-pidfile-dir=/run \
|
||||
--disable-spoof-source \
|
||||
--enable-systemd \
|
||||
--with-systemdsystemunitdir=/lib/systemd/system
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $srcdir/$pkgname-$pkgver
|
||||
make DESTDIR=$pkgdir install || return 1
|
||||
install -dm755 "${pkgdir}/var/lib/syslog-ng" "${pkgdir}/etc/syslog-ng/patterndb.d"
|
||||
install -Dm644 "${srcdir}/syslog-ng.conf" "${pkgdir}/etc/syslog-ng/syslog-ng.conf"
|
||||
install -Dm644 "${srcdir}/syslog-ng.logrotate" "${pkgdir}/etc/logrotate.d/syslog-ng"
|
||||
install -Dm755 "${srcdir}/syslog-ng.rc" "${pkgdir}/etc/rc.d/syslog-ng"
|
||||
make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
|
||||
|
||||
install -dm755 "$pkgdir/var/lib/syslog-ng" "$pkgdir/etc/syslog-ng/patterndb.d"
|
||||
install -Dm644 "$srcdir/syslog-ng.conf" "$pkgdir/etc/syslog-ng/syslog-ng.conf"
|
||||
install -Dm644 "$srcdir/syslog-ng.logrotate" "$pkgdir/etc/logrotate.d/syslog-ng"
|
||||
install -Dm755 "$srcdir/syslog-ng.rc" "$pkgdir/etc/rc.d/syslog-ng"
|
||||
|
||||
# compat with pre-systemd 38
|
||||
# XXX: remove this once the journal is in extra
|
||||
sed -i '/^ExecStartPre/s/=/=-/' "$pkgdir/lib/systemd/system/syslog-ng.service"
|
||||
}
|
||||
|
@ -1,101 +0,0 @@
|
||||
diff --git a/lib/gprocess.h b/lib/gprocess.h
|
||||
index cda35b0..5c449f7 100644
|
||||
--- a/lib/gprocess.h
|
||||
+++ b/lib/gprocess.h
|
||||
@@ -28,9 +28,14 @@
|
||||
#include "syslog-ng.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
+#include <sys/utsname.h>
|
||||
|
||||
#if ENABLE_LINUX_CAPS
|
||||
# include <sys/capability.h>
|
||||
+#
|
||||
+# ifndef CAP_SYSLOG
|
||||
+# define CAP_SYSLOG 34
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
@@ -78,5 +83,8 @@ void g_process_finish(void);
|
||||
|
||||
void g_process_add_option_group(GOptionContext *ctx);
|
||||
|
||||
+extern int kernel_version;
|
||||
+extern void get_kernel_version(void);
|
||||
+#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
|
||||
|
||||
#endif
|
||||
diff --git a/modules/affile/affile.c b/modules/affile/affile.c
|
||||
index e145324..886fa72 100644
|
||||
--- a/modules/affile/affile.c
|
||||
+++ b/modules/affile/affile.c
|
||||
@@ -59,7 +59,12 @@ affile_open_file(gchar *name, gint flags,
|
||||
if (privileged)
|
||||
{
|
||||
g_process_cap_modify(CAP_DAC_READ_SEARCH, TRUE);
|
||||
- g_process_cap_modify(CAP_SYS_ADMIN, TRUE);
|
||||
+ if (!kernel_version)
|
||||
+ get_kernel_version();
|
||||
+ if (kernel_version < LINUX_VERSION(2, 6, 38))
|
||||
+ g_process_cap_modify(CAP_SYS_ADMIN, TRUE);
|
||||
+ else
|
||||
+ g_process_cap_modify(CAP_SYSLOG, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/syslog-ng/main.c b/syslog-ng/main.c
|
||||
index 9880c1f..ee5031b 100644
|
||||
--- a/syslog-ng/main.c
|
||||
+++ b/syslog-ng/main.c
|
||||
@@ -67,6 +67,7 @@ static gboolean syntax_only = FALSE;
|
||||
static gboolean display_version = FALSE;
|
||||
static gchar *ctlfilename = PATH_CONTROL_SOCKET;
|
||||
static gchar *preprocess_into = NULL;
|
||||
+int kernel_version;
|
||||
|
||||
static volatile sig_atomic_t sig_hup_received = FALSE;
|
||||
static volatile sig_atomic_t sig_term_received = FALSE;
|
||||
@@ -363,6 +364,20 @@ version(void)
|
||||
ON_OFF_STR(ENABLE_PACCT_MODULE));
|
||||
}
|
||||
|
||||
+void
|
||||
+get_kernel_version(void) {
|
||||
+ static struct utsname uts;
|
||||
+ int x = 0, y = 0, z = 0;
|
||||
+
|
||||
+ if (uname(&uts) == -1) {
|
||||
+ fprintf(stderr, "Unable to retrieve kernel version.\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ sscanf(uts.release, "%d.%d.%d", &x, &y, &z);
|
||||
+ kernel_version = LINUX_VERSION(x, y, z);
|
||||
+}
|
||||
+
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@@ -379,9 +394,20 @@ main(int argc, char *argv[])
|
||||
* indicate readability. Enabling/disabling cap_sys_admin on every poll
|
||||
* invocation seems to be too expensive. So I enable it for now. */
|
||||
|
||||
- g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw,"
|
||||
+ if (!kernel_version)
|
||||
+ get_kernel_version();
|
||||
+ if (kernel_version < LINUX_VERSION(2, 6, 34))
|
||||
+ g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw,"
|
||||
"cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner=p "
|
||||
"cap_sys_admin=ep");
|
||||
+ else if (kernel_version < LINUX_VERSION(2, 6, 38))
|
||||
+ g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw,"
|
||||
+ "cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner,"
|
||||
+ "cap_sys_admin=p");
|
||||
+ else
|
||||
+ g_process_set_caps("cap_net_bind_service,cap_net_broadcast,cap_net_raw,"
|
||||
+ "cap_dac_read_search,cap_dac_override,cap_chown,cap_fowner,"
|
||||
+ "cap_syslog=p");
|
||||
ctx = g_option_context_new("syslog-ng");
|
||||
g_process_add_option_group(ctx);
|
||||
msg_add_option_group(ctx);
|
@ -1,4 +1,4 @@
|
||||
@version: 3.2
|
||||
@version: 3.3
|
||||
#
|
||||
# /etc/syslog-ng/syslog-ng.conf
|
||||
#
|
||||
@ -7,8 +7,8 @@ options {
|
||||
stats_freq (0);
|
||||
flush_lines (0);
|
||||
time_reopen (10);
|
||||
log_fifo_size (1000);
|
||||
long_hostnames(off);
|
||||
log_fifo_size (10000);
|
||||
chain_hostnames (off);
|
||||
use_dns (no);
|
||||
use_fqdn (no);
|
||||
create_dirs (no);
|
||||
|
@ -1,10 +0,0 @@
|
||||
# arg 1: the new package version
|
||||
# arg 2: the old package version
|
||||
|
||||
post_upgrade() {
|
||||
if [ "$(vercmp $2 2.1.3-3)" -lt 0 -a -e /etc/syslog-ng.conf.pacnew ]; then
|
||||
echo "Attention syslog-ng update:"
|
||||
echo "Configuration file syntax has changed. Make sure to update /etc/syslog-ng.conf"
|
||||
|
||||
fi
|
||||
}
|
@ -2,6 +2,6 @@
|
||||
missingok
|
||||
sharedscripts
|
||||
postrotate
|
||||
/bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null` 2> /dev/null || true
|
||||
/bin/kill -HUP $(cat /run/syslog-ng.pid 2>/dev/null) 2>/dev/null || true
|
||||
endscript
|
||||
}
|
||||
|
@ -3,29 +3,57 @@
|
||||
. /etc/rc.conf
|
||||
. /etc/rc.d/functions
|
||||
|
||||
PID=`pidof -o %PPID /usr/sbin/syslog-ng`
|
||||
case "$1" in
|
||||
checkconfig() {
|
||||
if ! syslog-ng -s -f /etc/syslog-ng/syslog-ng.conf; then
|
||||
stat_fail
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
pidfile=/run/syslog-ng.pid
|
||||
if [[ -r $pidfile ]]; then
|
||||
read -r PID < "$pidfile"
|
||||
if [[ $PID && ! -d /proc/$PID ]]; then
|
||||
# stale pidfile
|
||||
unset PID
|
||||
rm -f "$pidfile"
|
||||
fi
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
stat_busy "Starting Syslog-NG"
|
||||
[ -z "$PID" ] && /usr/sbin/syslog-ng
|
||||
if [ $? -gt 0 ]; then
|
||||
stat_fail
|
||||
else
|
||||
checkconfig
|
||||
if [[ -z $PID ]] && /usr/sbin/syslog-ng; then
|
||||
add_daemon syslog-ng
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
stat_busy "Stopping Syslog-NG"
|
||||
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
stat_fail
|
||||
else
|
||||
rm -f /var/run/syslog-ng.pid
|
||||
# Removing stale syslog-ng.persist file. It's new location, as of 2.0.6-1, is /var/lib/syslog-ng/
|
||||
rm -f /var/syslog-ng.persist
|
||||
if [[ $PID ]] && kill $PID &>/dev/null; then
|
||||
rm_daemon syslog-ng
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
reload)
|
||||
stat_busy "Reloading Syslog-NG configuration and re-opening log files"
|
||||
if [[ -z $PID ]]; then
|
||||
stat_fail
|
||||
else
|
||||
checkconfig
|
||||
if kill -HUP $PID &>/dev/null; then
|
||||
stat_done
|
||||
else
|
||||
stat_fail
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
@ -34,6 +62,6 @@ case "$1" in
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
echo "usage: $0 {start|stop|restart|reload}"
|
||||
esac
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user