temp/{mozjs60,polkit}: remove
They are available in Alpine again for armhf and armv7. Networkmanager is still missing, so we keep it it temp for now. Upstream patch submitted: https://github.com/alpinelinux/aports/pull/7626 Related: #244
This commit is contained in:
parent
271aba5d0f
commit
d934c86f52
11 changed files with 0 additions and 650 deletions
|
@ -1,30 +0,0 @@
|
|||
Upstream: no
|
||||
From 9ad10569e11a2fb96377188f895bc66abcc9511d Mon Sep 17 00:00:00 2001
|
||||
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Date: Wed, 5 Sep 2018 15:05:24 +0200
|
||||
Subject: [PATCH] silence sandbox violations
|
||||
|
||||
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
---
|
||||
python/mozbuild/mozbuild/frontend/emitter.py | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
|
||||
index 642b381c0..c37fbf5d0 100644
|
||||
--- a/python/mozbuild/mozbuild/frontend/emitter.py
|
||||
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
|
||||
@@ -1127,11 +1127,6 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
|
||||
'does not exist: %s (resolved to %s)' % (local_include,
|
||||
full_path), context)
|
||||
- if (full_path == context.config.topsrcdir or
|
||||
- full_path == context.config.topobjdir):
|
||||
- raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
|
||||
- 'is not allowed: %s (resolved to %s)' % (local_include,
|
||||
- full_path), context)
|
||||
include_obj = LocalInclude(context, local_include)
|
||||
local_includes.append(include_obj.path.full_path)
|
||||
yield include_obj
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
# Forked from Alpine, because networkmanager is currently missing in armhf, armv7 (#244)
|
||||
pkgname=mozjs60
|
||||
pkgver=60.6.1
|
||||
_majver=${pkgver%%.*}
|
||||
pkgrel=1
|
||||
pkgdesc="standalone mozilla javascript engine"
|
||||
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/60"
|
||||
arch="all !s390x"
|
||||
license="MPL-2.0"
|
||||
depends_dev="icu-dev nspr-dev libffi-dev readline-dev"
|
||||
makedepends="$depends_dev zlib-dev python2 perl sed autoconf2.13 linux-headers coreutils"
|
||||
subpackages="$pkgname-dev"
|
||||
source="https://ftp.mozilla.org/pub/firefox/releases/${pkgver}esr/source/firefox-${pkgver}esr.source.tar.xz
|
||||
0001-silence-sandbox-violations.patch
|
||||
fix-musl-build.patch
|
||||
fix-soname-lib.patch
|
||||
"
|
||||
builddir="$srcdir"/firefox-$pkgver
|
||||
_builddir="$builddir/js/src"
|
||||
|
||||
# checks take forever in qemu
|
||||
options="!check"
|
||||
|
||||
build() {
|
||||
cd "$_builddir"
|
||||
|
||||
export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=1048576"
|
||||
|
||||
# avoid complains about autoconf
|
||||
touch configure
|
||||
|
||||
# Fix broken ARM_ARCH check which doesn't work with newer GCCs it seems.
|
||||
if [ "$CTARGET = "armv* ]; then
|
||||
ARM_ARCH=$(echo ${CTARGET#*armv} | sed "s|-.*||")
|
||||
sed -i "s|ARM_ARCH=.*|ARM_ARCH=$ARM_ARCH|" "$builddir"/build/autoconf/arch.m4
|
||||
fi
|
||||
|
||||
export SHELL=/bin/ash
|
||||
PYTHON=/usr/bin/python2 ./configure --prefix=/usr \
|
||||
--with-system-icu \
|
||||
--with-system-nspr \
|
||||
--with-system-zlib \
|
||||
--with-intl-api \
|
||||
--enable-ctypes \
|
||||
--enable-shared-js \
|
||||
--enable-readline \
|
||||
--enable-system-ffi \
|
||||
--disable-optimize \
|
||||
--disable-jemalloc \
|
||||
--enable-pie
|
||||
make
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$_builddir"
|
||||
dist/bin/jsapi-tests
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$_builddir"
|
||||
make DESTDIR="$pkgdir" install
|
||||
rm -f "$pkgdir"/usr/lib/*.ajs
|
||||
}
|
||||
|
||||
sha512sums="a1683e9ad551c2aa6b84013216393fe1f7107728c253ed8e5700d419cf0956513110ed4e1b5dbac3e3bc23930e3024706f1b24d405b6edcdf8c175b03ab241ed firefox-60.6.1esr.source.tar.xz
|
||||
adaacd6e087a07bd4ded598f6a66ee00c67c9092bb93d88729668516f6f00f497ad8ece1866680e6c371e4705e0f9194ade41ea3a986f793bd972c92029cf03a 0001-silence-sandbox-violations.patch
|
||||
bc91c2fb15eb22acb8acc36d086fb18fbf6f202b4511d138769b5ecaaed4a673349c55f808270c762616fafa42e3b01e74dc0af1dcbeea1289e043926e2750c8 fix-musl-build.patch
|
||||
4782794a0f409f767293fb5f61a9ad58985e05197538975ed8f7372bfae6921a3b9bcbbbfcf8ce2843cdfe8ee799d08cee71a6391ed5ae939f051d13038b0960 fix-soname-lib.patch"
|
|
@ -1,16 +0,0 @@
|
|||
Upstream: No
|
||||
Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD:
|
||||
https://github.com/void-linux/void-packages/issues/2598
|
||||
diff --git a/js/src/old-configure.in b/js/src/old-configure.in
|
||||
--- a/js/src/old-configure.in
|
||||
+++ b/js/src/old-configure.in
|
||||
@@ -1272,6 +1272,9 @@
|
||||
*-android*|*-linuxandroid*)
|
||||
:
|
||||
;;
|
||||
+ *-musl*)
|
||||
+ :
|
||||
+ ;;
|
||||
*)
|
||||
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
|
||||
;;
|
|
@ -1,30 +0,0 @@
|
|||
Source: Arch Linux
|
||||
Upstream: Unknown
|
||||
Reason: fixes linking against libmozjs-60
|
||||
|
||||
diff --git i/js/src/build/Makefile.in w/js/src/build/Makefile.in
|
||||
index ee19104e0ef5..a0f06fd35a18 100644
|
||||
--- i/js/src/build/Makefile.in
|
||||
+++ w/js/src/build/Makefile.in
|
||||
@@ -89,6 +89,8 @@ ifneq (,$(REAL_LIBRARY))
|
||||
endif
|
||||
ifneq (,$(SHARED_LIBRARY))
|
||||
$(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
|
||||
+ mv -f $(DESTDIR)$(libdir)/$(SHARED_LIBRARY) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).0
|
||||
+ ln -s $(SHARED_LIBRARY).0 $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
|
||||
ifeq ($(OS_ARCH),Darwin)
|
||||
install_name_tool -id $(abspath $(libdir)/$(SHARED_LIBRARY)) $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
|
||||
endif
|
||||
diff --git i/js/src/build/moz.build w/js/src/build/moz.build
|
||||
index a7f5fa4ce8eb..726687c13fb0 100644
|
||||
--- i/js/src/build/moz.build
|
||||
+++ w/js/src/build/moz.build
|
||||
@@ -23,6 +23,7 @@ if not CONFIG['JS_STANDALONE']:
|
||||
if CONFIG['JS_SHARED_LIBRARY']:
|
||||
GeckoSharedLibrary('js', linkage=None)
|
||||
SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
|
||||
+ LDFLAGS += ['-Wl,-soname,lib{}.so.0'.format(SHARED_LIBRARY_NAME)]
|
||||
else:
|
||||
Library('js')
|
||||
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# Forked from Alpine, because networkmanager is currently missing in armhf, armv7 (#244)
|
||||
pkgname=polkit
|
||||
pkgver=0.115
|
||||
pkgrel=0
|
||||
pkgdesc="Application development toolkit for controlling system-wide privileges"
|
||||
url="https://www.freedesktop.org/wiki/Software/polkit/"
|
||||
arch="all"
|
||||
license="GPL-2.0-or-later"
|
||||
options="suid !check"
|
||||
depends_dev="dbus-glib-dev"
|
||||
makedepends="$depends_dev expat-dev glib-dev gtk-doc gobject-introspection-dev
|
||||
intltool autoconf automake libtool bash mozjs60-dev linux-pam-dev"
|
||||
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
|
||||
source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.gz
|
||||
CVE-2018-19788.patch
|
||||
make-innetgr-optional.patch
|
||||
mozjs60-1.patch
|
||||
mozjs60-2.patch
|
||||
alpine-pam.patch
|
||||
"
|
||||
install="polkit.pre-install"
|
||||
pkgusers="polkitd"
|
||||
pkggroups="polkitd"
|
||||
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
|
||||
prepare() {
|
||||
cd "$builddir"
|
||||
default_prepare
|
||||
autoreconf -fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
./configure \
|
||||
--build=$CBUILD \
|
||||
--host=$CHOST \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--libexecdir=/usr/lib/polkit-1 \
|
||||
--localstatedir=/var \
|
||||
--disable-static \
|
||||
--enable-introspection \
|
||||
--with-authfw=pam \
|
||||
--with-os-type=alpine \
|
||||
--disable-gtk-doc \
|
||||
--disable-gtk-doc-html \
|
||||
--disable-gtk-doc-pdf \
|
||||
--disable-libelogind \
|
||||
--disable-systemd \
|
||||
--disable-libsystemd-login
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$builddir"
|
||||
make check
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
# Set SHELL as a workaround for #10081
|
||||
make SHELL=/bin/bash DESTDIR="$pkgdir" install
|
||||
|
||||
# Required to run the polkitd daemon as non-root
|
||||
chown -R polkitd:polkitd "$pkgdir"/etc/polkit-1/rules.d "$pkgdir"/usr/share/polkit-1/rules.d
|
||||
chmod -R 700 "$pkgdir"/etc/polkit-1/rules.d "$pkgdir"/usr/share/polkit-1/rules.d
|
||||
}
|
||||
|
||||
sha512sums="1153011fa93145b2c184e6b3446d3ca21b38918641aeccd8fac3985ac3e30ec6bc75be6973985fde90f2a24236592f1595be259155061c2d33358dd17c4ee4fc polkit-0.115.tar.gz
|
||||
5b951d7532b0ad51214cf63814cb863fe83ebc57722245cef3f5f003bba368ffd18fab03b9f23bbef8ed30972ad32f074d25491c3fe338389e02e279b4ced62c CVE-2018-19788.patch
|
||||
1e679eda2cacb25ad0d7409ab7c5811697519e46d3873a86a9ff2d8d3d3664e63c925ab13e5faf643031ea27e8e35730556121c96e06acd28c5f690848a8ce00 make-innetgr-optional.patch
|
||||
8d71494ddfc3f8d24b6c7dbab2b0440d9ab9df49d9e095c90f3802054bf858f4c81c644d1ab64872a6ea61ae70c58a181e47123a4c50bd8a339b27a23bfffaaa mozjs60-1.patch
|
||||
d7dc9fc3189a0897e8f484f7dfcee3722f75694401f7a01cac3eb1f0f6cb639081136e86e4bf467c908f77c847d4ddf310817c722fd21a73662ca6b908ce8d53 mozjs60-2.patch
|
||||
077a3e10ada918e6f9879ce50bba9145229bd92d3f13d4c6454147eb051086afbcf8d0a683a5ebe583ba00f956db011aa1afd3d9e99d7693e288737191468b8f alpine-pam.patch"
|
|
@ -1,150 +0,0 @@
|
|||
--- a/src/polkit/polkitunixgroup.c
|
||||
+++ b/src/polkit/polkitunixgroup.c
|
||||
@@ -71,6 +71,7 @@ G_DEFINE_TYPE_WITH_CODE (PolkitUnixGroup, polkit_unix_group, G_TYPE_OBJECT,
|
||||
static void
|
||||
polkit_unix_group_init (PolkitUnixGroup *unix_group)
|
||||
{
|
||||
+ unix_group->gid = -1; /* (git_t) -1 is not a valid GID under Linux */
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -100,11 +101,14 @@ polkit_unix_group_set_property (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
PolkitUnixGroup *unix_group = POLKIT_UNIX_GROUP (object);
|
||||
+ gint val;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_GID:
|
||||
- unix_group->gid = g_value_get_int (value);
|
||||
+ val = g_value_get_int (value);
|
||||
+ g_return_if_fail (val != -1);
|
||||
+ unix_group->gid = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -131,9 +135,9 @@ polkit_unix_group_class_init (PolkitUnixGroupClass *klass)
|
||||
g_param_spec_int ("gid",
|
||||
"Group ID",
|
||||
"The UNIX group ID",
|
||||
- 0,
|
||||
+ G_MININT,
|
||||
G_MAXINT,
|
||||
- 0,
|
||||
+ -1,
|
||||
G_PARAM_CONSTRUCT |
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_NAME |
|
||||
@@ -166,9 +170,10 @@ polkit_unix_group_get_gid (PolkitUnixGroup *group)
|
||||
*/
|
||||
void
|
||||
polkit_unix_group_set_gid (PolkitUnixGroup *group,
|
||||
- gint gid)
|
||||
+ gint gid)
|
||||
{
|
||||
g_return_if_fail (POLKIT_IS_UNIX_GROUP (group));
|
||||
+ g_return_if_fail (gid != -1);
|
||||
group->gid = gid;
|
||||
}
|
||||
|
||||
@@ -183,6 +188,8 @@ polkit_unix_group_set_gid (PolkitUnixGroup *group,
|
||||
PolkitIdentity *
|
||||
polkit_unix_group_new (gint gid)
|
||||
{
|
||||
+ g_return_val_if_fail (gid != -1, NULL);
|
||||
+
|
||||
return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_GROUP,
|
||||
"gid", gid,
|
||||
NULL));
|
||||
--- a/src/polkit/polkitunixprocess.c
|
||||
+++ b/src/polkit/polkitunixprocess.c
|
||||
@@ -159,9 +159,14 @@ polkit_unix_process_set_property (GObject *object,
|
||||
polkit_unix_process_set_pid (unix_process, g_value_get_int (value));
|
||||
break;
|
||||
|
||||
- case PROP_UID:
|
||||
- polkit_unix_process_set_uid (unix_process, g_value_get_int (value));
|
||||
+ case PROP_UID: {
|
||||
+ gint val;
|
||||
+
|
||||
+ val = g_value_get_int (value);
|
||||
+ g_return_if_fail (val != -1);
|
||||
+ polkit_unix_process_set_uid (unix_process, val);
|
||||
break;
|
||||
+ }
|
||||
|
||||
case PROP_START_TIME:
|
||||
polkit_unix_process_set_start_time (unix_process, g_value_get_uint64 (value));
|
||||
@@ -239,7 +244,7 @@ polkit_unix_process_class_init (PolkitUnixProcessClass *klass)
|
||||
g_param_spec_int ("uid",
|
||||
"User ID",
|
||||
"The UNIX user ID",
|
||||
- -1,
|
||||
+ G_MININT,
|
||||
G_MAXINT,
|
||||
-1,
|
||||
G_PARAM_CONSTRUCT |
|
||||
@@ -303,7 +308,6 @@ polkit_unix_process_set_uid (PolkitUnixProcess *process,
|
||||
gint uid)
|
||||
{
|
||||
g_return_if_fail (POLKIT_IS_UNIX_PROCESS (process));
|
||||
- g_return_if_fail (uid >= -1);
|
||||
process->uid = uid;
|
||||
}
|
||||
|
||||
--- a/src/polkit/polkitunixuser.c
|
||||
+++ b/src/polkit/polkitunixuser.c
|
||||
@@ -72,6 +72,7 @@ G_DEFINE_TYPE_WITH_CODE (PolkitUnixUser, polkit_unix_user, G_TYPE_OBJECT,
|
||||
static void
|
||||
polkit_unix_user_init (PolkitUnixUser *unix_user)
|
||||
{
|
||||
+ unix_user->uid = -1; /* (uid_t) -1 is not a valid UID under Linux */
|
||||
unix_user->name = NULL;
|
||||
}
|
||||
|
||||
@@ -112,11 +113,14 @@ polkit_unix_user_set_property (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
PolkitUnixUser *unix_user = POLKIT_UNIX_USER (object);
|
||||
+ gint val;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_UID:
|
||||
- unix_user->uid = g_value_get_int (value);
|
||||
+ val = g_value_get_int (value);
|
||||
+ g_return_if_fail (val != -1);
|
||||
+ unix_user->uid = val;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -144,9 +148,9 @@ polkit_unix_user_class_init (PolkitUnixUserClass *klass)
|
||||
g_param_spec_int ("uid",
|
||||
"User ID",
|
||||
"The UNIX user ID",
|
||||
- 0,
|
||||
+ G_MININT,
|
||||
G_MAXINT,
|
||||
- 0,
|
||||
+ -1,
|
||||
G_PARAM_CONSTRUCT |
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_NAME |
|
||||
@@ -182,6 +186,7 @@ polkit_unix_user_set_uid (PolkitUnixUser *user,
|
||||
gint uid)
|
||||
{
|
||||
g_return_if_fail (POLKIT_IS_UNIX_USER (user));
|
||||
+ g_return_if_fail (uid != -1);
|
||||
user->uid = uid;
|
||||
}
|
||||
|
||||
@@ -196,6 +201,8 @@ polkit_unix_user_set_uid (PolkitUnixUser *user,
|
||||
PolkitIdentity *
|
||||
polkit_unix_user_new (gint uid)
|
||||
{
|
||||
+ g_return_val_if_fail (uid != -1, NULL);
|
||||
+
|
||||
return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_USER,
|
||||
"uid", uid,
|
||||
NULL));
|
|
@ -1,18 +0,0 @@
|
|||
Point /etc/pam.d/polkit-1 to the right PAM files.
|
||||
|
||||
diff --git configure.ac configure.ac
|
||||
index 36df239..53b5573 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -470,6 +470,11 @@ elif test x$with_os_type = xfreebsd -o x$with_os_type = xnetbsd; then
|
||||
PAM_FILE_INCLUDE_ACCOUNT=system
|
||||
PAM_FILE_INCLUDE_PASSWORD=system
|
||||
PAM_FILE_INCLUDE_SESSION=system
|
||||
+elif test x$with_os_type = xalpine; then
|
||||
+ PAM_FILE_INCLUDE_AUTH=base-auth
|
||||
+ PAM_FILE_INCLUDE_ACCOUNT=base-account
|
||||
+ PAM_FILE_INCLUDE_PASSWORD=base-password
|
||||
+ PAM_FILE_INCLUDE_SESSION=base-session
|
||||
else
|
||||
PAM_FILE_INCLUDE_AUTH=system-auth
|
||||
PAM_FILE_INCLUDE_ACCOUNT=system-auth
|
|
@ -1,68 +0,0 @@
|
|||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -99,7 +99,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
|
||||
[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
|
||||
AC_SUBST(EXPAT_LIBS)
|
||||
|
||||
-AC_CHECK_FUNCS(clearenv fdatasync)
|
||||
+AC_CHECK_FUNCS(clearenv fdatasync getnetgrent)
|
||||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
LDFLAGS="-Wl,--as-needed $LDFLAGS"
|
||||
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
|
||||
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
|
||||
@@ -2228,6 +2228,7 @@ get_users_in_net_group (PolkitIdentity *group,
|
||||
ret = NULL;
|
||||
name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
|
||||
|
||||
+#if defined HAVE_GETNETGRENT
|
||||
#ifdef HAVE_SETNETGRENT_RETURN
|
||||
if (setnetgrent (name) == 0)
|
||||
{
|
||||
@@ -2236,6 +2237,7 @@ get_users_in_net_group (PolkitIdentity *group,
|
||||
}
|
||||
#else
|
||||
setnetgrent (name);
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
for (;;)
|
||||
@@ -2248,8 +2250,10 @@ get_users_in_net_group (PolkitIdentity *group,
|
||||
PolkitIdentity *user;
|
||||
GError *error = NULL;
|
||||
|
||||
+#if defined HAVE_GETNETGRENT
|
||||
if (getnetgrent (&hostname, &username, &domainname) == 0)
|
||||
break;
|
||||
+#endif
|
||||
|
||||
/* Skip NULL entries since we never want to make everyone an admin
|
||||
* Skip "-" entries which mean "no match ever" in netgroup land */
|
||||
@@ -2274,7 +2278,9 @@ get_users_in_net_group (PolkitIdentity *group,
|
||||
ret = g_list_reverse (ret);
|
||||
|
||||
out:
|
||||
+#if defined HAVE_GETNETGRENT
|
||||
endnetgrent ();
|
||||
+#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
@@ -1499,6 +1499,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
||||
|
||||
JS::CallArgs args = JS::CallArgsFromVp (argc, vp);
|
||||
|
||||
+#if defined HAVE_GETNETGRENT
|
||||
user = JS_EncodeString (cx, args[0].toString());
|
||||
netgroup = JS_EncodeString (cx, args[1].toString());
|
||||
|
||||
@@ -1514,6 +1515,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
|
||||
JS_free (cx, user);
|
||||
|
||||
ret = true;
|
||||
+#endif
|
||||
|
||||
args.rval ().setBoolean (is_in_netgroup);
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
Upstream: yes
|
||||
From c9cd7024140b837b5693d7c1bbaad1b0cd31cce6 Mon Sep 17 00:00:00 2001
|
||||
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||
Date: Fri, 31 Aug 2018 13:32:16 +0100
|
||||
Subject: Depend on mozjs-60
|
||||
|
||||
This is the new ESR version of the Mozilla JS engine, superceding
|
||||
mozjs-52.
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 5c37e48..5cedb4e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -79,7 +79,7 @@ PKG_CHECK_MODULES(GLIB, [gmodule-2.0 gio-unix-2.0 >= 2.30.0])
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
|
||||
-PKG_CHECK_MODULES(LIBJS, [mozjs-52])
|
||||
+PKG_CHECK_MODULES(LIBJS, [mozjs-60])
|
||||
|
||||
AC_SUBST(LIBJS_CFLAGS)
|
||||
AC_SUBST(LIBJS_CXXFLAGS)
|
||||
--
|
||||
cgit v1.1
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
Upstream: yes
|
||||
From dd00683e8781d230a45781d509d86ad676138564 Mon Sep 17 00:00:00 2001
|
||||
From: Emmanuele Bassi <ebassi@gnome.org>
|
||||
Date: Fri, 31 Aug 2018 13:33:20 +0100
|
||||
Subject: Port the JS authority to mozjs-60
|
||||
|
||||
API changes in mozjs that need to be reflected in the JS authority:
|
||||
|
||||
- the JS::CompileOptions constructor and the JS::CompartmentOptions
|
||||
do not allow setting a JS version any more
|
||||
|
||||
- do not use NULL comparisons for C++ objects
|
||||
|
||||
- the resize() method for a vector has a return value that needs
|
||||
to be handled
|
||||
|
||||
- JSClassOps has different fields
|
||||
---
|
||||
src/polkitbackend/polkitbackendjsauthority.cpp | 65 +++++++++++++-------------
|
||||
1 file changed, 32 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
index 7602714..984a0f0 100644
|
||||
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
|
||||
@@ -150,18 +150,17 @@ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BAC
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
|
||||
static const struct JSClassOps js_global_class_ops = {
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL
|
||||
+ nullptr, // addProperty
|
||||
+ nullptr, // deleteProperty
|
||||
+ nullptr, // enumerate
|
||||
+ nullptr, // newEnumerate
|
||||
+ nullptr, // resolve
|
||||
+ nullptr, // mayResolve
|
||||
+ nullptr, // finalize
|
||||
+ nullptr, // call
|
||||
+ nullptr, // hasInstance
|
||||
+ nullptr, // construct
|
||||
+ JS_GlobalObjectTraceHook
|
||||
};
|
||||
|
||||
static JSClass js_global_class = {
|
||||
@@ -172,18 +171,17 @@ static JSClass js_global_class = {
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------- */
|
||||
static const struct JSClassOps js_polkit_class_ops = {
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL,
|
||||
- NULL
|
||||
+ nullptr, // addProperty
|
||||
+ nullptr, // deleteProperty
|
||||
+ nullptr, // enumerate
|
||||
+ nullptr, // newEnumerate
|
||||
+ nullptr, // resolve
|
||||
+ nullptr, // mayResolve
|
||||
+ nullptr, // finalize
|
||||
+ nullptr, // call
|
||||
+ nullptr, // hasInstance
|
||||
+ nullptr, // construct
|
||||
+ nullptr // trace
|
||||
};
|
||||
|
||||
static JSClass js_polkit_class = {
|
||||
@@ -469,19 +467,18 @@ polkit_backend_js_authority_constructed (GObject *object)
|
||||
|
||||
{
|
||||
JS::CompartmentOptions compart_opts;
|
||||
- compart_opts.behaviors().setVersion(JSVERSION_LATEST);
|
||||
+
|
||||
JS::RootedObject global(authority->priv->cx);
|
||||
|
||||
authority->priv->js_global = new JS::Heap<JSObject*> (JS_NewGlobalObject (authority->priv->cx, &js_global_class, NULL, JS::FireOnNewGlobalHook, compart_opts));
|
||||
|
||||
global = authority->priv->js_global->get ();
|
||||
-
|
||||
- if (global == NULL)
|
||||
+ if (!global)
|
||||
goto fail;
|
||||
|
||||
authority->priv->ac = new JSAutoCompartment(authority->priv->cx, global);
|
||||
|
||||
- if (authority->priv->ac == NULL)
|
||||
+ if (!authority->priv->ac)
|
||||
goto fail;
|
||||
|
||||
if (!JS_InitStandardClasses (authority->priv->cx, global))
|
||||
@@ -493,7 +490,7 @@ polkit_backend_js_authority_constructed (GObject *object)
|
||||
|
||||
polkit = authority->priv->js_polkit->get ();
|
||||
|
||||
- if (polkit == NULL)
|
||||
+ if (!polkit)
|
||||
goto fail;
|
||||
|
||||
if (!JS_DefineProperty(authority->priv->cx, global, "polkit", polkit, JSPROP_ENUMERATE))
|
||||
@@ -504,7 +501,7 @@ polkit_backend_js_authority_constructed (GObject *object)
|
||||
js_polkit_functions))
|
||||
goto fail;
|
||||
|
||||
- JS::CompileOptions options(authority->priv->cx, JSVERSION_UNKNOWN);
|
||||
+ JS::CompileOptions options(authority->priv->cx);
|
||||
JS::RootedValue rval(authority->priv->cx);
|
||||
if (!JS::Evaluate (authority->priv->cx,
|
||||
options,
|
||||
@@ -684,7 +681,9 @@ set_property_strv (PolkitBackendJsAuthority *authority,
|
||||
JS::AutoValueVector elems(authority->priv->cx);
|
||||
guint n;
|
||||
|
||||
- elems.resize(value->len);
|
||||
+ if (!elems.resize(value->len))
|
||||
+ g_error ("Unable to resize vector");
|
||||
+
|
||||
for (n = 0; n < value->len; n++)
|
||||
{
|
||||
const char *c_string = (const char *) g_ptr_array_index(value, n);
|
||||
@@ -741,7 +740,7 @@ subject_to_jsval (PolkitBackendJsAuthority *authority,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
- JS::CompileOptions options(authority->priv->cx, JSVERSION_UNKNOWN);
|
||||
+ JS::CompileOptions options(authority->priv->cx);
|
||||
const char *src;
|
||||
JS::RootedObject obj(authority->priv->cx);
|
||||
pid_t pid;
|
||||
@@ -868,7 +867,7 @@ action_and_details_to_jsval (PolkitBackendJsAuthority *authority,
|
||||
GError **error)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
- JS::CompileOptions options(authority->priv->cx, JSVERSION_UNKNOWN);
|
||||
+ JS::CompileOptions options(authority->priv->cx);
|
||||
const char *src;
|
||||
JS::RootedObject obj(authority->priv->cx);
|
||||
gchar **keys;
|
||||
--
|
||||
cgit v1.1
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
addgroup -S polkitd 2>/dev/null
|
||||
adduser -S -D -H -h /var/empty -s /sbin/nologin -G polkitd -g polkitd polkitd 2>/dev/null
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue