All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] package/polkit: install service file
@ 2020-04-18  2:58 aduskett at gmail.com
  2020-04-18  2:58 ` [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix aduskett at gmail.com
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: aduskett at gmail.com @ 2020-04-18  2:58 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

The default installed service file is missing a target, which causes preset-all
to not enable the service.

Add the service file to package/polkit with the addition of:

[Install]
WantedBy=multi-user.target

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/polkit/polkit.mk      |  6 ++++++
 package/polkit/polkit.service | 12 ++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 package/polkit/polkit.service

diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk
index 8572d8b9ba..ee0b3674de 100644
--- a/package/polkit/polkit.mk
+++ b/package/polkit/polkit.mk
@@ -43,4 +43,10 @@ define POLKIT_PERMISSIONS
 	/usr/bin/pkexec f 4755 root root - - - - -
 endef
 
+define POLKIT_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 644 $(POLKIT_PKGDIR)/polkit.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/polkit.service
+
+endef
+
 $(eval $(autotools-package))
diff --git a/package/polkit/polkit.service b/package/polkit/polkit.service
new file mode 100644
index 0000000000..a69b28cd93
--- /dev/null
+++ b/package/polkit/polkit.service
@@ -0,0 +1,12 @@
+[Unit]
+
+Description=Authorization Manager
+Documentation=man:polkit(8)
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.PolicyKit1
+ExecStart=/usr/lib/polkit-1/polkitd --no-debug
+
+[Install]
+WantedBy=multi-user.target
-- 
2.25.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix
  2020-04-18  2:58 [Buildroot] [PATCH 1/4] package/polkit: install service file aduskett at gmail.com
@ 2020-04-18  2:58 ` aduskett at gmail.com
  2020-05-06  5:27   ` Peter Korsgaard
  2020-04-18  2:58 ` [Buildroot] [PATCH 3/4] package/polkit: add upstream fix for SIGTTOU aduskett at gmail.com
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: aduskett at gmail.com @ 2020-04-18  2:58 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

This patch fixes two small memory leaks.

Upstream commit: 28e3a6653d8c3777b07e0128a0d97d46e586e311

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/polkit/0002-jsauthority-memleak.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/polkit/0002-jsauthority-memleak.patch

diff --git a/package/polkit/0002-jsauthority-memleak.patch b/package/polkit/0002-jsauthority-memleak.patch
new file mode 100644
index 0000000000..4f0733185c
--- /dev/null
+++ b/package/polkit/0002-jsauthority-memleak.patch
@@ -0,0 +1,28 @@
+From 28e3a6653d8c3777b07e0128a0d97d46e586e311 Mon Sep 17 00:00:00 2001
+From: Jan Rybar <jrybar@redhat.com>
+Date: Tue, 8 Oct 2019 13:28:18 +0000
+Subject: [PATCH] jsauthority: Fix two minor memory leaks
+
+(cherry picked from commit 28e3a6653d8c3777b07e0128a0d97d46e586e311)
+Signed-off-by: Jan Rybar <jrybar@redhat.com>
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ src/polkitbackend/polkitbackendjsauthority.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
+index 9b752d1..e97b8aa 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.cpp
++++ b/src/polkitbackend/polkitbackendjsauthority.cpp
+@@ -567,6 +567,8 @@ polkit_backend_js_authority_finalize (GObject *object)
+   g_strfreev (authority->priv->rules_dirs);
+ 
+   delete authority->priv->ac;
++  delete authority->priv->js_global;
++  delete authority->priv->js_polkit;
+ 
+   JS_DestroyContext (authority->priv->cx);
+   /* JS_ShutDown (); */
+-- 
+2.24.1
+
-- 
2.25.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 3/4] package/polkit: add upstream fix for SIGTTOU
  2020-04-18  2:58 [Buildroot] [PATCH 1/4] package/polkit: install service file aduskett at gmail.com
  2020-04-18  2:58 ` [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix aduskett at gmail.com
@ 2020-04-18  2:58 ` aduskett at gmail.com
  2020-05-06  5:27   ` Peter Korsgaard
  2020-04-18  2:58 ` [Buildroot] [PATCH 4/4] package/polkit: enable gobject-introspection support aduskett at gmail.com
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: aduskett at gmail.com @ 2020-04-18  2:58 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

If tty_handler() resets terminal while pkttyagent is run in background job,
the process gets stopped by SIGTTOU. This impacts systemctl, hence it must
be blocked for a while and then the process gets killed anyway.

Upstream commit: 28e3a6653d8c3777b07e0128a0d97d46e586e311

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 ...lkit-0.116-pkttyagent-sigttou-bg-job.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch

diff --git a/package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch b/package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch
new file mode 100644
index 0000000000..fb41df3af2
--- /dev/null
+++ b/package/polkit/0003-polkit-0.116-pkttyagent-sigttou-bg-job.patch
@@ -0,0 +1,34 @@
+From 76aae4fce586b400f5fe08df31497db19d624609 Mon Sep 17 00:00:00 2001
+From: Jan Rybar <jrybar@redhat.com>
+Date: Thu, 1 Aug 2019 06:46:10 +0000
+Subject: [PATCH] pkttyagent: process stopped by SIGTTOU if run in background
+ job
+
+
+(cherry picked from commit 76aae4fce586b400f5fe08df31497db19d624609)
+Signed-off-by: Jan Rybar <jrybar@redhat.com>
+Signed-off-by: Adam Duskett <aduskett@gmail.com>
+---
+ src/programs/pkttyagent.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/programs/pkttyagent.c b/src/programs/pkttyagent.c
+index 3c8d502..13879a2 100644
+--- a/src/programs/pkttyagent.c
++++ b/src/programs/pkttyagent.c
+@@ -264,6 +264,12 @@ main (int argc, char *argv[])
+ 
+   memset (&sa, 0, sizeof (sa));
+   sa.sa_handler = &tty_handler;
++/* If tty_handler() resets terminal while pkttyagent is run in background job,
++   the process gets stopped by SIGTTOU. This impacts systemctl, hence it must
++   be blocked for a while and then the process gets killed anyway.
++ */
++  sigemptyset(&sa.sa_mask);
++  sigaddset(&sa.sa_mask, SIGTTOU);
+   sigaction (SIGTERM, &sa, &savesigterm);
+   sigaction (SIGINT, &sa, &savesigint);
+   sigaction (SIGTSTP, &sa, &savesigtstp);
+-- 
+2.24.1
+
-- 
2.25.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 4/4] package/polkit: enable gobject-introspection support
  2020-04-18  2:58 [Buildroot] [PATCH 1/4] package/polkit: install service file aduskett at gmail.com
  2020-04-18  2:58 ` [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix aduskett at gmail.com
  2020-04-18  2:58 ` [Buildroot] [PATCH 3/4] package/polkit: add upstream fix for SIGTTOU aduskett at gmail.com
@ 2020-04-18  2:58 ` aduskett at gmail.com
  2020-04-18 12:55 ` [Buildroot] [PATCH 1/4] package/polkit: install service file Thomas Petazzoni
  2020-05-06  5:27 ` Peter Korsgaard
  4 siblings, 0 replies; 8+ messages in thread
From: aduskett at gmail.com @ 2020-04-18  2:58 UTC (permalink / raw)
  To: buildroot

From: Adam Duskett <Aduskett@gmail.com>

If gobject-introspection is selected, add the gobject-introspection package to
the dependency list and set the conf opt --enable-introspection.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/polkit/polkit.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/polkit/polkit.mk b/package/polkit/polkit.mk
index ee0b3674de..3ae42b2312 100644
--- a/package/polkit/polkit.mk
+++ b/package/polkit/polkit.mk
@@ -26,6 +26,13 @@ POLKIT_CONF_OPTS = \
 	--disable-libelogind \
 	--disable-libsystemd-login
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+POLKIT_CONF_OPTS += --enable-introspection
+POLKIT_DEPENDENCIES += gobject-introspection
+else
+POLKIT_CONF_OPTS += --disable-introspection
+endif
+
 ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
 POLKIT_DEPENDENCIES += linux-pam
 POLKIT_CONF_OPTS += --with-authfw=pam
-- 
2.25.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/4] package/polkit: install service file
  2020-04-18  2:58 [Buildroot] [PATCH 1/4] package/polkit: install service file aduskett at gmail.com
                   ` (2 preceding siblings ...)
  2020-04-18  2:58 ` [Buildroot] [PATCH 4/4] package/polkit: enable gobject-introspection support aduskett at gmail.com
@ 2020-04-18 12:55 ` Thomas Petazzoni
  2020-05-06  5:27 ` Peter Korsgaard
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2020-04-18 12:55 UTC (permalink / raw)
  To: buildroot

On Fri, 17 Apr 2020 19:58:13 -0700
aduskett at gmail.com wrote:

> From: Adam Duskett <Aduskett@gmail.com>
> 
> The default installed service file is missing a target, which causes preset-all
> to not enable the service.
> 
> Add the service file to package/polkit with the addition of:
> 
> [Install]
> WantedBy=multi-user.target
> 
> Signed-off-by: Adam Duskett <Aduskett@gmail.com>
> ---
>  package/polkit/polkit.mk      |  6 ++++++
>  package/polkit/polkit.service | 12 ++++++++++++
>  2 files changed, 18 insertions(+)
>  create mode 100644 package/polkit/polkit.service

I've applied the series. However, I hesitated to apply PATCH 1/4:
upstream provides a service file so it would be better to be able to
use it. Could you report to upstream the missing [Install] section in
the .service file ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/4] package/polkit: install service file
  2020-04-18  2:58 [Buildroot] [PATCH 1/4] package/polkit: install service file aduskett at gmail.com
                   ` (3 preceding siblings ...)
  2020-04-18 12:55 ` [Buildroot] [PATCH 1/4] package/polkit: install service file Thomas Petazzoni
@ 2020-05-06  5:27 ` Peter Korsgaard
  4 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2020-05-06  5:27 UTC (permalink / raw)
  To: buildroot

>>>>> "aduskett" == aduskett  <aduskett@gmail.com> writes:

 > From: Adam Duskett <Aduskett@gmail.com>
 > The default installed service file is missing a target, which causes preset-all
 > to not enable the service.

 > Add the service file to package/polkit with the addition of:

 > [Install]
 > WantedBy=multi-user.target

 > Signed-off-by: Adam Duskett <Aduskett@gmail.com>

Committed to 2020.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix
  2020-04-18  2:58 ` [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix aduskett at gmail.com
@ 2020-05-06  5:27   ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2020-05-06  5:27 UTC (permalink / raw)
  To: buildroot

>>>>> "aduskett" == aduskett  <aduskett@gmail.com> writes:

 > From: Adam Duskett <Aduskett@gmail.com>
 > This patch fixes two small memory leaks.

 > Upstream commit: 28e3a6653d8c3777b07e0128a0d97d46e586e311

 > Signed-off-by: Adam Duskett <Aduskett@gmail.com>

Committed to 2020.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 3/4] package/polkit: add upstream fix for SIGTTOU
  2020-04-18  2:58 ` [Buildroot] [PATCH 3/4] package/polkit: add upstream fix for SIGTTOU aduskett at gmail.com
@ 2020-05-06  5:27   ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2020-05-06  5:27 UTC (permalink / raw)
  To: buildroot

>>>>> "aduskett" == aduskett  <aduskett@gmail.com> writes:

 > From: Adam Duskett <Aduskett@gmail.com>
 > If tty_handler() resets terminal while pkttyagent is run in background job,
 > the process gets stopped by SIGTTOU. This impacts systemctl, hence it must
 > be blocked for a while and then the process gets killed anyway.

 > Upstream commit: 28e3a6653d8c3777b07e0128a0d97d46e586e311

 > Signed-off-by: Adam Duskett <Aduskett@gmail.com>

Committed to 2020.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-06  5:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18  2:58 [Buildroot] [PATCH 1/4] package/polkit: install service file aduskett at gmail.com
2020-04-18  2:58 ` [Buildroot] [PATCH 2/4] package/polkit: add upstream memory leak fix aduskett at gmail.com
2020-05-06  5:27   ` Peter Korsgaard
2020-04-18  2:58 ` [Buildroot] [PATCH 3/4] package/polkit: add upstream fix for SIGTTOU aduskett at gmail.com
2020-05-06  5:27   ` Peter Korsgaard
2020-04-18  2:58 ` [Buildroot] [PATCH 4/4] package/polkit: enable gobject-introspection support aduskett at gmail.com
2020-04-18 12:55 ` [Buildroot] [PATCH 1/4] package/polkit: install service file Thomas Petazzoni
2020-05-06  5:27 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.