Skip to content

Commit

Permalink
Build: Prevent GNOME 3 auth dlgs in TVNC sessions
Browse files Browse the repository at this point in the history
... by using a PolicyKit Local Authority (.pkla) file, which is
distributed in the RPM and DEB packages.

Fixes #47
Fixes #52
Fixes #207
  • Loading branch information
dcommander committed Mar 4, 2020
1 parent 39f431b commit 44c5a1a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ banner message on the command line by default. Set the `turbovnc.sshbannerdlg`
Java system property to `1` to display the banner message in a dialog box
instead, thus restoring the default behavior of TurboVNC 2.2.x.

19. The RPM and DEB packages generated by the TurboVNC build/packaging system
now include a PolicyKit Local Authority (.pkla) file that prevents various
authentication dialogs ("Authentication is required to create a color managed
device", "Authentication is required to access the PC/SC daemon",
"Authentication is required to refresh the system repositories") from popping
up when using the GNOME 3 window manager with the TurboVNC Server on various
Linux distributions.


2.2.5
=====
Expand Down
12 changes: 12 additions & 0 deletions release/makedpkg.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ Type=Application
Categories=Application;Utility;X-Red-Hat-Extra;
EOF

if [ "$SYSCONFDIR" = "/etc" ]; then
mkdir -p $TMPDIR/etc/polkit-1/localauthority/50-local.d
cat > $TMPDIR/etc/polkit-1/localauthority/50-local.d/45-turbovnc-gnome3.pkla << EOF
[Eliminate GNOME 3 dialogs in TurboVNC]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile;org.debian.pcsc-lite.access_pcsc;org.freedesktop.packagekit.system-sources-refresh
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
fi

if [ ! "$DATADIR" = "/usr/share" ]; then
safedirmove $TMPDIR/$DATADIR/icons $TMPDIR/usr/share/icons $TMPDIR/__tmpicons
fi
Expand Down
20 changes: 20 additions & 0 deletions release/rpm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,20 @@ Categories=Application;Utility;X-Red-Hat-Extra;
EOF
%endif

%if "%{server}" == "1"
%if "%{sysconfdir}" == "%{_sysconfdir}"
mkdir -p %{buildroot}/%{sysconfdir}/polkit-1/localauthority/50-local.d
cat > %{buildroot}/%{sysconfdir}/polkit-1/localauthority/50-local.d/45-turbovnc-gnome3.pkla << EOF
[Eliminate GNOME 3 dialogs in TurboVNC]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile;org.debian.pcsc-lite.access_pcsc;org.freedesktop.packagekit.system-sources-refresh
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
%endif
%endif

%clean
rm -rf %{buildroot}

Expand Down Expand Up @@ -238,6 +252,12 @@ fi
%config(noreplace) %{sysconfdir}/sysconfig/tvncservers
%config(noreplace) %{sysconfdir}/turbovncserver.conf
%config(noreplace) %{sysconfdir}/turbovncserver-security.conf
%if "%{sysconfdir}" == "%{_sysconfdir}"
%dir %{sysconfdir}/polkit-1
%attr(0750,root,polkitd) %dir %{sysconfdir}/polkit-1/localauthority
%dir %{sysconfdir}/polkit-1/localauthority/50-local.d
%config %{sysconfdir}/polkit-1/localauthority/50-local.d/45-turbovnc-gnome3.pkla
%endif
%endif

%dir %{docdir}
Expand Down

0 comments on commit 44c5a1a

Please sign in to comment.