[Bug 246189] graphics/wayland: fix wl_client_get_credentials

5 views
Skip to first unread message

bugzilla...@freebsd.org

unread,
May 4, 2020, 3:53:19 PM5/4/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

Bug ID: 246189
Summary: graphics/wayland: fix wl_client_get_credentials
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: Individual Port(s)
Assignee: x...@FreeBSD.org
Reporter: gr...@unrelenting.technology
Assignee: x...@FreeBSD.org
Flags: maintainer-feedback?(x...@FreeBSD.org)

Created attachment 214123
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=214123&action=edit
libwayland-creds.patch

1) who wrote getsockopt(fd, SOL_SOCKET, LOCAL_PEERCRED)? that's wrong! with
SOL_SOCKET, the value of LOCAL_PEERCRED (1) is interpreted as SO_DEBUG (1).
2) we do have the pid in xucred since r348419, let's use it.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freeb...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-x11
To unsubscribe, send any mail to "freebsd-x11...@freebsd.org"

bugzilla...@freebsd.org

unread,
May 4, 2020, 6:15:36 PM5/4/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

Niclas Zeising <zei...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |zei...@FreeBSD.org

--- Comment #1 from Niclas Zeising <zei...@FreeBSD.org> ---
cr_pid is no longer a macro, it was changed (in head) in base r348847. It does
not exist at all in FreeBSD 11 or 12.

bugzilla...@freebsd.org

unread,
May 4, 2020, 6:34:43 PM5/4/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

Greg V <gr...@unrelenting.technology> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #214123|0 |1
is obsolete| |

--- Comment #2 from Greg V <gr...@unrelenting.technology> ---
Created attachment 214128
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=214128&action=edit
libwayland-creds.patch v2

oh. __FreeBSD_version it is, then.

bugzilla...@freebsd.org

unread,
May 5, 2020, 1:27:33 AM5/5/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #3 from Jan Beich <jbe...@FreeBSD.org> ---
Comment on attachment 214128
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=214128
libwayland-creds.patch v2

> +#if __FreeBSD_version >= 1300030

Can be simplified to defined(__FreeBSD__) && __FreeBSD__ >= 13 to drop
<sys/param.h>.

Checking __FreeBSD_version is only useful on /stable branches. On -CURRENT only
the tip is supported. Some folks try to smooth the ride for week/months old
snapshots but... base r348419 is almost 1 year old. Curiously, that commit was
also tagged for MFC which didn't happen.

bugzilla...@freebsd.org

unread,
May 5, 2020, 2:34:20 AM5/5/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #4 from Jan Beich <jbe...@FreeBSD.org> ---
FWIW, the patch fixes pid reporting for Wayland clients in x11-wm/sway e.g.,

$ mpv /path/to/file.mp4
$ MOZ_ENABLE_WAYLAND=1 firefox example.com

# Before
$ swaymsg -t get_tree | jq 'recurse(.nodes[]) | select(.shell == "xdg_shell")
| .pid'
0
0

# After
$ swaymsg -t get_tree | jq 'recurse(.nodes[]) | select(.shell == "xdg_shell")
| .pid'
15582
58058

bugzilla...@freebsd.org

unread,
May 5, 2020, 8:20:38 AM5/5/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #5 from Greg V <gr...@unrelenting.technology> ---
(In reply to Jan Beich from comment #3)

> Can be simplified to defined(__FreeBSD__) && __FreeBSD__ >= 13

tbh, maybe the whole HAVE_SYS_UCRED_H thing should just be __FreeBSD__.

There's no guarantee that other systems don't have a sys/ucred.h that contains
completely different stuff. We've had that with Linux capabilities vs
Capsicum..

bugzilla...@freebsd.org

unread,
May 5, 2020, 9:24:22 AM5/5/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #6 from Niclas Zeising <zei...@FreeBSD.org> ---
Isn't it better to have a proper configure (or meson) check for ucred and for
cr_pid?

I've also asked why the base changes weren't merged to 12, they look like
they're useful (in this context).

bugzilla...@freebsd.org

unread,
Jun 17, 2020, 9:25:16 PM6/17/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #8 from Jan Beich <jbe...@FreeBSD.org> ---
(In reply to Niclas Zeising from comment #6)
> I've also asked why the base changes weren't merged to 12

So what was the response? Looking at bug 215202 no one else asked.

bugzilla...@freebsd.org

unread,
Sep 10, 2020, 7:11:25 AM9/10/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #9 from Jan Beich <jbe...@FreeBSD.org> ---
Ping. See also sysutils/seatd/files/patch-pid and
https://github.com/rust-lang/rust/pull/75148

bugzilla...@freebsd.org

unread,
Dec 23, 2020, 1:48:01 PM12/23/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #10 from Jan Beich <jbe...@FreeBSD.org> ---
Ping. I've filed bug 246189 due to current maintainer being too passive.

bugzilla...@freebsd.org

unread,
Dec 23, 2020, 7:38:13 PM12/23/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #11 from Greg V <gr...@unrelenting.technology> ---
(In reply to Jan Beich from comment #10)
I guess you meant to paste another number? bug 246189 is *this* bug :)

bugzilla...@freebsd.org

unread,
Dec 30, 2020, 9:55:07 AM12/30/20
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

Emmanuel Vadot <ma...@freebsd.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |ma...@freebsd.org
Flags|maintainer-feedback?(x11@Fr |maintainer-feedback+
|eeBSD.org) |
Status|New |Open

--- Comment #12 from Emmanuel Vadot <ma...@freebsd.org> ---
Looks ok to me but untested.

bugzilla...@freebsd.org

unread,
Jan 29, 2021, 6:03:30 AM1/29/21
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

--- Comment #13 from commi...@FreeBSD.org ---
A commit references this bug:

Author: jbeich
Date: Fri Jan 29 11:02:59 UTC 2021
New revision: 563194
URL: https://svnweb.freebsd.org/changeset/ports/563194

Log:
graphics/wayland: update to 1.19.0

- Fix wl_client_get_credentials [1]

Changes:
https://gitlab.freedesktop.org/wayland/wayland/compare/1.18.0...1.19.0
PR: 246189 [1]
Submitted by: Greg V [1]
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D28399

Changes:
head/graphics/wayland/Makefile
head/graphics/wayland/distinfo
head/graphics/wayland/files/patch-src_meson.build
head/graphics/wayland/files/patch-src_wayland-server.c

bugzilla...@freebsd.org

unread,
Jan 29, 2021, 6:04:45 AM1/29/21
to x...@freebsd.org
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246189

Jan Beich <jbe...@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|Open |Closed
Reply all
Reply to author
Forward
0 new messages