Hello community,

here is the log from the commit of package brltty for openSUSE:Factory checked 
in at 2016-06-29 15:03:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/brltty (Old)
 and      /work/SRC/openSUSE:Factory/.brltty.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "brltty"

Changes:
--------
--- /work/SRC/openSUSE:Factory/brltty/brltty.changes    2015-02-16 
07:36:28.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.brltty.new/brltty.changes       2016-06-29 
15:03:28.000000000 +0200
@@ -1,0 +2,26 @@
+Sun Jun 19 22:59:02 UTC 2016 - [email protected]
+
+- Add missing service_add_pre call. Add missing argument to fdupes.
+- Fix misplacement of /69-brltty.rules in the root directory
+  because pkgconfig(udev) was not requested, which led to _udevdir
+  being the empty string.
+
+-------------------------------------------------------------------
+Tue Jun  7 19:01:14 UTC 2016 - [email protected]
+
+- Update to version 5.3.1 (fate#320893).
+  + Too many changes; please read ChangeLog :
+    usr/share/doc/packages/brltty/ChangeLog
+- API version is now 0.6.4
+- Require systemd to build
+- Install brltty-atb, brltty-ktb, and brltty-tune (new binaries)
+
+- Add b40-1.patch - fix for invalid packets from a Brailliant
+
+- Add brltty-polkit.patch: support polkit-based authentication for brlapi.
+  Install policy file
+  Set polkit as default brlapi authentication mechanism
+
+- Install udev rules
+
+-------------------------------------------------------------------
@@ -15 +41 @@
-- Update to version 5.0.2
+- Update to version 5.2

Old:
----
  brltty-5.2.tar.xz

New:
----
  b40-1.patch
  brltty-5.3.1.tar.xz
  brltty-polkit.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ brltty.spec ++++++
--- /var/tmp/diff_new_pack.D3Uct6/_old  2016-06-29 15:03:29.000000000 +0200
+++ /var/tmp/diff_new_pack.D3Uct6/_new  2016-06-29 15:03:29.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package brltty
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,12 +18,12 @@
 
 %{!?tcl_version: %global tcl_version %(echo 'puts $tcl_version' | tclsh)}
 %{!?tcl_sitearch: %global tcl_sitearch %{_libdir}/tcl/tcl%{tcl_version}}
-%define api_version 0.6.3
+%define api_version 0.6.4
 %define sover 0_6
 %define soname libbrlapi%{sover}
 
 Name:           brltty
-Version:        5.2
+Version:        5.3.1
 Release:        0
 # FIXME libbraille driver when libbraille is in factory
 Summary:        Braille display driver for Linux/Unix
@@ -33,6 +33,8 @@
 
 Source0:        http://mielke.cc/brltty/archive/%{name}-%{version}.tar.xz
 Patch3:         brltty-5.0-speechd.diff
+Patch4:         b40-1.patch
+Patch5:         brltty-polkit.patch
 
 BuildRequires:  bison
 BuildRequires:  espeak-devel
@@ -48,6 +50,7 @@
 BuildRequires:  python3
 BuildRequires:  python3-Cython
 BuildRequires:  python3-devel
+BuildRequires:  systemd-devel
 BuildRequires:  systemd-rpm-macros
 BuildRequires:  tcl-devel
 BuildRequires:  pkgconfig(alsa)
@@ -55,11 +58,16 @@
 BuildRequires:  pkgconfig(dbus-1)
 BuildRequires:  pkgconfig(icu-i18n)
 BuildRequires:  pkgconfig(libusb-1.0)
+BuildRequires:  pkgconfig(polkit-gobject-1)
 BuildRequires:  pkgconfig(speech-dispatcher)
+BuildRequires:  pkgconfig(udev)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xaw7)
 BuildRequires:  pkgconfig(xt)
+# needed for patch5
+BuildRequires:  automake
 %{?systemd_requires}
+%define _udevdir %(pkg-config --variable udevdir udev)
 
 %description
 BRLTTY is a background process (daemon) which provides access to the
@@ -193,7 +201,7 @@
 
 %package -n brlapi-devel
 Summary:        Library to use BRLTTY from applications -- Development Files
-Group:          System/Daemons
+Group:          Development/Libraries/C and C++
 Requires:       %{soname} = %{version}
 
 %description -n brlapi-devel
@@ -281,6 +289,8 @@
 %prep
 %setup -q
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 # Fix "wrong-file-end-of-line-encoding" rpmlint warning
 sed -i 's/\r$//' Documents/Manual-BRLTTY/Portuguese/BRLTTY.txt
 
@@ -293,14 +303,17 @@
       java_inc="$java_inc $i"
 done
 export PYTHON=/usr/bin/python3
+# Needed for patch5
+./autogen
 %configure CPPFLAGS="$java_inc" \
         --with-install-root="%{buildroot}" \
         --disable-stripping
-%__make -j1 # not parallel build safe
+make -j1 # not parallel build safe
 
 %install
 make install DESTDIR="%buildroot"
 %find_lang %{name}
+sed -i "s/#api-parameters Auth=polkit/api-parameters Auth=polkit/" 
Documents/brltty.conf
 install -D -m644 Documents/brltty.conf %{buildroot}%{_sysconfdir}/brltty.conf
 # ghost brlapi.key
 touch %{buildroot}%{_sysconfdir}/brlapi.key
@@ -312,8 +325,10 @@
 sed -i s=/bin/brltty=%{_bindir}/brltty= Autostart/Systemd/%{name}.service
 install -m644 Autostart/Systemd/%{name}.service %{buildroot}%{_unitdir}
 ln -sf ../../%{_unitdir}/%{name}.service %{buildroot}%{_sbindir}/rc%{name}
-%{__rm} %{buildroot}%{_libdir}/libbrlapi.a
-%{__rm} %{buildroot}%{_libdir}/ocaml/brlapi/libbrlapi_stubs.a
+mkdir -p %{buildroot}%{_udevdir}
+install -m644 Autostart/Udev/udev.rules 
%{buildroot}%{_udevdir}/69-%{name}.rules
+rm %{buildroot}%{_libdir}/libbrlapi.a
+rm %{buildroot}%{_libdir}/ocaml/brlapi/libbrlapi_stubs.a
 # fix missing executable bits
 test ! -x %{buildroot}%{_bindir}/brltty-config
 chmod a+x %{buildroot}%{_bindir}/brltty-config
@@ -333,18 +348,15 @@
 rm -f %{buildroot}%{_datadir}/gdm/greeter/autostart/xbrlapi.desktop
 
 %fdupes -s %{buildroot}%{_mandir}
-%fdupes -s 
+%fdupes -s %{buildroot} 
 
 # fix brp-tcl wrong location for Tcl files
-%{__mkdir} -p %{buildroot}%{tcl_sitearch}
-%{__mv} %{buildroot}%{_libdir}/brlapi-%{api_version} 
%{buildroot}%{tcl_sitearch}/
+mkdir -p %{buildroot}%{tcl_sitearch}
+mv %{buildroot}%{_libdir}/brlapi-%{api_version} %{buildroot}%{tcl_sitearch}/
 
 %pre -n %{soname}
 getent group brlapi >/dev/null || groupadd -r brlapi >/dev/null
 
-%post 
-%service_add_post %{name}.service
-
 %post -n %{soname}
 if [ ! -e %{_sysconfdir}/brlapi.key ]; then
  mcookie > %{_sysconfdir}/brlapi.key
@@ -353,14 +365,20 @@
 fi
 /sbin/ldconfig
 
+%postun -n %{soname} -p /sbin/ldconfig
+
+%pre
+%service_add_pre %{name}.service
+
+%post 
+%service_add_post %{name}.service
+
 %preun 
 %service_del_preun %{name}.service
 
 %postun
 %service_del_postun %{name}.service
 
-%postun -n %{soname} -p /sbin/ldconfig
-
 %files
 %defattr(-, root, root)
 %doc LICENSE-GPL LICENSE-LGPL README Documents/ChangeLog 
Documents/CONTRIBUTORS Documents/HISTORY Documents/README.Bluetooth 
Documents/TODO
@@ -368,15 +386,19 @@
 %config(noreplace) %{_sysconfdir}/brltty.conf
 %{_sysconfdir}/brltty/
 %{_bindir}/brltty
+%{_bindir}/brltty-atb
 %{_bindir}/brltty-config
 %{_bindir}/brltty-ctb
+%{_bindir}/brltty-ktb
 %{_bindir}/brltty-trtxt
 %{_bindir}/brltty-ttb
+%{_bindir}/brltty-tune
 %{_bindir}/eutp
 %{_libdir}/brltty/
 %{_mandir}/man1/brltty.1*
 %{_mandir}/man1/eutp.1.gz
 %{_sbindir}/rc%{name}
+%{_udevdir}/69-%{name}.rules
 %{_unitdir}/%{name}.service
 %exclude %{_libdir}/brltty/libbrlttybba.so
 %exclude %{_libdir}/brltty/libbrlttyblb.so

++++++ b40-1.patch ++++++
diff --git a/Drivers/Braille/Baum/braille.c b/Drivers/Braille/Baum/braille.c
index 7cc0be0..9a9ea3e 100644
--- a/Drivers/Braille/Baum/braille.c
+++ b/Drivers/Braille/Baum/braille.c
@@ -1219,6 +1219,7 @@ verifyBaumPacket (
         break;
 
       default:
+        pvd->state = BAUM_PVS_WAITING;
         return BRL_PVR_INVALID;
     }
   } else if (size == 2) {
++++++ brltty-5.0-speechd.diff ++++++
--- /var/tmp/diff_new_pack.D3Uct6/_old  2016-06-29 15:03:29.000000000 +0200
+++ /var/tmp/diff_new_pack.D3Uct6/_new  2016-06-29 15:03:29.000000000 +0200
@@ -26,6 +26,19 @@
  
  static SPDConnection *connectionHandle = NULL;
  static const char *moduleName;
+diff --git a/configure.ac b/configure.ac
+index bc14d72..a832e78 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1697,7 +1697,7 @@ BRLTTY_ARG_DISABLE(
+    BRLTTY_SPEECH_DRIVER([fv], [Festival])
+    BRLTTY_SPEECH_DRIVER([gs], [GenericSay])
+    BRLTTY_IF_PACKAGE([Mikropuhe], [mikropuhe], [mpwrfile.h], 
[BRLTTY_IF_PTHREADS([BRLTTY_SPEECH_DRIVER([mp], [Mikropuhe], [-L$(MPLINUX_ROOT) 
-lmplinux])])])
+-   BRLTTY_IF_PACKAGE([speech-dispatcher], [speechd], [include/libspeechd.h], 
[BRLTTY_SPEECH_DRIVER([sd], [SpeechDispatcher], [-L$(SPEECHD_ROOT)/lib 
-lspeechd])])
++   BRLTTY_IF_PACKAGE([speech-dispatcher], [speechd], 
[include/speech-dispatcher/libspeechd.h], [BRLTTY_SPEECH_DRIVER([sd], 
[SpeechDispatcher], [-L$(SPEECHD_ROOT)/lib -lspeechd])])
+    BRLTTY_IF_PACKAGE([Swift], [swift], [include/swift.h], 
[BRLTTY_SPEECH_DRIVER([sw], [Swift], [-L$(SWIFT_ROOT)/lib -lswift -lm])])
+    BRLTTY_IF_PACKAGE([Theta], [theta], [include/theta.h], 
[BRLTTY_SPEECH_DRIVER([th], [Theta], [-L$(THETA_ROOT)/lib -ltheta])])
+    BRLTTY_IF_PACKAGE([ViaVoice], [viavoice], [include/eci.h], 
[BRLTTY_SPEECH_DRIVER([vv], [ViaVoice], [-L$(VIAVOICE_ROOT)/lib -libmeci50])])
 Index: brltty-4.3/configure
 ===================================================================
 --- brltty-4.3.orig/configure

++++++ brltty-5.2.tar.xz -> brltty-5.3.1.tar.xz ++++++
/work/SRC/openSUSE:Factory/brltty/brltty-5.2.tar.xz 
/work/SRC/openSUSE:Factory/.brltty.new/brltty-5.3.1.tar.xz differ: char 25, 
line 1

++++++ brltty-polkit.patch ++++++
>From e62b3c925d03239a372d425fb87b2cac65d8ef19 Mon Sep 17 00:00:00 2001
From: Dave Mielke <[email protected]>
Date: Thu, 28 Jan 2016 18:46:28 -0500
Subject: [PATCH] Add Polkit authorization manager support. (mg)

---
 Auth/Polkit/org.brltty.policy | 19 ++++++++++
 Programs/Makefile.in          |  2 +-
 Programs/auth.c               | 87 +++++++++++++++++++++++++++++++++++++++++++
 config.h.in                   |  3 ++
 config.mk.in                  |  6 ++-
 configure.ac                  |  3 ++
 6 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 Auth/Polkit/org.brltty.policy

diff --git a/Auth/Polkit/org.brltty.policy b/Auth/Polkit/org.brltty.policy
new file mode 100644
index 0000000..bc312c5
--- /dev/null
+++ b/Auth/Polkit/org.brltty.policy
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd";>
+<policyconfig>
+  <vendor>The BRLTTY developers</vendor>
+  <vendor_url>http://www.brltty.com/</vendor_url>
+
+  <action id="org.brltty.write-display">
+    <description>Write to the Braille display</description>
+    <message>Privileges are required to access the Braille display</message>
+    <defaults>
+      <allow_any>no</allow_any>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>yes</allow_active>
+    </defaults>
+  </action>
+
+</policyconfig>
diff --git a/Programs/Makefile.in b/Programs/Makefile.in
index 93f3a36..33b28ad 100644
--- a/Programs/Makefile.in
+++ b/Programs/Makefile.in
@@ -308,7 +308,7 @@ pid.$O:
 ###############################################################################
 
 auth.$O:
-       $(CC) $(LIBCFLAGS) -c $(SRC_DIR)/auth.c
+       $(CC) $(LIBCFLAGS) $(POLKIT_INCLUDES) -c $(SRC_DIR)/auth.c
 
 dataarea.$O:
        $(CC) $(LIBCFLAGS) -c $(SRC_DIR)/dataarea.c
diff --git a/Programs/auth.c b/Programs/auth.c
index fe56020..1913640 100644
--- a/Programs/auth.c
+++ b/Programs/auth.c
@@ -437,6 +437,84 @@ authGroup_server (AuthDescriptor *auth, FileDescriptor fd, 
void *data) {
   return getPeerCredentials(auth, fd) &&
          checkPeerGroup(&auth->peerCredentials, group);
 }
+
+#ifdef USE_POLKIT
+#include <polkit/polkit.h>
+
+typedef struct {
+  PolkitAuthority *authority;
+} MethodDescriptor_polkit;
+
+static void *
+authPolkit_initialize (const char *parameter) {
+  MethodDescriptor_polkit *polkit;
+
+  if ((polkit = malloc(sizeof(*polkit)))) {
+    memset(polkit, 0, sizeof(*polkit));
+
+    GError *error_local = NULL;
+    polkit->authority = polkit_authority_get_sync(NULL, &error_local);
+
+    if (polkit->authority) {
+      return polkit;
+    } else {
+      g_error_free(error_local);
+      g_free(polkit);
+    }
+  } else {
+    logMallocError();
+  }
+
+  return NULL;
+}
+
+static void
+authPolkit_release (void *data) {
+  MethodDescriptor_polkit *polkit = data;
+  g_object_unref (polkit->authority);
+  free(polkit);
+}
+
+static int
+authPolkit_server (AuthDescriptor *auth, FileDescriptor fd, void *data) {
+  MethodDescriptor_polkit *polkit = data;
+
+  struct ucred cred;
+  socklen_t length = sizeof(cred);
+
+  if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &length) != -1) {
+    logMessage(LOG_DEBUG, "attempting to authenticate pid %d via polkit", 
cred.pid);
+
+    PolkitSubject *subject = polkit_unix_process_new_for_owner(cred.pid, -1, 
-1);
+    GError *error_local = NULL;
+
+    PolkitAuthorizationResult *result = 
polkit_authority_check_authorization_sync(
+      polkit->authority,
+      subject,
+      "org.brltty.write-display",
+      NULL,
+      POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE,
+      NULL,
+      &error_local
+    );
+
+    if (result) {
+      g_object_unref(result);
+
+      int isAuthorized = polkit_authorization_result_get_is_authorized(result);
+      logMessage(LOG_DEBUG, "polkit_authority_check_authorization_sync 
returned %d", isAuthorized);
+      return isAuthorized;
+    } else {
+      logSystemError("polkit_authority_check_authorization_sync");
+      g_error_free(error_local);
+    }
+  } else {
+    logSystemError("getsockopt[SO_PEERCRED]");
+  }
+
+  return 0;
+}
+#endif /* USE_POLKIT */
 #endif /* CAN_CHECK_CREDENTIALS */
 
 /* general functions */
@@ -463,6 +541,15 @@ static const MethodDefinition methodDefinitions[] = {
     .client = NULL,
     .server = authGroup_server
   },
+
+#ifdef USE_POLKIT
+  { .name = "polkit",
+    .initialize = authPolkit_initialize,
+    .release = authPolkit_release,
+    .client = NULL,
+    .server = authPolkit_server
+  },
+#endif /* USE_POLKIT */
 #endif /* CAN_CHECK_CREDENTIALS */
 
   {.name = NULL}
diff --git a/config.h.in b/config.h.in
index caa952f..9d03007 100644
--- a/config.h.in
+++ b/config.h.in
@@ -424,6 +424,9 @@ extern "C" {
 #undef USE_PKG_PORTS_MSDOS
 #undef USE_PKG_PORTS_WINDOWS
 
+/* Define this if the Polkit authorization manager is to be used. */
+#undef USE_POLKIT
+
 /* Define only one of the following curses packages. */
 #undef HAVE_PKG_CURSES
 #undef HAVE_PKG_NCURSES
diff --git a/config.mk.in b/config.mk.in
index b1ea111..b707bd4 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -102,6 +102,10 @@ DBUS_PACKAGE = @dbus_package@
 DBUS_INCLUDES = @dbus_includes@
 DBUS_LIBS = @dbus_libs@
 
+POLKIT_PACKAGE = @polkit_package@
+POLKIT_INCLUDES = @polkit_includes@
+POLKIT_LIBS = @polkit_libs@
+
 ICU_INCLUDES = @icu_includes@
 ICU_LIBS = @icu_libs@
 
@@ -244,7 +248,7 @@ LIBCXXFLAGS = $(CXXFLAGS) @LIBCXXFLAGS@
 
 LD = @LD@
 LDFLAGS = @LDFLAGS@
-LDLIBS = $(ICU_LIBS) $(SYSTEM_LIBS) @LIBS@
+LDLIBS = $(ICU_LIBS) $(POLKIT_LIBS) $(SYSTEM_LIBS) @LIBS@
 
 MKOBJ = @MKOBJ@
 MKMOD = @MKMOD@
diff --git a/configure.ac b/configure.ac
index b4382cd..aacdc29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1778,6 +1778,9 @@ BRLTTY_HAVE_PACKAGE([dbus], ["dbus-1 >= 1.0"], [dnl
 BRLTTY_ARG_DRIVER([screen], [Screen])
 BRLTTY_SUMMARY_ITEM([screen-driver], [default_screen_driver])
 
+BRLTTY_HAVE_PACKAGE([polkit], [polkit-gobject-1],
+AC_DEFINE(USE_POLKIT, 1, [if the Polkit authorization manager should be used]))
+
 BRLTTY_ARG_ENABLE(
    [relocatable-install],
    [installation using paths relative to the program directory])
-- 
2.6.2

>From b010048fdb6bdfbcadcd984fe5a85aa7a429d72a Mon Sep 17 00:00:00 2001
From: Dave Mielke <[email protected]>
Date: Thu, 28 Jan 2016 19:12:04 -0500
Subject: [PATCH] Add some spacing to the Polkit policy file. (dm)

---
 Auth/Polkit/org.brltty.policy | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Auth/Polkit/org.brltty.policy b/Auth/Polkit/org.brltty.policy
index bc312c5..5460e81 100644
--- a/auth/Polkit/org.brltty.policy
+++ b/Auth/Polkit/org.brltty.policy
@@ -1,19 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!DOCTYPE policyconfig PUBLIC
  "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd";>
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd";
+>
+
 <policyconfig>
-  <vendor>The BRLTTY developers</vendor>
+  <vendor>The BRLTTY Developers</vendor>
   <vendor_url>http://www.brltty.com/</vendor_url>
 
   <action id="org.brltty.write-display">
-    <description>Write to the Braille display</description>
-    <message>Privileges are required to access the Braille display</message>
+    <description>Write to the braille display</description>
+    <message>Privileges are required to access the braille display</message>
+
     <defaults>
       <allow_any>no</allow_any>
       <allow_inactive>no</allow_inactive>
       <allow_active>yes</allow_active>
     </defaults>
   </action>
-
 </policyconfig>
-- 
2.6.2

>From 07d01a34bacc7166b4440fec02a89f9f74c2298a Mon Sep 17 00:00:00 2001
From: Dave Mielke <[email protected]>
Date: Tue, 2 Feb 2016 23:34:11 -0500
Subject: [PATCH] Fixes to Polkit authorization: (mg)

Log if polkit_unix_process_new_for_owner() fails.
Add comments to the arguments to polkit_authority_check_authorization_sync().
Move the g_object_unref() so that it isn't called until we're finished with the 
result.
---
 Programs/auth.c | 44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/Programs/auth.c b/Programs/auth.c
index 1913640..113fe9a 100644
--- a/Programs/auth.c
+++ b/Programs/auth.c
@@ -486,27 +486,31 @@ authPolkit_server (AuthDescriptor *auth, FileDescriptor 
fd, void *data) {
     logMessage(LOG_DEBUG, "attempting to authenticate pid %d via polkit", 
cred.pid);
 
     PolkitSubject *subject = polkit_unix_process_new_for_owner(cred.pid, -1, 
-1);
-    GError *error_local = NULL;
-
-    PolkitAuthorizationResult *result = 
polkit_authority_check_authorization_sync(
-      polkit->authority,
-      subject,
-      "org.brltty.write-display",
-      NULL,
-      POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE,
-      NULL,
-      &error_local
-    );
-
-    if (result) {
-      g_object_unref(result);
-
-      int isAuthorized = polkit_authorization_result_get_is_authorized(result);
-      logMessage(LOG_DEBUG, "polkit_authority_check_authorization_sync 
returned %d", isAuthorized);
-      return isAuthorized;
+    if (subject) {
+      GError *error_local = NULL;
+
+      PolkitAuthorizationResult *result = 
polkit_authority_check_authorization_sync(
+        polkit->authority,                     /* authority */
+        subject,                               /* PolkitSubject for client */
+        "org.brltty.write-display",            /* name of polkit action */
+        NULL,                                  /* details */
+        POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE, /* disallow interaction */
+        NULL,                                  /* GCancellable */
+        &error_local                           /* returned error */
+      );
+
+      if (result) {
+        int isAuthorized = 
polkit_authorization_result_get_is_authorized(result);
+        g_object_unref(result);
+
+        logMessage(LOG_DEBUG, "polkit_authority_check_authorization_sync 
returned %d", isAuthorized);
+        return isAuthorized;
+      } else {
+        logSystemError("polkit_authority_check_authorization_sync");
+        g_error_free(error_local);
+      }
     } else {
-      logSystemError("polkit_authority_check_authorization_sync");
-      g_error_free(error_local);
+      logSystemError("polkit_unix_process_new_for_owner");
     }
   } else {
     logSystemError("getsockopt[SO_PEERCRED]");
-- 
2.6.2

>From 74affe7d1401f2b43ad32e18cb78704d22604ad7 Mon Sep 17 00:00:00 2001
From: Dave Mielke <[email protected]>
Date: Tue, 12 Apr 2016 14:11:09 -0400
Subject: [PATCH] Fix a Polkit authorization race condition. (sk)

Using just the PID is deprecated as the obtained UID may be inaccurate.
---
 Documents/CONTRIBUTORS | 1 +
 Programs/auth.c        | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documents/CONTRIBUTORS b/Documents/CONTRIBUTORS
index b2afc0b..77329a7 100644
--- a/Documents/CONTRIBUTORS
+++ b/Documents/CONTRIBUTORS
@@ -51,6 +51,7 @@ Rudolf Weeber <[email protected]>
 Samuel Thibault <[email protected]>
 Samuel Yang <[email protected]>
 Sébastien Hinderer <[email protected]>
+Sebastian Krahmer <[email protected]>
 Sérgio Neves <[email protected]>
 Simon Kainz <[email protected]>
 Simon Meers <[email protected]>
diff --git a/Programs/auth.c b/Programs/auth.c
index 113fe9a..f93afad 100644
--- a/Programs/auth.c
+++ b/Programs/auth.c
@@ -485,7 +485,7 @@ authPolkit_server (AuthDescriptor *auth, FileDescriptor fd, 
void *data) {
   if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &length) != -1) {
     logMessage(LOG_DEBUG, "attempting to authenticate pid %d via polkit", 
cred.pid);
 
-    PolkitSubject *subject = polkit_unix_process_new_for_owner(cred.pid, -1, 
-1);
+    PolkitSubject *subject = polkit_unix_process_new_for_owner(cred.pid, -1, 
cred.uid);
     if (subject) {
       GError *error_local = NULL;
 
-- 
2.6.2

diff --git a/Documents/brltty.conf.in b/Documents/brltty.conf.in
index 34ef415..05e37c7 100644
--- a/Documents/brltty.conf.in
+++ b/Documents/brltty.conf.in
@@ -537,6 +537,7 @@
 #api-parameters Auth=keyfile:@CONFIGURATION_DIRECTORY@/@api_authkeyfile@       
# Require authentication key
 #api-parameters Auth=user:joe          # Allow some local user
 #api-parameters Auth=group:brl         # Allow some local group
+#api-parameters Auth=polkit            # authenticate via polkit
 #api-parameters Host=:0                        # Accept only local Unix 
connections
 #api-parameters Host=0.0.0.0:0         # Accept any internet connection.
 #api-parameters StackSize=65536

Reply via email to