aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-07-05 10:35:36 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-07-05 16:43:08 +0000
commitcbb46736761f055315f73eb24b41d9b4eeed6ff0 (patch)
treeb8c4408195aeaa1d10c028873cbaad1b0812b537
parent8ce4e6f48509ce331ee552887802f99111b2ae47 (diff)
downloadaports-cbb46736761f055315f73eb24b41d9b4eeed6ff0.tar.gz
aports-cbb46736761f055315f73eb24b41d9b4eeed6ff0.tar.bz2
aports-cbb46736761f055315f73eb24b41d9b4eeed6ff0.tar.xz
community/openrc-settingsd: ensure proper permissions on localtime and timezone
(cherry picked from commit 9c775617adc92f7919af23b7ee6550c2a42216a7)
-rw-r--r--community/openrc-settingsd/0002-Ensure-0664-permissions-on-etc-localtime.patch45
-rw-r--r--community/openrc-settingsd/APKBUILD6
2 files changed, 49 insertions, 2 deletions
diff --git a/community/openrc-settingsd/0002-Ensure-0664-permissions-on-etc-localtime.patch b/community/openrc-settingsd/0002-Ensure-0664-permissions-on-etc-localtime.patch
new file mode 100644
index 0000000000..345f76d410
--- /dev/null
+++ b/community/openrc-settingsd/0002-Ensure-0664-permissions-on-etc-localtime.patch
@@ -0,0 +1,45 @@
+From fdeef40875bebf3970d1365dc92cb893a0298097 Mon Sep 17 00:00:00 2001
+From: Rasmus Thomsen <oss@cogitri.dev>
+Date: Fri, 3 Jul 2020 12:19:52 +0200
+Subject: [PATCH 2/2] Ensure 0664 permissions on /etc/localtime
+
+Otherwise the timezone couldn't be read by other users
+---
+ src/timedated.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/timedated.c b/src/timedated.c
+index a6779f9..77d12ee 100644
+--- a/src/timedated.c
++++ b/src/timedated.c
+@@ -26,6 +26,7 @@
+
+ #include <dbus/dbus-protocol.h>
+ #include <glib.h>
++#include <glib/gstdio.h>
+ #include <gio/gio.h>
+
+ #if HAVE_OPENRC
+@@ -135,6 +136,9 @@ set_timezone (const gchar *_timezone_name,
+ g_prefix_error (error, "Unable to write '%s':", timezone_filename);
+ goto out;
+ }
++ if(g_chmod (timezone_filename, 0664) != 0) {
++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, "Unable to set 0664 permissions on timezone file '%s'", timezone_filename);
++ }
+
+ localtime_filename = g_file_get_path (localtime_file);
+ localtime2_filename = g_strdup_printf (DATADIR "/zoneinfo/%s", _timezone_name);
+@@ -158,6 +162,9 @@ set_timezone (const gchar *_timezone_name,
+ g_prefix_error (error, "Unable to write '%s':", localtime_filename);
+ goto out;
+ }
++ if(g_chmod (localtime_filename, 0664) != 0) {
++ g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, "Unable to set 0664 permissions on localtime file '%s'", localtime_filename);
++ }
+ } else {
+ // File doesn't exist yet -> make a new symlink
+ if (!g_file_make_symbolic_link (localtime_file, localtime2_filename, NULL, error)) {
+--
+2.26.2
+
diff --git a/community/openrc-settingsd/APKBUILD b/community/openrc-settingsd/APKBUILD
index acc07f355a..15e0f99915 100644
--- a/community/openrc-settingsd/APKBUILD
+++ b/community/openrc-settingsd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=openrc-settingsd
pkgver=1.0.1
-pkgrel=4
+pkgrel=5
pkgdesc="System settings D-Bus service for OpenRC"
url="https://gitweb.gentoo.org/proj/openrc-settingsd.git"
arch="all"
@@ -14,6 +14,7 @@ subpackages="$pkgname-doc $pkgname-openrc"
source="https://gitweb.gentoo.org/proj/openrc-settingsd.git/snapshot/openrc-settingsd-$pkgver.tar.gz
use-profiled-instead-of-envd.patch
0001-Make-etc-localtime-a-symlink-if-it-doesn-t-exist-yet.patch
+ 0002-Ensure-0664-permissions-on-etc-localtime.patch
"
prepare() {
@@ -46,4 +47,5 @@ package() {
sha512sums="bca589de7d2c96d8d15d93882b7296523a0d6301fe1d33f7fc03386544b5c050f2d819b9e1f005ee10a794883175ea1b1172411aad3598f967a6a5677a5c4aad openrc-settingsd-1.0.1.tar.gz
d06d691c1ef52c0e4c5d68ad7d25eba73ad8fffa3d3675f5c79ff93808131c11f4dbbd13db64c463bb87ec8ebed143878703ba281e1241947d66fcad48063e56 use-profiled-instead-of-envd.patch
-7ea84475fe6558d7b26726eefd452e89cb407a9e9beeff70163c1ec1f236988ae0b7e85644ca2baad7238d0c304bc54d899889605dd08e5cc60cbaf8b5e9abe5 0001-Make-etc-localtime-a-symlink-if-it-doesn-t-exist-yet.patch"
+7ea84475fe6558d7b26726eefd452e89cb407a9e9beeff70163c1ec1f236988ae0b7e85644ca2baad7238d0c304bc54d899889605dd08e5cc60cbaf8b5e9abe5 0001-Make-etc-localtime-a-symlink-if-it-doesn-t-exist-yet.patch
+2f1008b129472264ebeba985c6355a7317266b3d15dd7e9a2394930a8c4c61761315b005a4632b623957a269bae9f76db1f9e2430afaf042955231a480a5ece8 0002-Ensure-0664-permissions-on-etc-localtime.patch"