commit tigervnc for openSUSE:Factory
Hello community, here is the log from the commit of package tigervnc for openSUSE:Factory checked in at 2017-10-02 16:52:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/tigervnc (Old) and /work/SRC/openSUSE:Factory/.tigervnc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "tigervnc" Mon Oct 2 16:52:23 2017 rev:45 rq:530419 version:1.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/tigervnc/tigervnc.changes 2017-09-13 22:27:17.773277555 +0200 +++ /work/SRC/openSUSE:Factory/.tigervnc.new/tigervnc.changes 2017-10-02 16:52:31.348550207 +0200 @@ -1,0 +2,19 @@ +Tue Sep 26 11:53:23 UTC 2017 - msrb@suse.com + +- u_Unset-pixel-buffer-when-x0vncserver-client-disconnect.patch + * Fixes crash in x0vncserver after client disconnects. + (bnc#1058587) + +------------------------------------------------------------------- +Mon Sep 25 08:36:07 UTC 2017 - msrb@suse.com + +- Add tigervnc-x11vnc wrapper for x0vncserver that replaces x11vnc. + (fate#323207) + +- Replace java applet with novnc as web-based VNC viewer. + (fate#323880) + +- Convert xinetd services to systemd socket activated services. + (bnc#1058460) + +------------------------------------------------------------------- Old: ---- vnc.xinetd vnc_inetd_httpd New: ---- u_Unset-pixel-buffer-when-x0vncserver-client-disconnect.patch x11vnc xvnc-novnc.service xvnc-novnc.socket xvnc.socket xvnc@.service ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tigervnc.spec ++++++ --- /var/tmp/diff_new_pack.knMmyu/_old 2017-10-02 16:52:34.152156704 +0200 +++ /var/tmp/diff_new_pack.knMmyu/_new 2017-10-02 16:52:34.152156704 +0200 @@ -22,6 +22,8 @@ %define tlskey %{_sysconfdir}/vnc/tls.key %define tlscert %{_sysconfdir}/vnc/tls.cert +%define _unitdir %{_prefix}/lib/systemd/system + Name: tigervnc Version: 1.8.0 Release: 0 @@ -53,6 +55,7 @@ BuildRequires: mozilla-nss BuildRequires: pam-devel BuildRequires: pkg-config +BuildRequires: systemd-rpm-macros BuildRequires: xmlto BuildRequires: xorg-x11-libICE-devel BuildRequires: xorg-x11-libSM-devel @@ -101,16 +104,20 @@ License: GPL-2.0 and MIT Group: System/X11/Servers/XF86_4 Source1: https://github.com/TigerVNC/tigervnc/archive/v%{version}.tar.gz -Source3: vnc.xinetd Source4: 10-libvnc.conf Source5: vnc-server.firewall Source6: vnc-httpd.firewall -Source7: vnc_inetd_httpd -Source8: vnc.reg -Source9: vncpasswd.arg -Source10: vnc.pam -Source11: with-vnc-key.sh -Source12: index.vnc +Source7: vnc.reg +Source8: vncpasswd.arg +Source9: vnc.pam +Source10: with-vnc-key.sh +Source11: index.vnc +Source12: x11vnc +Source13: xvnc@.service +Source14: xvnc.socket +Source15: xvnc-novnc.service +Source16: xvnc-novnc.socket + Patch1: tigervnc-newfbsize.patch Patch2: tigervnc-clean-pressed-key-on-exit.patch Patch3: u_tigervnc-ignore-epipe-on-write.patch @@ -122,6 +129,7 @@ Patch9: U_allow_multiple_certs_with_same_dn_in_saved_certs_file.patch Patch10: U_handle_certificate_verification_for_saved_certs_correctly.patch Patch11: u_tigervnc-add-autoaccept-parameter.patch +Patch12: u_Unset-pixel-buffer-when-x0vncserver-client-disconnect.patch %description TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), @@ -135,18 +143,15 @@ Requires(post): /usr/sbin/groupadd # Needed to generate certificates Requires: openssl -# Needed to serve java applet -Requires: python -Requires: python-pyOpenSSL Requires: windowmanager Requires: xauth -Requires: xinetd Requires: xinit Requires: xkbcomp Requires: xkeyboard-config Requires: xorg-x11-fonts-core # For the with-vnc-key.sh script Requires: /bin/hostname +%{?systemd_requires} Provides: xorg-x11-Xvnc:/usr/lib/vnc/with-vnc-key.sh Summary: TigerVNC implementation of Xvnc Group: System/X11/Servers/XF86_4 @@ -154,6 +159,29 @@ %description -n xorg-x11-Xvnc This is the TigerVNC implementation of Xvnc. +%package -n xorg-x11-Xvnc-novnc +Requires: novnc +Requires: python-websockify +Requires: xorg-x11-Xvnc +%{?systemd_requires} +Summary: NoVNC service for Xvnc +Group: System/X11/Servers/XF86_4 +BuildArch: noarch + +%description -n xorg-x11-Xvnc-novnc +A service that starts noVNC linked to Xvnc server. + +%package -n xorg-x11-Xvnc-java +BuildArch: noarch + +%{?systemd_requires} +Summary: VNC viewer in java +Group: System/X11/Servers/XF86_4 + +%description -n xorg-x11-Xvnc-java +A VNC client written in java that can be used as standalone application or as +an applet inside web page. + %package -n libXvnc1 Summary: X extension to control VNC module Group: System/Libraries @@ -169,6 +197,19 @@ %description -n libXvnc-devel Xvnc extension allows X clients to read and change VNC configuration. +%package x11vnc +Summary: Wrapper that starts x0vncserver +Group: System/X11/Servers/XF86_4 +Requires: python +Requires: xorg-x11-Xvnc +Provides: x11vnc +Conflicts: x11vnc +BuildArch: noarch + +%description x11vnc +This is a wrapper that looks like x11vnc, but starts x0vncserver instead. +It maps common x11vnc arguments to x0vncserver arguments. + %prep %setup -T -b1 -q cp -r /usr/src/xserver/* unix/xserver/ @@ -184,6 +225,7 @@ %patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 pushd unix/xserver patch -p1 < ../xserver119.patch @@ -242,36 +284,40 @@ install -m755 VncViewer.jar $RPM_BUILD_ROOT%{_datadir}/vnc/classes popd -install -D -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/xinetd.d/vnc %ifnarch s390x install -D -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/X11/xorg.conf.d/10-libvnc.conf %endif install -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/vnc-server install -D -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/vnc-httpd -install -D -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_bindir}/vnc_inetd_httpd -install -D -m 644 %{SOURCE8} $RPM_BUILD_ROOT/etc/slp.reg.d/vnc.reg -install -D -m 755 %{SOURCE9} $RPM_BUILD_ROOT%{_bindir}/vncpasswd.arg -install -D -m 644 %{SOURCE10} $RPM_BUILD_ROOT/etc/pam.d/vnc -install -D -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/vnc/classes +install -D -m 644 %{SOURCE7} $RPM_BUILD_ROOT/etc/slp.reg.d/vnc.reg +install -D -m 755 %{SOURCE8} $RPM_BUILD_ROOT%{_bindir}/vncpasswd.arg +install -D -m 644 %{SOURCE9} $RPM_BUILD_ROOT/etc/pam.d/vnc +install -D -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_datadir}/vnc/classes %if 0%{?suse_version} >= 1315 ln -s -f %{_sysconfdir}/alternatives/vncviewer $RPM_BUILD_ROOT%{_bindir}/vncviewer ln -s -f %{_sysconfdir}/alternatives/vncviewer.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/vncviewer.1.gz %endif +mkdir -p %{buildroot}%{_sbindir} +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcxvnc +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcxvnc-novnc + mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/vnc mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/vnc -install -D -m 755 %{SOURCE11} $RPM_BUILD_ROOT%{_libexecdir}/vnc +install -D -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{_libexecdir}/vnc + +install -D -m 755 %{SOURCE12} $RPM_BUILD_ROOT%{_bindir}/x11vnc + +install -D %{SOURCE13} -m 0444 %{buildroot}%{_unitdir}/xvnc@.service +install -D %{SOURCE14} -m 0444 %{buildroot}%{_unitdir}/xvnc.socket +install -D %{SOURCE15} -m 0444 %{buildroot}%{_unitdir}/xvnc-novnc.service +install -D %{SOURCE16} -m 0444 %{buildroot}%{_unitdir}/xvnc-novnc.socket rm -rf $RPM_BUILD_ROOT/usr/share/doc/tigervnc-* %find_lang '%{name}' -%pre -n xorg-x11-Xvnc -getent group %{vncgroup} > /dev/null || groupadd -r %{vncgroup} || : -getent passwd %{vncuser} > /dev/null || useradd -r -g %{vncgroup} -d /var/lib/empty -s /sbin/nologin -c "user for VNC" %{vncuser} || : -usermod -G shadow -a %{vncuser} || : - %post %if 0%{?suse_version} >= 1315 %_sbindir/update-alternatives \ @@ -286,6 +332,38 @@ fi %endif +%pre -n xorg-x11-Xvnc +%service_add_pre xvnc.socket + +getent group %{vncgroup} > /dev/null || groupadd -r %{vncgroup} || : +getent passwd %{vncuser} > /dev/null || useradd -r -g %{vncgroup} -d /var/lib/empty -s /sbin/nologin -c "user for VNC" %{vncuser} || : +usermod -G shadow -a %{vncuser} || : + +%post -n xorg-x11-Xvnc +%service_add_post xvnc.socket + +%preun -n xorg-x11-Xvnc +%service_del_preun xvnc.socket + +%postun -n xorg-x11-Xvnc +%service_del_postun xvnc.socket + +%pre -n xorg-x11-Xvnc-novnc +%service_add_pre xvnc-novnc.service +%service_add_pre xvnc-novnc.socket + +%post -n xorg-x11-Xvnc-novnc +%service_add_post xvnc-novnc.service +%service_add_post xvnc-novnc.socket + +%preun -n xorg-x11-Xvnc-novnc +%service_del_preun xvnc-novnc.service +%service_del_preun xvnc-novnc.socket + +%postun -n xorg-x11-Xvnc-novnc +%service_del_postun xvnc-novnc.service +%service_del_postun xvnc-novnc.socket + %post -n libXvnc1 -p /sbin/ldconfig %postun -n libXvnc1 -p /sbin/ldconfig @@ -330,7 +408,6 @@ %{_bindir}/vncpasswd.arg %{_bindir}/vncserver %{_bindir}/x0vncserver -%{_bindir}/vnc_inetd_httpd %exclude %{_mandir}/man1/Xserver.1* %{_mandir}/man1/Xvnc.1* @@ -339,6 +416,10 @@ %{_mandir}/man1/vncserver.1* %{_mandir}/man1/x0vncserver.1* +%{_unitdir}/xvnc@.service +%{_unitdir}/xvnc.socket +%{_sbindir}/rcxvnc + %exclude /usr/%{_lib}/xorg/protocol.txt %exclude /usr/%{_lib}/xorg/modules/extensions/libvnc.la %ifnarch s390 s390x @@ -359,7 +440,6 @@ %else %exclude /etc/X11/xorg.conf.d %endif -%config(noreplace) /etc/xinetd.d/vnc %dir /etc/slp.reg.d %config(noreplace) /etc/slp.reg.d/vnc.reg @@ -369,15 +449,21 @@ %exclude /usr/lib/debug/.* %exclude /usr/src/debug -%doc java/com/tigervnc/vncviewer/README -%{_datadir}/vnc - %dir %attr(0755,%{vncuser},%{vncuser}) %{_sysconfdir}/vnc %ghost %attr(0600,%{vncuser},%{vncuser}) %config(noreplace) %{tlskey} %ghost %attr(0644,%{vncuser},%{vncuser}) %config(noreplace) %{tlscert} %{_libexecdir}/vnc +%files -n xorg-x11-Xvnc-novnc +%{_unitdir}/xvnc-novnc.service +%{_unitdir}/xvnc-novnc.socket +%{_sbindir}/rcxvnc-novnc + +%files -n xorg-x11-Xvnc-java +%doc java/com/tigervnc/vncviewer/README +%{_datadir}/vnc + %files -n libXvnc1 %defattr(-,root,root) %{_libdir}/libXvnc.so.1* @@ -387,4 +473,8 @@ %{_libdir}/libXvnc.so %{_includedir}/X11/extensions/Xvnc.h +%files x11vnc +%defattr(-,root,root) +%{_bindir}/x11vnc + %changelog ++++++ u_Unset-pixel-buffer-when-x0vncserver-client-disconnect.patch ++++++
From b1d7c2caf496e7236fe43c69fd380fedb830a979 Mon Sep 17 00:00:00 2001 From: Michal Srb
Date: Tue, 26 Sep 2017 13:45:36 +0200 Subject: [PATCH] Unset pixel buffer when x0vncserver client disconnects.
In XDesktop::start() we allocate pixel buffer and set it as the backend to the given VNCServer. In XDesktop::stop() we deallocate the buffer, so we must unset it from the VNCServer as well. Otherwise the VNCServer could try to access it and crash, for example in deferred update. --- common/rfb/VNCServerST.cxx | 14 ++++---------- unix/x0vncserver/x0vncserver.cxx | 6 +++++- 2 files changed, 9 insertions(+), 11 deletions(-) Index: tigervnc-1.8.0/common/rfb/VNCServerST.cxx =================================================================== --- tigervnc-1.8.0.orig/common/rfb/VNCServerST.cxx +++ tigervnc-1.8.0/common/rfb/VNCServerST.cxx @@ -312,6 +312,8 @@ void VNCServerST::setPixelBuffer(PixelBu screenLayout = layout; if (!pb) { + stopFrameClock(); + if (desktopStarted) throw Exception("setPixelBuffer: null PixelBuffer when desktopStarted?"); return; @@ -335,18 +337,10 @@ void VNCServerST::setPixelBuffer(PixelBu void VNCServerST::setPixelBuffer(PixelBuffer* pb_) { - ScreenSet layout; - - if (!pb_) { - if (desktopStarted) - throw Exception("setPixelBuffer: null PixelBuffer when desktopStarted?"); - return; - } - - layout = screenLayout; + ScreenSet layout = screenLayout; // Check that the screen layout is still valid - if (!layout.validate(pb_->width(), pb_->height())) { + if (pb_ && !layout.validate(pb_->width(), pb_->height())) { Rect fbRect; ScreenSet::iterator iter, iter_next; Index: tigervnc-1.8.0/unix/x0vncserver/x0vncserver.cxx =================================================================== --- tigervnc-1.8.0.orig/unix/x0vncserver/x0vncserver.cxx +++ tigervnc-1.8.0/unix/x0vncserver/x0vncserver.cxx @@ -176,7 +176,8 @@ public: #endif } virtual ~XDesktop() { - stop(); + if (running) + stop(); } inline void poll() { @@ -223,6 +224,9 @@ public: XDamageDestroy(dpy, damage); #endif + server->setPixelBuffer(0); + server = 0; + delete pb; pb = 0; } ++++++ x11vnc ++++++ #!/usr/bin/env python # This is wrapper for x0vncserver that translate most common x11vnc arguments # to x0vncserver's arguments import argparse import socket import os import sys def is_port_free(port): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(('', port)) sock.close() return True except socket.error as e: return False def find_free_port(starting_port): for port in range(starting_port, 6000): if is_port_free(port): return port return None parser = argparse.ArgumentParser(add_help=False) parser.add_argument('-help', '-h', action='help') parser.add_argument('--version', '-V', action='store_true') parser.add_argument('-storepasswd', nargs=2) parser.add_argument('-display') parser.add_argument('-auth') parser.add_argument('-N', action='store_true') parser.add_argument('-rfbport', type=int) parser.add_argument('-autoport', type=int, default=5900) parser.add_argument('-6', dest='yes6', action='store_true') parser.add_argument('-no6', action='store_true') #parser.add_argument('-once', action='store_true') # TODO: Add support to x0vncserver parser.add_argument('-forever', '-many', action='store_true') parser.add_argument('-viewonly', action='store_true') #parser.add_argument('-shared', action='store_true') # TODO? parser.add_argument('-alwaysshared', action='store_true') parser.add_argument('-nevershared', action='store_true') parser.add_argument('-dontdisconnect', action='store_true') #parser.add_argument('-timeout', nargs=1, type=int) # TODO? parser.add_argument('-clip') parser.add_argument('-deferupdate', type=int) parser.add_argument('-noshm', action='store_true') #parser.add_argument('-allow', nargs=1) # TODO? #parser.add_argument('-localhost') # TODO? parser.add_argument('-rfbauth') parser.add_argument('-nopw', action='store_true') parser.add_argument('-unixpw') # Accepted, but ignored arguments ignored_arguments = ['-v', '-verbose', '-q', '-quiet'] parser.add_argument(*ignored_arguments, dest='ignored_argument', action='store_true') print('Warning: x11vnc is deprecated in favor of x0vncserver.') print(' This is a wrapper that maps the most common set of x11vnc') print(' arguments to x0vncserver arguments.') print() print(' Use x0vncserver directly if you want encrypted connection.') print() args = parser.parse_args() # Warnings if args.ignored_argument: print('Warning: x11vnc wrapper accepts but ignores following arguments:') print(', '.join(ignored_arguments)) # vncpasswd if args.storepasswd: (password, passwdfile) = args.storepasswd os.execlp('vncpasswd.arg', 'vncpasswd.arg', passwdfile, password) # x0vncserver new_args = ['x0vncserver'] default_security_type = 'None' security_type = default_security_type if args.version: new_args.append('-version') if args.display: new_args.append('-display') new_args.append(args.display) if args.auth: os.environ['XAUTHORITY'] = args.auth if args.N: display = args.display or os.environ['DISPLAY'] if not display: print('No display set') sys.exit(1) port = int(display.split(':')[-1]) + 5900 if is_port_free(port): new_args.append('-rfbport') new_args.append(str(port)) else: print('Port %d is already used'%port) sys.exit(1) if args.rfbport: new_args.append('-rfbport') new_args.append(str(args.rfbport)) else: port = find_free_port(args.autoport) new_args.append('-rfbport') new_args.append(str(port)) if args.yes6: new_args.append('-UseIPv6') if args.no6: new_args.append('-UseIPv6=0') if args.forever: # This is default in x0vncserver pass if args.viewonly: new_args.append('-AcceptKeyEvents=0') new_args.append('-AcceptPointerEvents=0') new_args.append('-AcceptCutText=0') new_args.append('-AcceptSetDesktopSize=0') if args.alwaysshared: new_args.append('-AlwaysShared') if args.nevershared: new_args.append('-NeverShared') if args.dontdisconnect: new_args.append('-DisconnectClients=0') else: new_args.append('-DisconnectClients') if args.clip: new_args.append('-Geometry') new_args.append(args.clip) if args.deferupdate: new_args.append('-DeferUpdate') new_args.append(str(args.deferupdate)) if args.noshm: new_args.append('-UseSHM=0') if args.rfbauth: security_type = 'VncAuth' new_args.append('-PasswordFile') new_args.append(args.rfbauth) if args.unixpw: security_type = 'Plain' new_args.append('-PlainUsers') new_args.append(args.unixpw) new_args.append('-SecurityTypes') new_args.append(security_type) if not args.nopw: # Note: This is the same warning as the original x11vnc gives if security_type == default_security_type: print(""" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# #@ @# #@ ** WARNING ** WARNING ** WARNING ** WARNING ** @# #@ @# #@ YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!! @# #@ @# #@ This means anyone with network access to this computer @# #@ may be able to view and control your desktop. @# #@ @# #@ >>> If you did not mean to do this Press CTRL-C now!! <<< @# #@ @# #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@# """) os.execvp('x0vncserver', new_args) ++++++ xvnc-novnc.service ++++++ [Unit] Description=noVNC Web Server Requires=xvnc.socket After=xvnc.socket [Service] ExecStart=/usr/lib/vnc/with-vnc-key.sh /usr/bin/websockify --key /etc/vnc/tls.key --cert /etc/vnc/tls.cert --web /usr/share/novnc --inetd localhost:5901 User=vnc StandardInput=socket StandardError=syslog ++++++ xvnc-novnc.socket ++++++ [Unit] Description=noVNC Web Server [Socket] ListenStream=5801 Accept=False [Install] WantedBy=sockets.target ++++++ xvnc.socket ++++++ [Unit] Description=Xvnc Server [Socket] ListenStream=5901 Accept=yes [Install] WantedBy=sockets.target ++++++ xvnc@.service ++++++ [Unit] Description=Xvnc Server [Service] ExecStart=/usr/lib/vnc/with-vnc-key.sh /usr/bin/Xvnc -noreset -inetd -once -query localhost -geometry 1024x768 -securitytypes X509None,None -X509Key /etc/vnc/tls.key -X509Cert /etc/vnc/tls.cert -log *:syslog:30 -extension MIT-SHM User=vnc StandardInput=socket StandardOutput=socket StandardError=syslog
participants (1)
-
root@hilbert.suse.de