Bug 276194 - net/x11vnc: fails with -auth argument
Summary: net/x11vnc: fails with -auth argument
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Dirk Meyer
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2024-01-08 05:28 UTC by gdinolt
Modified: 2024-01-08 09:57 UTC (History)
2 users (show)

See Also:
dinoex: maintainer-feedback+


Attachments
Patch file to fix -auth parsing in src/ssltools.h (654 bytes, text/plain)
2024-01-08 05:28 UTC, gdinolt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description gdinolt 2024-01-08 05:28:49 UTC
Created attachment 247524 [details]
Patch file to fix -auth parsing in src/ssltools.h

x11vnc fails with -auth argument as follows in x11vnc.log:

06/01/2024 23:12:29 passing arg to libvncserver: -rfbauth
06/01/2024 23:12:29 passing arg to libvncserver: /usr/home/dinolt/.vnc/passwd
06/01/2024 23:12:29 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 1525
[: -a: unexpected operator
[: -a: unexpected operator
06/01/2024 23:12:30 -auth guess: failed for display=':0'

This fails with both FreeBSD13.2 p8 (and previous) and FreeBSD14 Stable on AMD64.  I have not tried on other hardware or versions of the OS. 

The failure seems to be in the file src/ssltools.h in the parsing of the -auth arg where there is an extra space in the regular expression passed to the sed at line 1060.  I have attached a patch file to be included in the files directory that seems to fix the problem.
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2024-01-08 06:25:32 UTC
Can you show full command line?

For me with KDE5 this command line work fine:
/usr/local/bin/x11vnc -env FD_XDM=1 -auth /var/run/sddm/* -dontdisconnect -display :0 -noxfixes -noxdamage -forever -rfbport 5900 -shared -rfbauth /usr/local/x11vnc/passwd -oa /var/log/x11vnc.log
Comment 2 gdinolt 2024-01-08 07:13:12 UTC
I am running xfce4 

The following command line fails for me:

/usr/local/bin/x11vnc -env FD_XDM=1 -auth guess -reopen -rfbauth /usr/home/dinolt/.vnc/passwd -o /var/log/x11vnc.log -forever -bg

which I use in Xsetup_0 from xdm.
Comment 3 gdinolt 2024-01-08 07:32:51 UTC
After looking at it some more, it may be that the 

-auth guess 

is causing the problem. I think that in my case, since I am using "-auth guess" I am looking at the .Xauthority file for "authentication", not a file in /var/run/sddm/* .  That directory doesn't exist in my environment.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2024-01-08 09:13:22 UTC
Check this: https://github.com/LibVNC/x11vnc/issues/239

IMHO, it's better to report such bugs in the upstream too.
Comment 5 Dirk Meyer freebsd_committer freebsd_triage 2024-01-08 09:54:15 UTC
I will look into this.
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-01-08 09:57:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3f8e2df713baa079cddbfc5f73dc782fe0aa1859

commit 3f8e2df713baa079cddbfc5f73dc782fe0aa1859
Author:     Dirk Meyer <dinoex@FreeBSD.org>
AuthorDate: 2024-01-08 09:56:38 +0000
Commit:     Dirk Meyer <dinoex@FreeBSD.org>
CommitDate: 2024-01-08 09:56:38 +0000

    net/x11vnc: bugfix for -auth argument

    PR: 276194

 net/x11vnc/Makefile                     |  2 +-
 net/x11vnc/files/patch-ssltools.h (new) | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)