Re: fix for X crash with the radeon(4) driver

2021-11-16 Thread Matthieu Herrb
On Sun, Nov 14, 2021 at 05:25:32PM +0100, Matthieu Herrb wrote:
> Hi,
> 
> after the upgrade to X server 21.1.1, some people reported crashes in
> the radeon driver when using xrandr(1) or a similar utility.
> 
> If you are seeing these crashes, please test the patch below (copied
> for a similar "fix" in the amdgpu(4) driver)
> 
> get the xenocara sources if you don't alreaady, apply the patch in the
> driver/xf86-video-ati directory and there run (as root)
> 
> make -f Makefile.bsd-wrapper obj
> make -f Makefile.bsd-wrapper build
> 
> Then restart xenodm and try the xrandr invocation again.
> 
> Please report success or failure.

Ping. .

Anyone tried this patch ?

This is not the bug that happens semi-randomly on mouse button events,
but still, if you have a Radeon card and are using xrandr(1) to setup
multiple monitors, you're likely to hit that bug

> 
> Index: src/radeon_kms.c
> ===
> RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-ati/src/radeon_kms.c,v
> retrieving revision 1.21
> diff -u -p -u -r1.21 radeon_kms.c
> --- src/radeon_kms.c  11 Nov 2021 09:30:14 -  1.21
> +++ src/radeon_kms.c  14 Nov 2021 16:16:08 -
> @@ -931,6 +931,13 @@ radeon_dirty_update(ScrnInfoPtr scrn)
>   }
>  }
>  
> +static void
> +radeonSourceValidate(DrawablePtr draw, int x, int y, int w, int h,
> +  unsigned int subWindowMode)
> +{
> +}
> +
> +
>  
>  Bool
>  radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
> @@ -993,7 +1000,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf8
>   SetPicturePictFilter(src, xf86_crtc->filter, xf86_crtc->params,
>xf86_crtc->nparams);
>  
> - pScreen->SourceValidate = NULL;
> + pScreen->SourceValidate = radeonSourceValidate;
>   CompositePicture(PictOpSrc,
>src, NULL, dst,
>extents.x1, extents.y1, 0, 0, extents.x1,
> 
> 
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



Re: possible fix for Xorg 21.1.1 crashes

2021-11-16 Thread Matthieu Herrb
On Tue, Nov 16, 2021 at 11:26:40PM +0100, Matthieu Herrb wrote:
> Hi,
> 
> I think I found the bug that causes crashes in X for some people.
> 
> If X started crashing since you upgraded to the last snapshots, can
> you try the patch below ?
> 
> get /usr/xenocara from CVS then
> 
> cd /usr/xenocara/xserver
> patch -p0 -E < /this/patch
> doas make -f Makefile.bsd-wrapper obj
> doas make -f Makefile.bsd-wrapper build
> 
> And restart the X server, for example : 
> doas rcctl restart xenodm
> 

Here's a more complete fix. Ust this one instead, sorry.

Index: Xi/exevents.c
===
RCS file: /cvs/OpenBSD/xenocara/xserver/Xi/exevents.c,v
retrieving revision 1.24
diff -u -p -u -r1.24 exevents.c
--- Xi/exevents.c   11 Nov 2021 09:03:02 -  1.24
+++ Xi/exevents.c   16 Nov 2021 23:15:44 -
@@ -1901,7 +1901,7 @@ ProcessDeviceEvent(InternalEvent *ev, De
  * nested) to clients. */
 if (event->source_type == EVENT_SOURCE_FOCUS)
 return;
-if (!grab && CheckDeviceGrabs(device, event, 0))
+if (!grab && CheckDeviceGrabs(device, ev, 0))
 return;
 break;
 case ET_KeyRelease:
@@ -1914,7 +1914,7 @@ ProcessDeviceEvent(InternalEvent *ev, De
 if (b->map[key] == 0)   /* there's no button 0 */
 return;
 event->detail.button = b->map[key];
-if (!grab && CheckDeviceGrabs(device, event, 0)) {
+if (!grab && CheckDeviceGrabs(device, ev, 0)) {
 /* if a passive grab was activated, the event has been sent
  * already */
 return;
Index: dix/events.c
===
RCS file: /cvs/OpenBSD/xenocara/xserver/dix/events.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 events.c
--- dix/events.c11 Nov 2021 09:03:03 -  1.22
+++ dix/events.c16 Nov 2021 23:15:44 -
@@ -1191,7 +1191,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIn
 }
 }
 
-eventlen = event->length;
+eventlen = sizeof(InternalEvent);
 
 qe = malloc(sizeof(QdEventRec) + eventlen);
 if (!qe)
@@ -1319,7 +1319,7 @@ ComputeFreezes(void)
 
 syncEvents.replayDev = (DeviceIntPtr) NULL;
 
-if (!CheckDeviceGrabs(replayDev, >device_event,
+if (!CheckDeviceGrabs(replayDev, event,
   syncEvents.replayWin)) {
 if (IsTouchEvent(event)) {
 TouchPointInfoPtr ti =
@@ -3027,7 +3027,7 @@ BOOL
 ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
 {
 BOOL rc = FALSE;
-DeviceEvent event;
+InternalEvent event;
 
 if (dev->deviceGrab.grab) {
 if (!dev->deviceGrab.fromPassiveGrab ||
@@ -3042,16 +3042,16 @@ ActivateFocusInGrab(DeviceIntPtr dev, Wi
 if (win == NoneWin || win == PointerRootWin)
 return FALSE;
 
-event = (DeviceEvent) {
-.header = ET_Internal,
-.type = ET_FocusIn,
-.length = sizeof(DeviceEvent),
-.time = GetTimeInMillis(),
-.deviceid = dev->id,
-.sourceid = dev->id,
-.detail.button = 0
+event = (InternalEvent) {
+.device_event.header = ET_Internal,
+.device_event.type = ET_FocusIn,
+.device_event.length = sizeof(DeviceEvent),
+.device_event.time = GetTimeInMillis(),
+.device_event.deviceid = dev->id,
+.device_event.sourceid = dev->id,
+.device_event.detail.button = 0
 };
-rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) , FALSE,
+rc = (CheckPassiveGrabsOnWindow(win, dev, , FALSE,
 TRUE) != NULL);
 if (rc)
 DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveGrab);
@@ -3068,7 +3068,7 @@ static BOOL
 ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
 {
 BOOL rc = FALSE;
-DeviceEvent event;
+InternalEvent event;
 
 if (dev->deviceGrab.grab) {
 if (!dev->deviceGrab.fromPassiveGrab ||
@@ -3080,16 +3080,16 @@ ActivateEnterGrab(DeviceIntPtr dev, Wind
 (*dev->deviceGrab.DeactivateGrab) (dev);
 }
 
-event = (DeviceEvent) {
-.header = ET_Internal,
-.type = ET_Enter,
-.length = sizeof(DeviceEvent),
-.time = GetTimeInMillis(),
-.deviceid = dev->id,
-.sourceid = dev->id,
-.detail.button = 0
+event = (InternalEvent) {
+.device_event.header = ET_Internal,
+.device_event.type = ET_Enter,
+.device_event.length = sizeof(DeviceEvent),
+.device_event.time = GetTimeInMillis(),
+.device_event.deviceid = dev->id,
+.device_event.sourceid = dev->id,
+.device_event.detail.button = 0
 };
-rc = (CheckPassiveGrabsOnWindow(win, dev, (

possible fix for Xorg 21.1.1 crashes

2021-11-16 Thread Matthieu Herrb
heckPassiveGrabsOnWindow(pWin, device, (InternalEvent *) event,
+if (CheckPassiveGrabsOnWindow(pWin, device, ievent,
   sendCore, TRUE)) {
 ret = TRUE;
 goto out;
Index: include/dix.h
===
RCS file: /cvs/OpenBSD/xenocara/xserver/include/dix.h,v
retrieving revision 1.17
diff -u -p -u -r1.17 dix.h
--- include/dix.h   11 Nov 2021 09:03:13 -  1.17
+++ include/dix.h   16 Nov 2021 22:03:19 -
@@ -458,7 +458,7 @@ WindowHasNewCursor(WindowPtr /* pWin */ 
 
 extern Bool
 CheckDeviceGrabs(DeviceIntPtr /* device */ ,
- DeviceEvent * /* event */ ,
+     InternalEvent * /* event */ ,
  WindowPtr /* ancestor */ );
 
 extern void

-- 
Matthieu Herrb



fix for X crash with the radeon(4) driver

2021-11-14 Thread Matthieu Herrb
Hi,

after the upgrade to X server 21.1.1, some people reported crashes in
the radeon driver when using xrandr(1) or a similar utility.

If you are seeing these crashes, please test the patch below (copied
for a similar "fix" in the amdgpu(4) driver)

get the xenocara sources if you don't alreaady, apply the patch in the
driver/xf86-video-ati directory and there run (as root)

make -f Makefile.bsd-wrapper obj
make -f Makefile.bsd-wrapper build

Then restart xenodm and try the xrandr invocation again.

Please report success or failure.

Index: src/radeon_kms.c
===
RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-ati/src/radeon_kms.c,v
retrieving revision 1.21
diff -u -p -u -r1.21 radeon_kms.c
--- src/radeon_kms.c11 Nov 2021 09:30:14 -  1.21
+++ src/radeon_kms.c14 Nov 2021 16:16:08 -
@@ -931,6 +931,13 @@ radeon_dirty_update(ScrnInfoPtr scrn)
}
 }
 
+static void
+radeonSourceValidate(DrawablePtr draw, int x, int y, int w, int h,
+unsigned int subWindowMode)
+{
+}
+
+
 
 Bool
 radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
@@ -993,7 +1000,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf8
SetPicturePictFilter(src, xf86_crtc->filter, xf86_crtc->params,
 xf86_crtc->nparams);
 
-   pScreen->SourceValidate = NULL;
+   pScreen->SourceValidate = radeonSourceValidate;
CompositePicture(PictOpSrc,
 src, NULL, dst,
 extents.x1, extents.y1, 0, 0, extents.x1,


-- 
Matthieu Herrb



X server updated to version 21.1.1

2021-11-12 Thread Matthieu Herrb
Hi,

I've updated the X server in Xenocara to version 21.1.1, together with
Freetype (2.11.0) and fontconfig 2.13.94.

One of the visible change of this update is that some LCD panels now
report their real physical dimensions to the X server, rather than
just computing it based on a default resolution of 96dpi.

This means that the actual DPI computed from these dimensions will
change and impact the size of the displayed fonts. 

If your fonts have chanded sizes too much after the last snapshot
update, you can add

xrandr --dpi 96

in your ~/.xsession (or ~/.xinitrc) file to set the resolution
manually to the previous default.

You can also fiddle with the X resources (~/.Xresources ) to fix
font sizes in invidual applications. Older X applications are more
likely to mis-behave and need the global dpi fix.
-- 
Matthieu Herrb



Re: xdpyinfo: can't load library 'libdmx.so.2.0'

2021-09-15 Thread Matthieu Herrb
On Wed, Sep 15, 2021 at 08:15:20AM +0200, Sebastien Marie wrote:
> On Wed, Sep 15, 2021 at 05:11:12AM +, Renato Aguiar wrote:
> > I noticed this after sysupgrading to latest snapshot:
> > 
> > $ ldd /usr/X11R6/bin/xdpyinfo
> > /usr/X11R6/bin/xdpyinfo:
> > ld.so: xdpyinfo: can't load library 'libdmx.so.2.0'
> > /usr/X11R6/bin/xdpyinfo: signal 9
> > 
> > It works fine after manually building and installing xdpyinfo from
> > latest xenocara code.
> > 
> 
> libdmx.so has been removed recently. From
> xenocara/app/xdpyinfo/configure, dmx library could be detected as
> build time.
> 
> I suppose the host used to build the snapshots still has old dmx
> library in path, and the build of xdpyinfo detected it and link to it,
> whereas the library isn't in sets anymore.
>


I've just committed a fix to xdpyinfo build system to explicitely
disable dmx support in that case.


-- 
Matthieu Herrb



remove libdmx from Xenocara?

2021-09-03 Thread Matthieu Herrb
Hi,

is anyone here using libdmx from Xenocara? Afaict, with the help of
sqlports no port/package is using it, and it's also not used by
anything built in xenocara.

libdmx is the client part of the Xdmx system (distributed multi-screen
X server, that make it possible to create a huge screen out of several
X servers running on different machine). The server part has been
disabled for years and is known to be broken even under Linux.

-- 
Matthieu Herrb



Re: update xf86-video-amdgpu to latest git

2021-07-08 Thread Matthieu Herrb
On Thu, Jul 08, 2021 at 05:29:01PM +1000, Jonathan Gray wrote:
> The latest xf86-video-amdgpu release was in 2019.
> 
> xf86-video-amdgpu-19.1.0..origin/master

Hi,

Works so far here on my X395 (Vega Mobile 8) with -current.
-- 
Matthieu Herrb



log reason when a packet causes pf to add an IP to a table ?

2021-06-28 Thread Matthieu Herrb
Hi

I have rules like this one on the firewalls I manage:

pass in on $in_if proto tcp from any to  port ssh \
flags S/SA keep state \
(source-track rule, max-src-states 30, max-src-conn 20, \
max-src-conn-rate 15/30, overload  flush
global)

block log from 

However some legitimate remote users get their addresses added to the
ssh-bruteforce table from time to time.

I'd like to be able to figure out the reason (ie which condtion
triggers the overload). Is there a way to have it logged somewhere
that I'm missing ?

Thanks in avance,
-- 
Matthieu Herrb



Re: update xterm to version 367

2021-04-01 Thread Matthieu Herrb
On Sat, Mar 27, 2021 at 10:22:15AM +0100, Matthieu Herrb wrote:
> Patch #367 - 2021/03/26
> 
> ok ? comments ?

Hi,

I could use some actual test results. I'd like to commit the update.

-- 
Matthieu Herrb



Re: xf86-input-ws: fix hotplugging usb mice on legacy-free machines

2021-03-27 Thread Matthieu Herrb
On Fri, Mar 26, 2021 at 03:41:41PM -0500, joshua stein wrote:
> The X server's autoconfiguration probes each /dev/wsmouseN device 
> and if its WSMOUSEIO_GTYPE ioctl returns something like 
> WSMOUSE_TYPE_TOUCHPAD, xf86-input-ws attaches to that device 
> directly which causes the wsmouse device to detach from the mux.  
> This allows xinput to handle these special devices separately each 
> with their own configuration.
> 
> The last part of the X server configuration loop is this:
> 
> /* Add a default entry catching all other mux elements as "ws" */
> wscons_add_pointer(WSCONS_MOUSE_PREFIX, "ws", ATTR_POINTER);
> 
> For any simple mice like a basic USB one, they will remain in the 
> mux and the wsmux ioctl handler will route WSMOUSEIO_GTYPE to the 
> first wsmouse device in the mux.  xf86-input-ws will attach to 
> /dev/wsmouse and all USB mouse traffic will flow through that single 
> device properly, even if the mouse is unplugged and plugged back in 
> later.
> 
> However, if X is started when there are no other mice attached to 
> the mux (because nothing is attached or because it already took the 
> non-simple devices out of the mux), WSMOUSEIO_GTYPE will fail and 
> xf86-input-ws will bail due to the bad ioctl response:
> 
> [  2459.571] (II) config/wscons: checking input device /dev/wsmouse
> [  2459.571] (II) Using input driver 'ws' for '/dev/wsmouse'
> [  2459.571] (**) /dev/wsmouse: always reports core events
> [  2459.571] (II) ws: /dev/wsmouse: debuglevel 0
> [  2459.571] (**) Option "Device" "/dev/wsmouse"
> [  2459.571] (**) ws: /dev/wsmouse: ZAxisMapping: buttons 4 and 5
> [  2459.571] (**) ws: /dev/wsmouse: WAxisMapping: buttons 6 and 7
> [  2459.571] (**) ws: /dev/wsmouse: associated screen: 0
> [  2459.571] (EE) PreInit returned 2 for "/dev/wsmouse"
> [  2459.571] (II) UnloadModule: "ws"
> 
> Later, if a USB mouse is attached while X is running, it sends its 
> data through the wsmouse mux but the X server isn't listening to it.
> 
> To remedy this, make xf86-input-ws ignore a bad WSMOUSEIO_GTYPE 
> ioctl response if it's talking to the mux device, and just assume it 
> will be USB mouse traffic.  This hasn't affected "legacy" laptops 
> because they often have a pms(4) port which remains the default 
> device in the wsmouse mux even if there isn't an actual mouse 
> attached to that port.
> 
> (This doesn't solve the issue of a device like a umt(4) attached 
> after starting X not being treated as its own device because X 
> would need to open that device directly.  That can't easily be 
> solved right now.)

Hi,

yes this makes sense and can help in some situations. I don't see any
practical drawbacks.

ok matthieu@
-- 
Matthieu Herrb



update xterm to version 367

2021-03-27 Thread Matthieu Herrb
Patch #367 - 2021/03/26

 * add  OSC 22 to allow programs to select different pointer cursor at
   runtime.
 * change  configuration for no-return functions to use _Noreturn when
   it  is  available, because clang --analyze does not properly handle
   the gcc noreturn attribute.
 * add  cursorTheme resource to provide a way to enable or disable the
   cursor theme feature.
 * modified  CopyWait  event retries to use shorter sleeps, to improve
   responsiveness (tmux #2556).
 * improve quoting/escaping in demo-scripts per shellcheck.
 * add  resizeByPixel  resource,  to  permit  disabling window manager
   resizing-hints (patch by Tim Oehl).
 * corrected  printOptsImmediate  handling of alternate-screen (report
   by Abhijit Dasgupta).
 * update sample terminfo to more closely match ncurses.
 * add/improve limit-checks for Xlib calls (report by Roman Fiedler).
 * fix a typo in the help-message (report by Tomas Korbar).


ok ? comments ?

Index: MANIFEST
===
RCS file: /cvs/xenocara/app/xterm/MANIFEST,v
retrieving revision 1.47
diff -u -p -u -r1.47 MANIFEST
--- MANIFEST14 Feb 2021 09:14:06 -  1.47
+++ MANIFEST27 Mar 2021 09:21:21 -
@@ -1,4 +1,4 @@
-MANIFEST for xterm-366, version xterm-366
+MANIFEST for xterm-367, version xterm-367
 

 MANIFESTthis file
 256colres.h resource-definitions for 256-color mode
Index: NEWS
===
RCS file: /cvs/xenocara/app/xterm/NEWS,v
retrieving revision 1.7
diff -u -p -u -r1.7 NEWS
--- NEWS14 Feb 2021 09:14:06 -  1.7
+++ NEWS27 Mar 2021 09:21:21 -
@@ -1,20 +1,23 @@
 The NEWS file was generated from xterm.log.html, which serves as the changelog
 for xterm.
 

-Patch #366 - 2021/02/10
+Patch #367 - 2021/03/26
 
- * correct   a  compiler-warning  fix  in  patch  #352  which  allowed
-   sign-extension of coordinate values (report by "CismonX").
- * correct  upper-limit for selection buffer, accounting for combining
-   characters (report/testcase by Tavis Ormandy).
- * with alwaysHighlight true, xterm does not properly track focus. The
-   screen->select   FOCUS  flag  remains  always  on,  which  prevents
-   bellIsUrgent  from  working, as the urgent WM_HINT flag is only set
-   in  setXUrgency()  when  the  window  is  not  focused. Fix this by
-   updating screen->select in unselectwindow() regardless of the value
-   of always_highlight (patch by Jiri Bohac).
- * improve  fix  for  interaction between SRM and ENQ (report by Grant
-   Taylor).
- * build-fix   for  --with-Xaw3dxft,  needed  when  --with-toolbar  is
-   omitted (report by Jimmy Olgeni, Emanuel Haupt).
+ * add  OSC 22 to allow programs to select different pointer cursor at
+   runtime.
+ * change  configuration for no-return functions to use _Noreturn when
+   it  is  available, because clang --analyze does not properly handle
+   the gcc noreturn attribute.
+ * add  cursorTheme resource to provide a way to enable or disable the
+   cursor theme feature.
+ * modified  CopyWait  event retries to use shorter sleeps, to improve
+   responsiveness (tmux #2556).
+ * improve quoting/escaping in demo-scripts per shellcheck.
+ * add  resizeByPixel  resource,  to  permit  disabling window manager
+   resizing-hints (patch by Tim Oehl).
+ * corrected  printOptsImmediate  handling of alternate-screen (report
+   by Abhijit Dasgupta).
+ * update sample terminfo to more closely match ncurses.
+ * add/improve limit-checks for Xlib calls (report by Roman Fiedler).
+ * fix a typo in the help-message (report by Tomas Korbar).
 
Index: THANKS
===
RCS file: /cvs/xenocara/app/xterm/THANKS,v
retrieving revision 1.15
diff -u -p -u -r1.15 THANKS
--- THANKS  14 Feb 2021 09:14:06 -  1.15
+++ THANKS  27 Mar 2021 09:21:21 -
@@ -1,4 +1,4 @@
--- $XTermId: THANKS,v 1.30 2021/02/09 01:32:10 tom Exp $
+-- $XTermId: THANKS,v 1.31 2021/03/01 22:00:49 tom Exp $
 -- vile:txtmode fk=utf-8
 There's no AUTHORS file in this distribution; it would be redundant since
 I (Thomas E. Dickey) have done more than 80% of the work on xterm since 1996.
@@ -225,6 +225,7 @@ Thierry Reding
 Thomas Wolff
 Thorsten Glaser
 Tim Adye
+Tim Oehl
 Tim Pope
 Tobias Stoeckmann
 Todd Eigenschink
Index: Tekproc.c
===
RCS file: /cvs/xenocara/app/xterm/Tekproc.c,v
retrieving revision 1.29

Re: allow xlock -dpms* values < 30 and > 0

2021-03-13 Thread Matthieu Herrb
On Thu, Mar 11, 2021 at 03:36:03PM +0100, Alex Raschi wrote:
> Ping
> 
> There was an extra space after 'noff', below is the updated patch.
> 
> On Tue, Feb 23, 2021 at 11:11:21AM +0100, Alex Raschi wrote:
> > Hi,
> > 
> > I noticed that xlock does not allow values between 30 and 0 for options
> > -dpms{standby,suspend,off}, the man page suggests that all values >= 0
> > are accepted. I use the blank mode and i would like to set a lower
> > timeout so i made a patch to remove the limit.
> > 
> > ok?

Hi,

sorry I didn't pay attention your mail initially. I've commited the
patch below. Thanks.

> 
> Index: app/xlockmore/xlock/xlock.c
> ===
> RCS file: /cvs/xenocara/app/xlockmore/xlock/xlock.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 xlock.c
> --- app/xlockmore/xlock/xlock.c   26 Nov 2006 17:13:23 -  1.2
> +++ app/xlockmore/xlock/xlock.c   20 Feb 2021 15:37:47 -
> @@ -624,7 +624,6 @@ extern int  XHPEnableReset(Display * dsp
>  
>  #endif
>  #ifdef USE_DPMS
> -#define MIN_DPMS 30  /* 30 second minimum */
>  #if 1
>  #include 
>  #include 
> @@ -1114,9 +1113,9 @@ SetDPMS(Display * display, int nstandby,
>   DPMSSetTimeouts(display, standby, suspend, off);
>   else
>   DPMSSetTimeouts(display,
> - (nstandby <= 0 ? 0 : (nstandby > 
> MIN_DPMS ? nstandby : MIN_DPMS)),
> - (nsuspend <= 0 ? 0 : (nsuspend > 
> MIN_DPMS ? nsuspend : MIN_DPMS)),
> - (noff <= 0 ? 0 : (noff > MIN_DPMS ? 
> noff : MIN_DPMS)));
> + (nstandby <= 0 ? 0 : nstandby),
> + (nsuspend <= 0 ? 0 : nsuspend),
> + (noff <= 0 ? 0 : noff));
>   }
>  }

-- 
Matthieu Herrb



xenodm : don't add authorizations for tcp connections by default

2021-03-08 Thread Matthieu Herrb
s ();
doWrite = 0;
for (i = 0; i < d->authNum; i++)
-   writeLocalAuth (new, auths[i], d->name);
+   writeLocalAuth (new, auths[i], d->name, d->listenTcp);
doWrite = 1;
if (old) {
if (fstat (fileno (old), ) != -1)
Index: xenodm/resource.c
===
RCS file: /cvs/xenocara/app/xenodm/xenodm/resource.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 resource.c
--- xenodm/resource.c   8 Mar 2021 17:54:28 -   1.6
+++ xenodm/resource.c   8 Mar 2021 20:05:11 -
@@ -169,6 +169,8 @@ struct displayResource serverResources[]
"" },
 { "autoLogin", "AutoLogin",DM_STRING,  boffset(autoLogin),
"" },
+{ "listenTcp", "ListenTcp",   DM_BOOL,boffset(listenTcp),
+  "false" }, 
 };
 
 #define NUM_SERVER_RESOURCES   (sizeof serverResources/\
Index: xenodm/server.c
===
RCS file: /cvs/xenocara/app/xenodm/xenodm/server.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 server.c
--- xenodm/server.c 11 Jul 2018 14:35:46 -  1.4
+++ xenodm/server.c 8 Mar 2021 20:05:11 -
@@ -86,6 +86,8 @@ StartServerOnce (struct display *d)
snprintf (arg, sizeof(arg), "-auth %s", d->authFile);
argv = parseArgs (argv, arg);
    }
+   if (d->listenTcp)
+   argv = parseArgs(argv, "-listen tcp");
if (!argv) {
LogError ("StartServer: no arguments\n");
sleep ((unsigned) d->openDelay);

-- 
Matthieu Herrb



Re: Ignore /tmp/.Xauth* in daily

2021-03-06 Thread Matthieu Herrb
On Sat, Mar 06, 2021 at 09:52:58PM +0300, Vadim Zhukov wrote:
> сб, 6 мар. 2021 г. в 21:30, Theo de Raadt :
> >
> > Matthieu Herrb  wrote:
> >
> > > Linux, systemd and XDG have inventend this /run/user/$uid tmpfs that
> > > is created automagically and they use that in place of /tmp for
> > > volatile things that don't beloing to $HOME, but this is not a can of
> > > worms I want to open now.
> >
> > Awesome, another directory to drop stuff and run a filesystem out of space
> > with unclear consequences...
> >
> > This does not fit with our direction either.
> 
> So this code appeared in X11R4. There was no VCS repo, I suppose, so no 
> history.
> 
> There are basically four cases why xdm may fail to create ~/.Xauthority:
> 
> a) home directory doesn't exist
> b) home directory is non-writeable due to permissions
> c) /home is full
> d) /home is on NFS and there are locking/network issues.
> 
> I'm not sure if (a) is a valid case. (b) is a variant of my case, as I
> said, I can live without this feature. In the case of (c) users
> (non-admins) won't be able to do something anyway. Can't speak for NFS
> (I've quit the job where /home on NFS has been set up a few years ago)
> so no opinion on (d).
> 

I think 4 his not an issue anymore.the locking mecanism used by xauth
is working with all current NFS implementations (including
OpenBSD's).

Here is a patch to remve the backup authorization file. Unfortunatly
there is no simple way to display an explicit error message. One will
need to check the xenodm.log file.

Xsession can be patched too to remove the fallback to /tmp/xes- log
file if ~/.xsession-errors cannot be writen. This will be a separate
diff.

Index: include/dm.h
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/include/dm.h,v
retrieving revision 1.15
diff -u -p -u -r1.15 dm.h
--- include/dm.h10 Jan 2021 09:18:30 -  1.15
+++ include/dm.h6 Mar 2021 17:53:44 -
@@ -122,7 +122,6 @@ struct display {
char**authNames;/* authorization protocol names */
unsigned short  *authNameLens;  /* authorization protocol name lens */
char*clientAuthFile;/* client specified auth file */
-   char*userAuthDir;   /* backup directory for tickets */
int authComplain;   /* complain when no auth for XDMCP */
 
/* information potentially derived from resources */
Index: man/xenodm.man
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/man/xenodm.man,v
retrieving revision 1.11
diff -u -p -u -r1.11 xenodm.man
--- man/xenodm.man  15 Aug 2019 16:23:33 -  1.11
+++ man/xenodm.man  6 Mar 2021 17:53:44 -
@@ -582,18 +582,6 @@ to occur, during which time the new auth
 The default is
 .Cm false ,
 which will work for all MIT servers.
-.It Ic DisplayManager. Ns Ar DISPLAY Ns Ic .userAuthDir
-When
-.Nm
-is unable to write to the usual user authorization file
-.Pq Pa $HOME/.Xauthority ,
-it creates a unique file name in this directory and points the environment
-variable
-.Ev XAUTHORITY
-at the created file.
-It uses
-.Pa /tmp
-by default.
 .El
 .Sh CONFIGURATION FILE
 First, the
Index: xenodm/auth.c
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/xenodm/auth.c,v
retrieving revision 1.15
diff -u -p -u -r1.15 auth.c
--- xenodm/auth.c   1 Jan 2021 18:09:07 -   1.15
+++ xenodm/auth.c   6 Mar 2021 17:53:44 -
@@ -752,7 +752,7 @@ void
 SetUserAuthorization (struct display *d, struct verify_info *verify)
 {
 FILE   *old = NULL, *new;
-char   home_name[1024], backup_name[1024], new_name[1024];
+char   home_name[1024], new_name[1024];
 char   *name = NULL;
 char   *home;
 char   *envname = NULL;
@@ -762,7 +762,6 @@ SetUserAuthorization (struct display *d,
 struct statstatb;
 inti;
 intmagicCookie;
-intfd;
 
 Debug ("SetUserAuthorization\n");
 auths = d->authorizations;
@@ -793,45 +792,10 @@ SetUserAuthorization (struct display *d,
}
}
if (lockStatus != LOCK_SUCCESS) {
-   snprintf (backup_name, sizeof(backup_name),
- "%s/.XauthXX", d->userAuthDir);
-   fd = mkstemp (backup_name);
-   if (fd >= 0) {
-   old = fdopen (fd, "r");
-   if (old == NULL)
-   (void) close(fd);
-   }
-
-   if (old != NULL)
-   {
-   lockStatus = XauLockAuth (backup_name, 1, 2, 10);
-   Debug ("backup lock is %d\n", lockStatus);
-   if (lockStatus == L

Re: Ignore /tmp/.Xauth* in daily

2021-03-06 Thread Matthieu Herrb
On Sat, Mar 06, 2021 at 08:50:57PM +0300, Vadim Zhukov wrote:
> 
> Well, I do... nothing? I can show my .xsession, there's nothing
> special. I run cwm, FWIW, and do not start anything heavy from the
> beginning, to have a working desktop ASAP. KDE and GNOME won't work
> this way for sure. :-)

ok, I was wrong. My testing account did have a .xsession from a
previous test that caued the failure. With the real default Xsession
it still starts.

But I tend to agree with Theo that these backup strategies to write to
/tmp when one cannot write to $HOME are wrong.

Linux, systemd and XDG have inventend this /run/user/$uid tmpfs that
is created automagically and they use that in place of /tmp for
volatile things that don't beloing to $HOME, but this is not a can of
worms I want to open now.

-- 
Matthieu Herrb



Re: Ignore /tmp/.Xauth* in daily

2021-03-06 Thread Matthieu Herrb
On Sat, Mar 06, 2021 at 09:56:34AM -0700, Theo de Raadt wrote:
> Matthieu Herrb  wrote:
> 
> > On Fri, Mar 05, 2021 at 09:10:32PM +0300, Vadim Zhukov wrote:
> > > чт, 4 мар. 2021 г. в 02:02, Vadim Zhukov :
> > > >
> > > > Hello all.
> > > >
> > > > Since xenodm has DEF_USER_AUTH_DIR set to "/tmp", we need to ignore
> > > > /tmp/.Xauth* in daily cleanup, don't we?
> > > >
> > > > Found the hard way a few minutes ago on my X240.
> > > 
> > > Thanks sthen@, I've realized this happens only when xenodm could not
> > > create ~/.Xauthority. In my case this happens because my laptop starts
> > > with /home mounted read-only, but there may be others. Mattieu, the
> > > xenodm logic itself is correct, right? If yes, anyone brave enough to
> > > okay the diff below then? :-)
> > 
> > Hi,
> > 
> > Yes I think the xenodm logic (inherithed from xdm) is correct.
> > 
> > Althoug in my experience, when an X session cnnot write to $HOME it
> > generally doesn't get very far (iirc not beeing able to write to
> > .xsession-errors used to be fatal)...

I tried to log in with a read-only /home and it failed as I remembered
it. Vadim are your doing something special in you X session to make
that work   ?

> > 
> > Anyways ok to skip that directory if it exists in daily.
> 
> It is not a directory -- it is a file.
> 
> I don't understand how this file is created.  Well-known names in /tmp
> are raceable -- therefore we and others increasingly use directories 
> containing
> files as a safer pattern.  Where is the code that creates this file?  Is it
> safe?  I am suspicious.

It's created by mkstemp(3) in
/usr/xenocara/app/xenodm/xenodm/auth.c:798

> 
> I strongly disagree with the pattern ".Xauth*".  It should be EXACT.  If
> someone else creates a file called .Xauthsadflkjdsaf, it should not be
> deleted.
> 
> As a final point, is this strategy of considering /tmp a safe place acceptable
> at all?  If $HOME doesn't work, why not just have X fail to work correctly
> and consider this "fail over to /tmp" a junk idea from the past?

The backup dir can be configured to something else, but it needs to be
writeable by the user whois login in. It could be a subdir of /tmp (if
the rc.d script takes care of creating it) or I can remove that
feature from xenodm and fail the login if /home is not writeable.

-- 
Matthieu Herrb



Re: Ignore /tmp/.Xauth* in daily

2021-03-06 Thread Matthieu Herrb
On Fri, Mar 05, 2021 at 09:10:32PM +0300, Vadim Zhukov wrote:
> чт, 4 мар. 2021 г. в 02:02, Vadim Zhukov :
> >
> > Hello all.
> >
> > Since xenodm has DEF_USER_AUTH_DIR set to "/tmp", we need to ignore
> > /tmp/.Xauth* in daily cleanup, don't we?
> >
> > Found the hard way a few minutes ago on my X240.
> 
> Thanks sthen@, I've realized this happens only when xenodm could not
> create ~/.Xauthority. In my case this happens because my laptop starts
> with /home mounted read-only, but there may be others. Mattieu, the
> xenodm logic itself is correct, right? If yes, anyone brave enough to
> okay the diff below then? :-)

Hi,

Yes I think the xenodm logic (inherithed from xdm) is correct.

Althoug in my experience, when an X session cnnot write to $HOME it
generally doesn't get very far (iirc not beeing able to write to
.xsession-errors used to be fatal)...

Anyways ok to skip that directory if it exists in daily.

> 
> > Index: daily
> > ===
> > RCS file: /cvs/src/etc/daily,v
> > retrieving revision 1.95
> > diff -u -p -r1.95 daily
> > --- daily   20 Oct 2020 22:42:29 -  1.95
> > +++ daily   3 Mar 2021 22:58:28 -
> > @@ -49,7 +49,7 @@ if [ -d /tmp -a ! -L /tmp ]; then
> > cd /tmp && {
> > find -x . \
> > \( -path './ssh-*' -o -path ./.X11-unix -o -path ./.ICE-unix \
> > -   -o -path './tmux-*' \) \
> > +   -o -path './tmux-*' -o -path './.Xauth*' \) \
> > -prune -o -type f -atime +7 -delete 2>/dev/null
> > find -x . -type d -mtime +1 ! -path ./vi.recover ! -path 
> > ./.X11-unix \
> > ! -path ./.ICE-unix ! -name . \
> 
> -- 
>   WBR,
>   Vadim Zhukov

-- 
Matthieu Herrb



Re: use /dev/dri/ in xenocara

2021-02-18 Thread Matthieu Herrb
On Thu, Feb 18, 2021 at 09:18:51PM +1100, Jonathan Gray wrote:

Ok matthieu@.

> Index: lib/libdrm/xf86drm.h
> ===
> RCS file: /cvs/xenocara/lib/libdrm/xf86drm.h,v
> retrieving revision 1.21
> diff -u -p -r1.21 xf86drm.h
> --- lib/libdrm/xf86drm.h  11 Feb 2021 10:27:08 -  1.21
> +++ lib/libdrm/xf86drm.h  18 Feb 2021 10:02:03 -
> @@ -76,18 +76,11 @@ extern "C" {
>   (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
>  #define DRM_DEV_MODE  (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
>  
> -#ifdef __OpenBSD__
> -#define DRM_DIR_NAME  "/dev"
> -#define DRM_PRIMARY_MINOR_NAME  "drm"
> -#define DRM_CONTROL_MINOR_NAME  "drmC"
> -#define DRM_RENDER_MINOR_NAME   "drmR"
> -#else
>  #define DRM_DIR_NAME  "/dev/dri"
>  #define DRM_PRIMARY_MINOR_NAME  "card"
>  #define DRM_CONTROL_MINOR_NAME  "controlD"
>  #define DRM_RENDER_MINOR_NAME   "renderD"
>  #define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */
> -#endif
>  
>  #define DRM_DEV_NAME  "%s/" DRM_PRIMARY_MINOR_NAME "%d"
>  #define DRM_CONTROL_DEV_NAME  "%s/" DRM_CONTROL_MINOR_NAME "%d"
> Index: xserver/hw/xfree86/drivers/modesetting/driver.c
> ===
> RCS file: /cvs/xenocara/xserver/hw/xfree86/drivers/modesetting/driver.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 driver.c
> --- xserver/hw/xfree86/drivers/modesetting/driver.c   12 Dec 2020 09:30:54 
> -  1.9
> +++ xserver/hw/xfree86/drivers/modesetting/driver.c   18 Feb 2021 10:02:03 
> -
> @@ -226,7 +226,7 @@ open_hw(const char *dev)
>  else {
>      dev = getenv("KMSDEVICE");
>  if ((NULL == dev) || ((fd = priv_open_device(dev)) == -1)) {
> -dev = "/dev/drm0";
> +dev = "/dev/dri/card0";
>  fd = priv_open_device(dev);
>  }
>  }

-- 
Matthieu Herrb



some fvwmrc defautlts changes

2021-01-24 Thread Matthieu Herrb
ce   TN TN off "telnet"
+*SshChoice   RL RL on "ssh"
+*SshSelectionUserSel   single
+#*SshChoice   Default   Default   on   "same user"
+#*SshChoice   CustomCustomoff  "user:"
+*SshText "(Userid:"
+*SshInputUserName  10   ""
+*SshText ")"
+*SshLine center
+*SshText "FG:"
+*SshInputFgColor 15 ""
+*SshText "BG:"
+*SshInputBgColor 15 ""
+*SshLine expand
+*SshButton   quit "Login" ^M
+*SshCommand Exec xterm  $(FgColor?-fg $(FgColor)) $(BgColor?-bg $(BgColor)) -T 
xterm@$(HostName) -e $(RL?ssh) $(TN?telnet) $(HostName) $(UserName?-l 
$(UserName))
+*SshButton   restart   "Clear"
+*SshCommand Beep
+*SshButton   quit "Cancel"
+*SshCommand Nop
 
 # FvwmForm alias - query exit ala mwm
 *QuitVerifyGrabServer

-- 
Matthieu Herrb



Re: behaviour of openssl s_server and certificate chains on 6.8

2021-01-14 Thread Matthieu Herrb
On Thu, Jan 14, 2021 at 02:20:38PM +0100, Theo Buehler wrote:
> On Thu, Jan 14, 2021 at 01:32:41PM +0100, Matthieu Herrb wrote:
> > Hi,
> > 
> > I'm trying to debug strange beahaviour changes with certificates on a
> > systemc after upgrading it from 6.7 to 6.8...
> > 
> > On 6.7, If I run :
> > 
> > openssl s_server -cert mycert.pem -key mykey.pem -CAfile CA.pem
> > 
> > then openssl s_client -showcerts -connect localhost:4433
> > 
> > returns the full certificate chain mycert->CA
> > 
> > With the same commands on 6.8, I don't get the CA certificate.
> > 
> > Is this a known issue, and how can I get the chain with 6.8 ?
> > 
> > (my real application is sendmail...)
> 
> In short: Yes, this is known. You can't get the chain in 6.8.
> 
> This is the reason why ajacoutot switched sendmail to link against
> eopenssl11 as a workaround in -stable. As your thread on ports shows,
> this workaround doesn't work if you add something that links against
> LibreSSL to the mix.
> 
> There are several layers of unexpected things/bugs involved. The two
> main points are:
> 
> 1. The TLSv1.3 server in 6.8 does not do auto chain since we hoped to
>be able to avoid it. This was addressed post release when people
>using OpenLDAP ran into it.
>https://cvsweb.openbsd.org/src/lib/libssl/tls13_server.c#rev1.62
> 
> 2. The new verifier doesn't behave as it should when auto chain is
>enabled. As a workaround -current switches to the legacy verifier in
>this situation for about a week now. The proper fix in the new
>verifier is under discussion.
>https://cvsweb.openbsd.org/src/lib/libssl/tls13_server.c#rev1.65
> 
> I don't know whether/when there will be backports of some fixes to 6.8.
> As sthen said in the thread on ports, right now the simplest fix is to
> run -current.

Ok, thanks. Not the easiest for me, but I wont try to build a
frankenstein system.

In the mean time it looks like switching to insecure ldap connections
for sendmail works (the ldap server is on localhost so the risk is
not very high)

-- 
Matthieu Herrb



behaviour of openssl s_server and certificate chains on 6.8

2021-01-14 Thread Matthieu Herrb
Hi,

I'm trying to debug strange beahaviour changes with certificates on a
systemc after upgrading it from 6.7 to 6.8...

On 6.7, If I run :

openssl s_server -cert mycert.pem -key mykey.pem -CAfile CA.pem

then openssl s_client -showcerts -connect localhost:4433

returns the full certificate chain mycert->CA

With the same commands on 6.8, I don't get the CA certificate.

Is this a known issue, and how can I get the chain with 6.8 ?

(my real application is sendmail...)

-- 
Matthieu Herrb



Re: Edit /etc/boot.conf

2020-12-06 Thread Matthieu Herrb
On Sun, Dec 06, 2020 at 04:21:10PM +0100, Mark Kettenis wrote:
> Both armv7 and powerpc64 support VTs, so let xenodem take the VT
> reserved for X in /etc/ttys.
> 
> ok?

Sure. It will soon be time to invert the test and list machines that
don't support VTs

> 
> 
> Index: app/xenodm/Makefile.bsd-wrapper
> ===
> RCS file: /cvs/xenocara/app/xenodm/Makefile.bsd-wrapper,v
> retrieving revision 1.5
> diff -u -p -r1.5 Makefile.bsd-wrapper
> --- app/xenodm/Makefile.bsd-wrapper   1 Apr 2020 19:58:02 -   1.5
> +++ app/xenodm/Makefile.bsd-wrapper   6 Dec 2020 14:59:40 -
> @@ -4,8 +4,8 @@
>  XENODMCONFIGDIR=/etc/X11/xenodm
>  PIXMAPDIR=$(XENODMCONFIGDIR)/pixmaps
>  
> -.if ${MACHINE} == amd64 || ${MACHINE} == arm64 || ${MACHINE} == i386 \
> -|| ${MACHINE} == macppc
> +.if ${MACHINE} == amd64 || ${MACHINE} == arm64 || ${MACHINE} == armv7 \
> +|| ${MACHINE} == i386 || ${MACHINE} == macppc || ${MACHINE} == powerpc64
>  DEFAULT_VT= --with-default-vt=vt05
>  .endif
>  

-- 
Matthieu Herrb



Re: add OpenType bitmap fonts to xenocara

2020-10-25 Thread Matthieu Herrb
On Sun, Oct 25, 2020 at 12:02:05PM +0100, Christopher Zimmermann wrote:
> Hi,
> 
> this makes the xenocara bitmap fonts available for pango apps like gvim,
> too.
> Is it ok to call fonttosfnt directly in the Makefile or is there a reason to
> use a macro like done for $(BDFTOPCF) ? OK?

Hi,

I have some concerns too

- I would prefer if either it would be done upstreams first. Even if
  the font pachages don't change very often, these change will make
  future merges less easy.

  As an alternative, this could be added as before- or afterinstall:
  target to the respective Makefile.bsd-wrappers. without touching the
  upstream files. (fonts/Makefile.inc can be used to factorize part of
  the rules).

- there are a few fonts which produce an error/ warning when
  generating the otb files:

  Couldn't determine full name for micro.otb
  Couldn't get family name for micro.otb
  Couldn't determine full name for decsess.otb
  Couldn't get family name for decsess.otb
  Couldn't determine full name for deccurs.otb
  Couldn't get family name for deccurs.otb

  May be they can be left alone ?

- running make checkdist after make release also show
  > ./usr/X11R6/lib/X11/fonts/misc/cursor.bdf
  it looks like a typo in cursor-misc/Makefile.{am,in} (BDF_FILES
  intead of OTB_FILES)


-- 
Matthieu Herrb



Re: fonttosfnt: merge changes to fix fonts for new pango

2020-10-18 Thread Matthieu Herrb
On Fri, Oct 09, 2020 at 09:39:37AM +0200, Christopher Zimmermann wrote:
> 
> Hi Matthieu,
> 
> you already gave an ok some time ago to merge changes to fonttosfnt. Now
> that my changes have been tested and merged upstream I'd like to integrate
> them into xenocara. May I ask for another ok?

Sorry I should have reacted faster. I've asked Peter Hutterer to make
a formal release of xfonttosfnt 1.1.1 with your commits upstreams. In
the long run it makes things easier to follow if we can just upgrade
to the upstream version.

May I ask you for a few more days of waiting ? If nothing happens on
the xorg side in the next 3 days, then ok to commit the changes
locally.


-- 
Matthieu Herrb



Re: Support astfb(4) in wsfb(4)

2020-10-03 Thread Matthieu Herrb
On Sat, Oct 03, 2020 at 04:50:28PM +0200, Mark Kettenis wrote:
> The astfb(4) is a little-endian framebuffer on a (for now) big-endian
> architecture.  Therefore we need to tell X that the pixels have their
> color components laid out in a non-standard way.
> 
> Note that support for this pixel layout in X is weak.  Normal stuff
> works but the software rendering in Mesa doesn't seem to work
> properly.  So while this is good enough to get a bunch of xterms on
> the screen, glxgears will have the wrong colors.
> 
> ok?

yes, ok.

> 
> P.S. I don't think basing on the wsdisplay type is the right thing to
>  do, but it is what we have done in the past.  Maybe we should
>  extend wsdisplay_fbinfo with some fields that communicate the
>  pixel format and use that?
> 
> 
> Index: driver/xf86-video-wsfb/src/wsfb_driver.c
> ===
> RCS file: /cvs/xenocara/driver/xf86-video-wsfb/src/wsfb_driver.c,v
> retrieving revision 1.38
> diff -u -p -r1.38 wsfb_driver.c
> --- driver/xf86-video-wsfb/src/wsfb_driver.c  27 Jul 2019 07:48:19 -  
> 1.38
> +++ driver/xf86-video-wsfb/src/wsfb_driver.c  3 Oct 2020 14:39:18 -
> @@ -632,6 +632,17 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
>   masks.blue = 0x1f;
>   }
>   break;
> + case WSDISPLAY_TYPE_ASTFB:
> + if (pScrn->depth > 16) {
> + masks.red = 0xff00;
> + masks.green = 0x00ff;
> + masks.blue = 0xff00;
> + } else {
> + masks.red = 0x1f;
> + masks.green = 0x3f << 5;
> + masks.blue = 0x1f << 11;
> + }
> +     break;
>   default:
>   masks.red = 0;
>   masks.green = 0;

-- 
Matthieu Herrb



hostname.if '!' commands and rdomains

2020-07-29 Thread Matthieu Herrb
Hi,

When I'm configuring an interface with a spécific rdomain, I'd assume
that '!' commands (especially /sbin/route commands) are executed in
the rdomain for this interface.

I know that parsing this file is complex and somehow fragile but still
I tried to write a patch.

What do you think ?

Of course I'm ok with any enhancements / fixes to my shell foo.

--- netstart.orig   Wed Jul 29 11:19:53 2020
+++ netstartWed Jul 29 11:52:39 2020
@@ -67,8 +67,16 @@
_cmds[${#_cmds[*]}]="ifconfig $_if ${_c[@]} up;dhclient $_if"
V4_DHCPCONF=true
;;
+   rdomain) ((${#_c[*]} == 2)) || return
+   _cmds[${#_cmds[*]}]="ifconfig $_if rdomain ${_c[_name]}"
+   _rdomain=${_c[_name]}
+   ;;
'!'*)   _cmd=$(print -- "${_c[@]}" | sed 's/\$if/'$_if'/g')
-   _cmds[${#_cmds[*]}]="${_cmd#!}"
+   if [[ $_rdomain -ne 0 ]]; then
+  _cmds[${#_cmds[*]}]="/sbin/route -T$_rdomain exec 
${_cmd#!}"
+   else
+  _cmds[${#_cmds[*]}]="${_cmd#!}"
+   fi
;;
*)  _cmds[${#_cmds[*]}]="ifconfig $_if ${_c[@]}"
;;

-- 
Matthieu Herrb



Re: Add ability to set control values with video(1)

2020-07-25 Thread Matthieu Herrb
On Sat, Jul 25, 2020 at 09:17:24AM -0600, Theo de Raadt wrote:
> Marcus Glocker  wrote:
> 
> > Instead of introducing the CLI parameter controls in video(1), we could
> > introduce videoctl(1) in base, same as we have with audioctl(1).  This
> > also gives us the possibility to only display the current video
> > parameters.
> 
> I must have missed something.  Why does it need to be a seperate comment.
> Won't this produce confusion?  Why can video do this?
> 
> Is it really correct for the video hardware to have persistant settings?
> Would it not be better if the required mode was always commanded when
> a video is being recorded?

I've not followed UVC hardware too closely; it seems that some of the
cameras are always fully automatically adjusting their parameters,
while others allow for manual setting that remains between device
open().

And some of the controls are not available when video(4) is used from
a browser (for conferencing).

On a 2nd thought having that integrated with video(1) allows to
control the values with visual feedback so it makes sense to keep only
one program. But ihmo it would be more user friendly if the command
line syntax was more regular with audio or wscons control programs.

-- 
Matthieu Herrb



Re: typo in www/faq/current.html - libxkbui...

2020-07-11 Thread Matthieu Herrb
On Sat, Jul 11, 2020 at 03:19:46PM +0100, Larry Hynes wrote:
> Hi
> 
>   # rm /usr/X11R6/include/extenstions/XKBui.h
> 
> does not look right to me.
> 
> 1. The spelling of extensions is incorrect
> 2. I think /usr/X11R6/include/X11/extensions/XKBui.h
>is the correct path

Fixed. Thanks for the report.
> 
> Index: faq/current.html
> ===
> RCS file: /cvs/www/faq/current.html,v
> retrieving revision 1.1047
> diff -u -p -r1.1047 current.html
> --- faq/current.html  10 Jul 2020 06:04:41 -  1.1047
> +++ faq/current.html  11 Jul 2020 14:17:46 -
> @@ -106,7 +106,7 @@ It should be manually removed.
>  
>  # rm /usr/X11R6/lib/libxkbui.*
>  # rm /usr/X11R6/lib/pkgconfig/xkbui.pc
> -# rm /usr/X11R6/include/extenstions/XKBui.h
> +# rm /usr/X11R6/include/X11/extensions/XKBui.h
>  
>  

-- 
Matthieu Herrb



Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Matthieu Herrb
On Fri, Jun 19, 2020 at 06:46:00PM +1000, Matt Dunwoodie wrote:
> Hi all,
> 
> After the previous submission of WireGuard, we've again been through a
> number of improvements. Thank you everyone for your feedback.

Hi,

I was wondering if there is a way to specify a routing domain/table
for wgendpoint in ifconfig(8).

In a VPN client setup (roadwarrior style) I'd like to keep wg0 in
rdomain 0 and put the actual physical interface in rdomain 1. So that
all daemons (smtpd, unwind, ...) use the VPN by default and only the
strict minimum to setup the VPN runs in rdomain 1.

Everything works if I set wg0 in rdomain1 and keep my re0 interface in
rdomain 0, but as soon as I set rdomain 1 for re0 and rdomain 0 for
wg0, the VPN cannot come up (and I see the UDP packets to port 51820
trying to go out through wg0).

Thanks for your work on wireguard !

-- 
Matthieu Herrb



Re: WireGuard patchset for OpenBSD, rev. 3

2020-06-21 Thread Matthieu Herrb
On Fri, Jun 19, 2020 at 06:46:00PM +1000, Matt Dunwoodie wrote:
> Hi all,
> 
> After the previous submission of WireGuard, we've again been through a
> number of improvements. Thank you everyone for your feedback.

Hi,

While giving wireguard a try, I found that this patch is needed to fix
ifconfig(8) documentation :

diff --git sbin/ifconfig/ifconfig.8 sbin/ifconfig/ifconfig.8
index 29edeb60793..93429b4c103 100644
--- sbin/ifconfig/ifconfig.8
+++ sbin/ifconfig/ifconfig.8
@@ -2056,7 +2056,7 @@ Packets on a VLAN interface without a tag set will use a 
value of
 .Op Cm wgpsk Ar presharedkey
 .Op Fl wgpsk
 .Op Cm wgpka Ar persistent-keepalive
-.Op Cm wgpip Ar ip port
+.Op Cm wgendpoint Ar ip port
 .Op Cm wgaip Ar allowed-ip/prefix
 .Oc
 .Op Fl wgpeerall
@@ -2137,7 +2137,7 @@ By default this functionality is disabled, equivalent to 
a value of 0.
 This is often used to ensure a peer will be accessible when protected by
 a firewall, as is when behind a NAT address.
 A value of 25 is commonly used.
-.It Cm wgpip Ar ip port
+.It Cm wgendpoint Ar ip port
 Set the IP address and port to send the encapsulated packets to.
 If the peer changes address, the local interface will update the address
 after receiving a correctly authenticated packet.

-- 
Matthieu Herrb



Re: Xwindows keymap weirdness

2020-06-01 Thread Matthieu Herrb
On Mon, Jun 01, 2020 at 03:28:52PM +0200, Stéphane Aulery wrote:
> Hello,
> 
> Le 01/06/2020 14:55, Matthieu Herrb a écrit :
> > 
> > > 
> > > (I have just tried with a test user with nothing configured besides
> > > LC_CTYPE=en_US.UTF-8, without which xterm/vim doesn't show proper
> > > characters)
> > 
> > I'm using a real US keyboard with AltGr or the Menu Key (depending on
> > the actual keyboard) set as Compose and typing full compose sequences
> > to get diacritics. ieand so on.
> 
> I use a Bépo keyboard but this but
> 
> Your experience interests me. I use a Bépo keyboard but I plan to switch to
> a QWERTY + compose keyboard like you do. I hope this will give better
> compatibility between systems and less software config remapping.
> 
> I do not see how to configure this in console.

I'm only using this under X. the OpenBSD console is plain ASCII and
has no support for for UTF8 characters, so no need to enter them.

To setup the right alt key as compose, you can either:

- run 'setxkbmap -option compose:ralt' somewhere in your session
  startup script

- create /etc/X11/xorg.conf.d/90-keyboard.conf containing

--- Cut ---
Section "InputClass"
Identifier "Kbd"
MatchDriver "kbd"
Option "XkbOptions" "compose:ralt"
EndSection
--- Cut ---

> 
> What are the pitfalls?

I don't know. I've a number of things in mind, but I'm not sure
they're relevant. The existing Compose rules allow me to enter all
important UTF-8 characters I need outside of ASCII: French diacritics,
non-breaking spaces, median point, Euro sign, etc.

Oh yes: one issue: I almost never test non default keyboard layouts in
Xenocara because of this (no /etc/kbdtype file on my OpenBSD machines)
:)

-- 
Matthieu Herrb



Re: Xwindows keymap weirdness

2020-06-01 Thread Matthieu Herrb
On Mon, Jun 01, 2020 at 02:16:16PM +0200, Marc Espie wrote:
> I occasionnally use setxkbmap 'us(intl)' in order to have diacritics
> as dead keys.
> 
> I have LC_CTYPE=en_US.UTF-8
> 
> If I type 'c
> 
> I get a ç  in programs like firefox or chrome, BUT I get
> ć   in xterm ?
> 
> why are things different ?

Because firefox or chrome probably don't use
/usr/X11R6/share/X11/locale/en_US.UTF-8/Compose (the rules used by
Xlib) but their own Compose rules. I don't know if there is some other
"standard" toolkit (gtk+3?) providing alternative rules or if they
just hard-code their own rules somewhere.

> which program is right ?

There may be  an international standard (ISO, XDG, ... ?) that
controls those rules and  what X.Org is shipping in
/usr/X11R6/share/X11/locale/en_US.UTF-8/Compose But I can't find a
reference.

So I would say that xterm is right: the compose sequence for ç is
,c. And as you got it there is a ć character in some alphabets
reachable with 'c or  ' c

You  have a  key in the default us(intl) XKB
layout (it's on the the 4th group for the '5' key) but I don't
remember how to reach that group :)

> 
> (I have just tried with a test user with nothing configured besides
> LC_CTYPE=en_US.UTF-8, without which xterm/vim doesn't show proper characters)

I'm using a real US keyboard with AltGr or the Menu Key (depending on
the actual keyboard) set as Compose and typing full compose sequences
to get diacritics. ieand so on.


-- 
Matthieu Herrb



Re: Removing old video drivers

2020-05-12 Thread Matthieu Herrb
On Mon, May 11, 2020 at 09:40:30AM -0700, Dirk Praet wrote:
> Hi Matthieu,
> 
> It would seem I'm a bit (too) late to this party. In short: I'm running a
> high security environment leveraging the combined power of contemporary
> OpenBSD and ancient i386 hardware stuffed with RAM, but untouched by all
> kinds of modern BIOS/EFI/processor "management" technology. My recent
> upgrade to 6.6 has crippled several machines using the Trident video
> chipset, which I then found out was removed from both the 6.6 binary
> distribution and the Xenocara tree. Which begs the following questions:
> 
> - Is it possible to bring the Trident-module back ?

No. At least not in the OpenBSD supported tree. You can still try to
get the sources out of CVS's Attic and build it for yourself but I'm
not sure if it will compile against X server 1.20.8.

> - If not, is there any (documented) way to still get X to work on the
> affected (laptop) machines using a framebuffer or other module, blacklisting
> in some way the Trident module which Xorg detects as the chipset in use but
> then bails out on because it is no longer there ?

You can try to use the xf86-video-vesa driver, but it's main
limitation is that it only supports graphics modes that are hard-coded
in the machine's video BIOS. And laptops from that ERA often didn't
even bother to provide a video mode that matches the native resolution
of their panel.

> - Is the removal of additional graphics modules in the future not
> effectively rendering the i386 port useless for anything else than pure CLI,
> router or headless systems, and, shouldn't , in that case, an explicit
> warning be added to release notes/installer/sysupgrade ?

Too late unfortunatly. 6.6 was release 6 month ago.

-- 
Matthieu Herrb



Re: [UPDATE] xcb-proto and libxcb 1.14

2020-04-05 Thread Matthieu Herrb
On Sun, Mar 22, 2020 at 08:13:11PM +0100, Matthieu Herrb wrote:
> Hi,
> 
> the patch below updates XCB (xcb-proto and libxcb) to version 1.14.0.
> 
> I've been running this on amd64 for a while. Comments ? ok ?
> 
> Note that it goes together with an update to the x11/py-xcbgen port
> that I'm sending to ports@ at the same time.

Ping

-- 
Matthieu Herrb



UPDATE: xserver 1.20.8

2020-04-02 Thread Matthieu Herrb
Hi,

The patch below updates the X server to version 1.20.8.

Apply the patch in ${XSRCDIR}/xserver with patch -p0 -E and then
rebuild Xenocara according to release(8).

Comments, ok ?

Index: ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/xserver/ChangeLog,v
retrieving revision 1.35
diff -u -p -u -r1.35 ChangeLog
--- ChangeLog   26 Jan 2020 13:48:54 -  1.35
+++ ChangeLog   2 Apr 2020 17:59:06 -
@@ -1,3 +1,414 @@
+commit f84ad082557f9cde6b8faa373eca6a0a89ba7d56
+Author: Matt Turner 
+Date:   Sun Mar 29 13:02:03 2020 -0700
+
+xserver 1.20.8
+
+Signed-off-by: Matt Turner 
+
+commit 8837279869309317c110afb6f2f3c24484c77657
+Author: Jon Turney 
+Date:   Wed Apr 17 11:37:11 2019 +0100
+
+Fix old-style definition warning for xf86OSInputThreadInit()
+
+../hw/xfree86/os-support/stub/stub_init.c: In function 
‘xf86OSInputThreadInit’:
+../hw/xfree86/os-support/stub/stub_init.c:29:1: warning: old-style 
function definition [-Wold-style-definition]
+
+(cherry picked from commit 7c266cafed14b38c039091651069ae9888c3a8ae)
+
+commit 0c012f968b4e02a2bc892ce71f7bea9bd3f7fb22
+Author: Jon Turney 
+Date:   Wed Mar 13 14:57:14 2019 +
+
+Add xf86OSInputThreadInit to stub os-support as well
+
+stub os support also needs to provide xf86OSInputThreadInit, omitted in
+ea1527a8
+
+(cherry picked from commit c020769dbfb965740c8441d8242b738ef572a7c9)
+
+commit b259485975078087fe6bde2b9e1eccf4ae14120c
+Author: Michel Dänzer 
+Date:   Tue Mar 17 11:45:22 2020 +0100
+
+xwayland: Delete all frame_callback_list nodes in xwl_unrealize_window
+
+We were only calling xwl_present_unrealize_window for the toplevel
+window, but the list can contain entries from child windows as well,
+in which case we were leaving dangling pointers to freed memory.
+
+Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/1000
+Fixes: c5067feaeea1 "xwayland: Use single frame callback for Present
+ flips and normal updates"
+Reviewed-by: Olivier Fourdan 
+Tested-by: Olivier Fourdan 
+(cherry picked from commit 5e91587302e85fd6f0e8d5ffbe30182e18c6913f)
+
+commit a033571644d277dc49a489f7ae32c4ad92856543
+Author: Jonas Ådahl 
+Date:   Fri Sep 13 17:11:27 2019 +0200
+
+xwayland/glamor-gbm: Handle DRM_FORMAT_MOD_INVALID gracefully
+
+The compositor may send DRM_FORMAT_MOD_INVALID instead of a list of
+modifiers for various reasons. Handle this gracefully by ignoring it.
+
+Without this, if a compositor would send DRM_FORMAT_MOD_INVALID, it'd
+result in empty windows provided by Xwayland.
+
+Signed-off-by: Jonas Ådahl 
+Reviewed-by: Olivier Fourdan 
+Reviewed-by: Michel Dänzer 
+(cherry picked from commit edf964434eac10ffbe27cc883e3ab95505669aee)
+
+commit 3c48bd50ad33f2a533ac76afa38d6e3906ebc28a
+Author: Arthur Williams 
+Date:   Sun Oct 6 18:55:35 2019 +
+
+dix: Check for NULL spriteInfo in GetPairedDevice
+
+There is a race when reseting the XServer that causes spriteInfo to be
+NULL in GetPairedDevice resulting a segfault and subsequent crash. The
+problem was noticed when opening a connection, creating master devices,
+destroying master devices and closing the connection during testing.
+
+Signed-off-by: Arthur Williams 
+
+
+(cherry picked from commit e693c9657f98c334e9921ca2f8ebf710497c0c6a)
+
+commit 1610ef1d6b5ba99da9d1a639f3b65b2e61514a7d
+Author: David Seifert 
+Date:   Fri Jan 24 12:49:44 2020 +0100
+
+Fix building with `-fno-common`
+
+* GCC 10 will switch the default to `-fno-common`.
+  https://gcc.gnu.org/PR85678
+
+Bug: https://bugs.gentoo.org/705880
+Signed-off-by: Matt Turner 
+
+commit 2a185dd22ddb5b0d7d2ef5948591028766bb9530
+Author: Michel Dänzer 
+Date:   Mon Mar 2 18:09:31 2020 +0100
+
+xwayland: Use frame callbacks for Present vblank events
+
+Instead of only the fallback timer.
+
+Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/854
+
+v2:
+* Drop unused frame_callback member of struct xwl_present_window
+  (Olivier Fourdan)
+
+Reviewed-by: Olivier Fourdan 
+(cherry picked from commit 9b31358c52e951883bf7c01c953a9da080542244)
+
+commit 99a6d6b15e0757a4652a569a1b2070c76a00b567
+Author: Michel Dänzer 
+Date:   Wed Nov 27 18:04:06 2019 +0100
+
+xwayland: Use single frame callback for Present flips and normal updates
+
+Using a list of Present windows that need to be called back.
+
+This prepares for the following change, there should be no change in
+observed behaviour.
+
+v2:
+* Use xwl_window_create_frame_callback instead of making the
+  frame_listener struct non-static (Olivier Fourdan)
+
+Reviewed-by: Olivier Fourdan 
+(cherry picked from commit c5067feaeea115761f0a72f37407c6e5e943d1a1)
+
+commit 

Re: xorg packaging issue

2020-03-24 Thread Matthieu Herrb
On Tue, Mar 24, 2020 at 01:26:36PM +0100, Marc Espie wrote:
> There's some inconsistency:
> lists/xserv/mi:./usr/X11R6/share/aclocal/xorg-macros.m4
> lists/xshare/mi:./usr/X11R6/lib/pkgconfig/xorg-macros.pc
> 
> both should be in xshare

It was moved to xserv by fries@ some years ago for I don't know
what reason.

Fixed now. Thanks.

> 
> This does explain the failures of tightvnc on some bulk machines.
> By default, proot does NOT copy xserv in the chroot, and I believe
> it's correct.

-- 
Matthieu Herrb



[UPDATE] xcb-proto and libxcb 1.14

2020-03-22 Thread Matthieu Herrb
st of the XML
 def register(self):
Index: proto/xcb-proto/xcbgen/xtypes.py
===
RCS file: /cvs/OpenBSD/xenocara/proto/xcb-proto/xcbgen/xtypes.py,v
retrieving revision 1.7
diff -u -p -u -r1.7 xtypes.py
--- proto/xcb-proto/xcbgen/xtypes.py11 Sep 2018 19:31:11 -  1.7
+++ proto/xcb-proto/xcbgen/xtypes.py8 Mar 2020 17:55:27 -
@@ -192,12 +192,12 @@ class SimpleType(PrimitiveType):
 Any type which is typedef'ed to cardinal will be one of these.
 
 Public fields added:
-none
+xml_type is the original string describing the type in the XML
 '''
-def __init__(self, name, size):
+def __init__(self, name, size, xml_type=None):
 PrimitiveType.__init__(self, name, size)
 self.is_simple = True
-
+self.xml_type = xml_type
 
 def resolve(self, module):
 self.resolved = True
@@ -206,24 +206,27 @@ class SimpleType(PrimitiveType):
 
 
 # Cardinal datatype globals.  See module __init__ method.
-tcard8 = SimpleType(('uint8_t',), 1)
-tcard16 = SimpleType(('uint16_t',), 2)
-tcard32 = SimpleType(('uint32_t',), 4)
-tcard64 = SimpleType(('uint64_t',), 8)
-tint8 =  SimpleType(('int8_t',), 1)
-tint16 = SimpleType(('int16_t',), 2)
-tint32 = SimpleType(('int32_t',), 4)
-tint64 = SimpleType(('int64_t',), 8)
-tchar =  SimpleType(('char',), 1)
-tfloat = SimpleType(('float',), 4)
-tdouble = SimpleType(('double',), 8)
+tcard8 = SimpleType(('uint8_t',), 1, 'CARD8')
+tcard16 = SimpleType(('uint16_t',), 2, 'CARD16')
+tcard32 = SimpleType(('uint32_t',), 4, 'CARD32')
+tcard64 = SimpleType(('uint64_t',), 8, 'CARD64')
+tint8 =  SimpleType(('int8_t',), 1, 'INT8')
+tint16 = SimpleType(('int16_t',), 2, 'INT16')
+tint32 = SimpleType(('int32_t',), 4, 'INT32')
+tint64 = SimpleType(('int64_t',), 8, 'INT64')
+tchar =  SimpleType(('char',), 1, 'char')
+tfloat = SimpleType(('float',), 4, 'float')
+tdouble = SimpleType(('double',), 8, 'double')
+tbyte = SimpleType(('uint8_t',), 1, 'BYTE')
+tbool = SimpleType(('uint8_t',), 1, 'BOOL')
+tvoid = SimpleType(('uint8_t',), 1, 'void')
 
 class FileDescriptor(SimpleType):
 '''
 Derived class which represents a file descriptor.
 '''
 def __init__(self):
-SimpleType.__init__(self, ('int'), 4)
+SimpleType.__init__(self, ('int'), 4, 'fd')
 self.is_fd = True
 
 def fixed_size(self):
@@ -240,7 +243,7 @@ class Enum(SimpleType):
 bits contains a list of (name, bitnum) tuples.  items only appear if 
specified as a bit. bitnum is a number.
 '''
 def __init__(self, name, elt):
-SimpleType.__init__(self, name, 4)
+SimpleType.__init__(self, name, 4, 'enum')
 self.values = []
 self.bits = []
 self.doc = None
@@ -333,6 +336,9 @@ class ListType(Type):
 self.member.resolve(module)
 self.expr.resolve(module, self.parents)
 
+# resolve() could have changed the size (ComplexType starts with size 
0)
+self.size = self.member.size if self.member.fixed_size() else None
+
 self.required_start_align = self.member.required_start_align
 
 # Find my length field again.  We need the actual Field object in the 
expr.
@@ -506,7 +512,6 @@ class ComplexType(Type):
 self.nmemb = 1
 self.size = 0
 self.lenfield_parent = [self]
-self.fds = []
 
     # get required_start_alignment
 required_start_align_element = elt.find("required_start_align")
Index: distrib/sets/lists/xbase/mi
===
RCS file: /cvs/OpenBSD/xenocara/distrib/sets/lists/xbase/mi,v
retrieving revision 1.125
diff -u -p -u -r1.125 mi
--- distrib/sets/lists/xbase/mi 4 Jan 2020 18:04:05 -   1.125
+++ distrib/sets/lists/xbase/mi 22 Mar 2020 19:05:03 -
@@ -358,7 +358,7 @@
 ./usr/X11R6/lib/libxcb-res.a
 ./usr/X11R6/lib/libxcb-res.so.1.1
 ./usr/X11R6/lib/libxcb-screensaver.a
-./usr/X11R6/lib/libxcb-screensaver.so.1.1
+./usr/X11R6/lib/libxcb-screensaver.so.2.0
 ./usr/X11R6/lib/libxcb-shape.a
 ./usr/X11R6/lib/libxcb-shape.so.1.1
 ./usr/X11R6/lib/libxcb-shm.a
@@ -388,7 +388,7 @@
 ./usr/X11R6/lib/libxcb-xvmc.a
 ./usr/X11R6/lib/libxcb-xvmc.so.1.0
 ./usr/X11R6/lib/libxcb.a
-./usr/X11R6/lib/libxcb.so.4.0
+./usr/X11R6/lib/libxcb.so.4.1
 ./usr/X11R6/lib/libxkbfile.a
 ./usr/X11R6/lib/libxkbfile.la
 ./usr/X11R6/lib/libxkbfile.so.6.0

-- 
Matthieu Herrb



Re: piixpm(4) on ATI SBx00

2020-01-07 Thread Matthieu Herrb
00
> @@ -60,6 +60,7 @@ struct piixpm_softc {
>   int sc_poll;
>   int sc_is_sb800;
>   int sc_is_fch;
> + int sc_sb800_selen;
>  
>   struct piixpm_smbus sc_busses[4];
>   struct i2c_controller   sc_i2c_tag[4];
> @@ -181,6 +182,12 @@ piixpm_attach(struct device *parent, str
>   val |= (bus_space_read_1(sc->sc_iot, ioh, 1) << 8);
>   smb0en = val & SB800_SMB0EN_EN;
>   base = val & SB800_SMB0EN_BASE_MASK;
> +
> + bus_space_write_1(sc->sc_iot, ioh, 0,
> + SB800_PMREG_SMB0SELEN);
> + val = bus_space_read_1(sc->sc_iot, ioh, 1);
> + if (val & SB800_SMB0SELEN_EN)
> + sc->sc_sb800_selen = 1;
>   }
>  
>   if (smb0en == 0) {
> @@ -296,11 +303,20 @@ piixpm_i2c_acquire_bus(void *cookie, int
>   AMDFCH41_PM_PORT_INDEX);
>   bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 1,
>   smbus->sb_bus << 3);
> - } else if (sc->sc_is_sb800) {
> + } else if (sc->sc_is_sb800 && sc->sc_sb800_selen) {
>   bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 0,
>   SB800_PMREG_SMB0SEL);
>   bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 1,
>   smbus->sb_bus << 1);
> + } else if (sc->sc_is_sb800) {
> + uint8_t val;
> +
> + bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 0,
> + SB800_PMREG_SMB0EN);
> + val = bus_space_read_1(sc->sc_iot, sc->sc_sb800_ioh, 1) &
> + ~SB800_SMB0EN_PORT_MASK;
> + val |= smbus->sb_bus << 1;
> + bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 1, val);
>   }
>  
>   return (0);
> @@ -317,11 +333,20 @@ piixpm_i2c_release_bus(void *cookie, int
>   AMDFCH41_PM_PORT_INDEX);
>   bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 1,
>   0);
> - } else if (sc->sc_is_sb800) {
> + } else if (sc->sc_is_sb800 && sc->sc_sb800_selen) {
>   bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 0,
>   SB800_PMREG_SMB0SEL);
>   bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 1,
>   0);
> + } else if (sc->sc_is_sb800) {
> + uint8_t val;
> +
> + bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 0,
> + SB800_PMREG_SMB0EN);
> + val = bus_space_read_1(sc->sc_iot, sc->sc_sb800_ioh, 1) &
> + ~SB800_SMB0EN_PORT_MASK;
> + val |= 0;
> + bus_space_write_1(sc->sc_iot, sc->sc_sb800_ioh, 1, val);
>   }
>  
>   if (cold || sc->sc_poll || (flags & I2C_F_POLL))
> Index: piixreg.h
> ===
> RCS file: /cvs/src/sys/dev/pci/piixreg.h,v
> retrieving revision 1.5
> diff -u -p -r1.5 piixreg.h
> --- piixreg.h 16 Dec 2019 21:39:40 -  1.5
> +++ piixreg.h 7 Jan 2020 11:12:29 -
> @@ -70,8 +70,11 @@
>  #define SB800_PMREG_SIZE 2   /* index/data pair */
>  #define SB800_PMREG_SMB0EN   0x2c/* 16-bit register */
>  #define SB800_PMREG_SMB0SEL  0x2e/* bus selection */
> +#define SB800_PMREG_SMB0SELEN0x2f/* bus selection enable */
>  #define SB800_SMB0EN_EN  0x0001
>  #define SB800_SMB0EN_BASE_MASK   0xffe0
> +#define SB800_SMB0EN_PORT_MASK   0x06
> +#define SB800_SMB0SELEN_EN   0x01
>  
>  #define SB800_SMB_HOSTC  0x10/* I2C bus configuration */
>  #define SB800_SMB_HOSTC_SMI  (1 << 0)/* SMI */

-- 
Matthieu Herrb



[UPDATE] xhost 1.0.8

2019-12-29 Thread Matthieu Herrb
Hi again,

the patch below update xhost to version 1.0.8. testing and oks
welcome.

Index: ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/app/xhost/ChangeLog,v
retrieving revision 1.6
diff -u -p -u -r1.6 ChangeLog
--- ChangeLog   10 May 2015 10:12:42 -  1.6
+++ ChangeLog   15 Aug 2019 17:34:35 -
@@ -1,3 +1,96 @@
+commit 997135c6e37faa50f8b42a5f95c0cc8461ed6be9
+Author: Alan Coopersmith 
+Date:   Tue Feb 19 14:50:20 2019 -0800
+
+xhost 1.0.8
+
+Signed-off-by: Alan Coopersmith 
+
+commit 0ef87307f77e7e3df04b227046904cecbe6dd3f6
+Author: Alan Coopersmith 
+Date:   Wed Nov 21 17:06:21 2018 -0800
+
+Update configure.ac bug URL for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit 136e3be46cbd93a490483126b837f67c391129a1
+Author: Alan Coopersmith 
+Date:   Fri Nov 16 22:15:54 2018 -0800
+
+Update README for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit 317312bd23cf5c524932c6f12319ed3eed68d981
+Author: Alan Coopersmith 
+Date:   Mon Nov 12 14:05:52 2018 -0800
+
+Drop ancient workarounds for Cray that are no longer needed
+
+Signed-off-by: Alan Coopersmith 
+
+commit 62bfa9d421138ec538682eb0323fa9f438d6b2c7
+Author: Alan Coopersmith 
+Date:   Mon Nov 12 13:27:55 2018 -0800
+
+Prefer inet_aton, if available, over inet_addr
+
+Signed-off-by: Alan Coopersmith 
+
+commit 0c3627bc7dac395c6af8bd1fb747ef3556e95fb4
+Author: Tobias Stoeckmann 
+Date:   Wed Jul 4 16:20:06 2018 +0200
+
+Prevent OOB access on illegal server response.
+
+While parsing Xorg responses it is possible to trigger an out of
+boundary read if the response does not contain enough bytes.
+
+In case of IPv4, the padding normally prevents this, but IPv6
+addresses can trigger an out of boundary read.
+
+It takes a hostile xorg-server to reproduce this issue. If
+os/access.c is adjusted to always use a length of 1, it is possible
+to reproduce it and make it visible with an ASAN-compiled xhost.
+
+Reading past the memory boundary could reveal sensitive information
+to external DNS servers, because a lookup will be performed.
+
+Signed-off-by: Tobias Stoeckmann 
+Reviewed-by: Matthieu Herrb 
+
+commit 28015d91e284ee4b797a6e99ec16d53147c0ddb6
+Author: Mihail Konev 
+Date:   Thu Jan 26 14:00:21 2017 +1000
+
+autogen: add default patch prefix
+
+Signed-off-by: Mihail Konev 
+
+commit 3ee80cd398579c0f182ff7131ebfe7b65efed72b
+Author: Emil Velikov 
+Date:   Mon Mar 9 12:00:52 2015 +
+
+autogen.sh: use quoted string variables
+
+Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+fall-outs, when they contain space.
+
+Signed-off-by: Emil Velikov 
+Reviewed-by: Peter Hutterer 
+Signed-off-by: Peter Hutterer 
+
+commit 991e4a8a26e9c03faa291b522067443a8d05af7a
+Author: Jon TURNEY 
+Date:   Sun Sep 14 18:13:28 2014 +0100
+
+Move sethostent()/gethostent() stubs used in Windows builds to avoid 
implicit-function-declaration warnings
+
+Signed-off-by: Jon TURNEY 
+Reviewed-by: Alan Coopersmith 
+Reviewed-by: David Macek 
+
 commit 06d71376aa43f9177ec1e37ed1e4d0faca655cff
 Author: Alan Coopersmith 
 Date:   Thu Apr 16 23:28:02 2015 -0700
Index: Makefile.am
===
RCS file: /cvs/OpenBSD/xenocara/app/xhost/Makefile.am,v
retrieving revision 1.4
diff -u -p -u -r1.4 Makefile.am
--- Makefile.am 7 Apr 2012 15:52:30 -   1.4
+++ Makefile.am 15 Aug 2019 17:34:35 -
@@ -18,4 +18,4 @@ ChangeLog:
 
 dist-hook: ChangeLog INSTALL
 
-
+EXTRA_DIST = README.md
Index: Makefile.in
===
RCS file: /cvs/OpenBSD/xenocara/app/xhost/Makefile.in,v
retrieving revision 1.9
diff -u -p -u -r1.9 Makefile.in
--- Makefile.in 11 Oct 2016 22:14:40 -  1.9
+++ Makefile.in 15 Aug 2019 17:34:57 -
@@ -52,7 +52,7 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = xhost$(EXEEXT)
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \
compile config.guess config.sub depcomp install-sh missing
@@ -293,6 +293,7 @@ xhost_SOURCES = xhost.c
 AM_CFLAGS = $(CWARNFLAGS) $(XHOST_CFLAGS) $(XAU_CFLAGS)
 xhost_LDADD = $(XHOST_LIBS)
 MAINTAINERCLEANFILES = ChangeLog INSTALL
+EXTRA_DIST = README.md
 all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
Index: README
===
RCS file: README
diff -N README
--- README  24 Oct 2009 14:14:08 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,26 +0,0 @@
-xhost is used to manage the list of host names or user names

[UPDATE] xauth 1.1.0

2019-12-29 Thread Matthieu Herrb
ster Xauth *a, regist
 return 1;
 }
 
-/* return non-zero iff display and authorization type are the same */
-
-static int
-match_auth(register Xauth *a, register Xauth *b)
-{
-return ((match_auth_dpy(a, b)
-&& a->name_length == b->name_length
-&& memcmp(a->name, b->name, a->name_length) == 0) ? 1 : 0);
-}
-
-
 static int
 merge_entries(AuthList **firstp, AuthList *second, int *nnewp, int *nreplp)
 {
@@ -1144,7 +1131,7 @@ merge_entries(AuthList **firstp, AuthLis
 
a = first;
for (;;) {
-   if (match_auth (a->auth, b->auth)) {  /* found a duplicate */
+   if (eq_auth_dpy_and_name (a->auth, b->auth)) {  /* found a 
duplicate */
AuthList tmp;   /* swap it in for old one */
tmp = *a;
*a = *b;
@@ -1175,6 +1162,45 @@ merge_entries(AuthList **firstp, AuthLis
 
 }
 
+static void
+sort_entries(AuthList **firstp)
+{
+/* Insert sort, in each pass it removes auth records of certain */
+/* cathegory from the given list and inserts them into the sorted list. */
+
+AuthList *sorted = NULL, *sorted_tail = NULL;
+AuthList *prev, *iter, *next;
+
+#define SORT_OUT(EXPRESSION) { \
+   prev = NULL; \
+   for (iter = *firstp; iter; iter = next) { \
+   next = iter->next; \
+   if (EXPRESSION) { \
+   if (prev) \
+   prev->next = next; \
+   else \
+   *firstp = next; \
+   if (sorted_tail == NULL) { \
+   sorted = sorted_tail = iter; \
+   } else { \
+   sorted_tail->next = iter; \
+   sorted_tail = iter; \
+   } \
+   iter->next = NULL; \
+   } else { \
+   prev = iter; \
+   } \
+   } \
+}
+
+SORT_OUT(iter->auth->family != FamilyWild && iter->auth->number_length != 
0);
+SORT_OUT(iter->auth->family != FamilyWild && iter->auth->number_length == 
0);
+SORT_OUT(iter->auth->family == FamilyWild && iter->auth->number_length != 
0);
+SORT_OUT(iter->auth->family == FamilyWild && iter->auth->number_length == 
0);
+
+*firstp = sorted;
+}
+
 static Xauth *
 copyAuth(Xauth *auth)
 {
@@ -1513,6 +1539,7 @@ do_merge(const char *inputfilename, int 
  printf ("%d entries read in:  %d new, %d replacement%s\n",
  nentries, nnew, nrepl, nrepl != 1 ? "s" : "");
if (nentries > 0) xauth_modified = True;
+   sort_entries(_head);
 }
 
 return 0;
@@ -1661,6 +1688,7 @@ do_add(const char *inputfilename, int li
fprintf (stderr, "unable to merge in added record\n");
return 1;
 }
+sort_entries(_head);
 
 xauth_modified = True;
 return 0;
Index: test-driver
===
RCS file: /cvs/OpenBSD/xenocara/app/xauth/test-driver,v
retrieving revision 1.2
diff -u -p -u -r1.2 test-driver
--- test-driver 19 Feb 2017 17:30:58 -  1.2
+++ test-driver 15 Aug 2019 17:06:03 -
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -140,9 +140,9 @@ echo ":copy-in-global-log: $gcopy" >> $t
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:

-- 
Matthieu Herrb



[UPDATE] libXpm 3.5.13

2019-12-29 Thread Matthieu Herrb
Hi,

The diff below updates libXpm to version 3.5.13. Tests and oks
welcome.

Apply in $XSRCDIR/lib/libXpm and then rebuild xenocara following
release(8).

Index: ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXpm/ChangeLog,v
retrieving revision 1.6
diff -u -p -u -r1.6 ChangeLog
--- ChangeLog   16 Dec 2016 07:28:34 -  1.6
+++ ChangeLog   15 Dec 2019 18:27:04 -
@@ -1,3 +1,131 @@
+commit b0fc485495a694816d76a43978e2cfd5575c554d
+Author: Peter Hutterer 
+Date:   Fri Dec 13 14:25:06 2019 +1000
+
+libXpm 3.5.13
+
+Signed-off-by: Peter Hutterer 
+
+commit 5817fd4ac5308fe7c23301c652f174997009b7d5
+Author: Benjamin Tissoires 
+Date:   Wed Dec 4 11:17:21 2019 +0100
+
+parse: simplify error paths in xpmParseColors()
+
+We introduced a new label to handle the errors, we should use it
+for the rest of the function.
+
+Signed-off-by: Benjamin Tissoires 
+
+commit e1d8f704d52f70680869b7aae1da0ad2382db363
+Author: Peter Hutterer 
+Date:   Thu Dec 5 06:17:00 2019 +1000
+
+parse: avoid memleak on error with STRLCAT/STRLCPY
+
+The original macro might exit the function without freeing `colorTable`.
+
+Move the macros into a slightly less awful helper function and use goto
+to clean up in case of error.
+
+Signed-off-by: Peter Hutterer 
+
+commit 7af7c5e275b69daedee3696bee1e880586f30373
+Author: Fabrice Fontaine 
+Date:   Fri May 3 07:59:09 2019 +0200
+
+Allow usage when fork() is not available
+
+When fork() is not available, we need to define NO_ZPIPE so that
+libXpm doesn't try to fork/exec to use a pipe to uncompress compressed
+.xpm files. There is obviously a loss of functionality, but loading
+uncompressed .xpm files should continue to work.
+
+Signed-off-by: Thomas Petazzoni 
+[Retrieved from:
+
https://git.buildroot.net/buildroot/tree/package/x11r7/xlib_libXpm/0001-fork-check.patch]
+Signed-off-by: Fabrice Fontaine 
+
+commit 0be2c6712728cea1fa1bcc640e564c45c2c82e37
+Author: Alan Coopersmith 
+Date:   Fri Dec 7 19:47:06 2018 -0800
+
+Update configure.ac bug URL for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit c9f8faf1c05fb92abc6c5b1db5e45eb1a7942875
+Author: Alan Coopersmith 
+Date:   Mon Nov 19 22:30:30 2018 -0800
+
+Update README for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit 73a1e769dcf2a603fc63f5c36626c1c6db815f46
+Author: Alan Coopersmith 
+Date:   Sun Sep 30 15:09:29 2018 -0700
+
+After fdopen(), use fclose() instead of close() in error path
+
+Found by Oracle's Parfait 2.2 static analyzer:
+
+Error: File Leak
+   File Leak [file-ptr-leak]:
+  Leaked File fp
+at line 94 of lib/libXpm/src/RdFToBuf.c in function 
'XpmReadFileToBuffer
+'.
+  fp initialized at line 86 with fdopen
+  fp leaks when len < 0 at line 92.
+
+Introduced-by: commit 8b3024e6871ce50b34bf2dff924774bd654703bc
+
+Signed-off-by: Alan Coopersmith 
+Reviewed-by: Peter Hutterer 
+
+commit bc1b4962f048cfa33b76be46493e10cfb256fe98
+Author: Dave Bodenstab 
+Date:   Wed Feb 22 12:04:54 2012 +
+
+Windows build fixes
+
+https://bugs.freedesktop.org/show_bug.cgi?id=46475
+https://bugs.freedesktop.org/attachment.cgi?id=57479
+
+Signed-off-by: Alan Coopersmith 
+
+commit e42ca7b484418b169fd19a4c68e23ad2a6ec7a11
+Author: Mihail Konev 
+Date:   Thu Jan 26 13:52:49 2017 +1000
+
+autogen: add default patch prefix
+
+Signed-off-by: Mihail Konev 
+
+commit ed8f9c2e8b635eb63497c48b24a056f9e6f50609
+Author: Emil Velikov 
+Date:   Mon Mar 9 12:00:52 2015 +
+
+autogen.sh: use quoted string variables
+
+Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+fall-outs, when they contain space.
+
+Signed-off-by: Emil Velikov 
+Reviewed-by: Peter Hutterer 
+Signed-off-by: Peter Hutterer 
+
+commit 644d7c595ba29fb368666fb497e1e14a92a65a77
+Author: Peter Hutterer 
+Date:   Tue Jan 24 10:32:07 2017 +1000
+
+autogen.sh: use exec instead of waiting for configure to finish
+
+Syncs the invocation of configure with the one from the server.
+
+Signed-off-by: Peter Hutterer 
+Reviewed-by: Emil Velikov 
+
 commit 1fab5e81fd761f628fb68d22934615536dbd0220
 Author: Matthieu Herrb 
 Date:   Mon Dec 12 23:09:52 2016 +0100
Index: Makefile.am
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXpm/Makefile.am,v
retrieving revision 1.4
diff -u -p -u -r1.4 Makefile.am
--- Makefile.am 10 Mar 2012 14:30:32 -  1.4
+++ Makefile.am 15 Dec 2019 18:27:04 -
@@ -8,7 +8,7 @@ ACLOCAL_AMFLAGS = -I m4
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xpm.pc
 
-EXTRA_DIST = COPYRIGHT NEWS.old
+EXTRA_DIST = COPYRIGHT NEWS.old README.md
 
 MAINTAINERCLEANFILES = Change

Re: [Patch]: Integrate VA-API into xenocara

2019-12-19 Thread Matthieu Herrb
On Wed, Dec 18, 2019 at 03:28:48PM -0600, Brad DeMorrow wrote:
> This is a rather large patch that moves my previously submitted
> VA-API ports into xenocara. For your convenience, I've inlined
> a diff that shows you all of the changes I made to existing files
> that you can easily read in your MUA.  The attached patch also
> contains these changes and should be the only xenocara patch
> you need to apply.
> 
> Summary of Changes:
>  - libva added to xenocara/lib/libva
>  - vainfo added to xenocara/app/vainfo
>  - intel-vaapi-driver added to xenocara/driver/intel-vaapi-driver
>  - Mesa Makefile.bsd-wrapper updated to build with --enable-va flag
>  - 3RDPARTY file updated to include libva, libva-utils, and intel-vaapi-driver
>  - BSD.x11.dist updated to include /usr/X11R6/include/va/ (separate patch)
> 
> Architectures Tested: amd64 
> 
> Testing Instructions:
> 1. save xenocara-vaapi.patch.gz to /tmp
> 2. cd /tmp; gunzip xenocara-vaapi.patch.gz
> 3. cd /usr/xenocara
> 4. patch -p0 < /tmp/xenocara-vaapi.patch
> 5. Follow normal build instructions in README within the root of xenocara
> 6. Run vainfo.  It should report available profiles and entrypoints for 
> VA-API.
>Example of successful execution:

Hi,

I won't be able to look at this before the 28th, being busy for work
and then away for vacation.

Thaks for this work.
-- 
Matthieu Herrb



update: X server to version 1.20.6

2019-11-23 Thread Matthieu Herrb
Hi,

The diff below update the X server to version 1.20.6.
See ChangeLog for changes.

Testing and oks are welcome.

Index: ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/xserver/ChangeLog,v
retrieving revision 1.33
diff -u -p -u -r1.33 ChangeLog
--- ChangeLog   27 Jul 2019 07:57:06 -  1.33
+++ ChangeLog   23 Nov 2019 11:51:22 -
@@ -1,3 +1,929 @@
+commit 6b3fafa9bfa94b9b04a1a44dc52afb7c4bc250ce
+Author: Matt Turner 
+Date:   Fri Nov 22 17:52:04 2019 -0500
+
+xserver 1.20.6
+
+Signed-off-by: Matt Turner 
+
+commit 88f12aa74bf4fea25d5b8d8002b3088432feb405
+Author: Matt Turner 
+Date:   Thu Nov 21 11:23:18 2019 -0500
+
+xfree86: Test presence of isastream()
+
+isastream() was never more than a stub in glibc, and was removed in
+glibc-2.30 by commit a0a0dc83173c ("Remove obsolete, never-implemented
+XSI STREAMS declarations").
+
+Bug: https://bugs.gentoo.org/700838
+Reviewed-by: Julien Cristau 
+Signed-off-by: Matt Turner 
+(cherry picked from commit e6ab7f9f342f463092c45226f3294074351fdd5e)
+
+commit 0e60139064b84b856c59e5a456e26c60710b1b69
+Author: Olivier Fourdan 
+Date:   Mon Nov 18 17:28:45 2019 +0100
+
+present/wnmd: Relax assertion on CRTC on abort_vblank()
+
+Currently, the function `present_wnmd_abort_vblank()` would fail if the
+given `crtc` is NULL.
+
+However, `xwl_present_get_crtc()` can return `NULL` under some
+circumstances, which would cause an unexpected termination of Xwayland
+in such a case, caused by the assertion failure being triggered.
+
+Remove the assertion, considering that the `crtc` isn't actually used in
+neither `present_wnmd_abort_vblank()` nor `xwl_present_abort_vblank()`.
+
+Signed-off-by: Olivier Fourdan 
+Reviewed-by: Michel Dänzer 
+Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/937
+(cherry picked from commit 4f984fc06bd57cabfa38f6191f10714878dc8969)
+
+commit 2edadf26f1f8deddbe171115fa502337ac62df02
+Author: Aaron Plattner 
+Date:   Tue Nov 19 10:08:51 2019 -0800
+
+os: Don't crash in AttendClient if the client is gone
+
+If a client is in the process of being closed down, then its 
client->osPrivate
+pointer will be set to NULL by CloseDownConnection. This can cause a crash 
if
+freeing the client's resources results in a call to AttendClient. For 
example,
+if the client has a pending sync fence:
+
+ Thread 1 "X" received signal SIGSEGV, Segmentation fault.
+ AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
+ (gdb) bt
+ #0  AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
+ #1  0x5571c3dbb865 in SyncAwaitTriggerFired (pTrigger=) at ../Xext/sync.c:694
+ #2  0x5571c3dd5749 in miSyncDestroyFence (pFence=0x5571c5063980) at 
../miext/sync/misync.c:120
+ #3  0x5571c3dbbc69 in FreeFence (obj=, id=) at ../Xext/sync.c:1909
+ #4  0x5571c3d7a01d in doFreeResource (res=0x5571c506e3d0, 
skip=skip@entry=0) at ../dix/resource.c:880
+ #5  0x5571c3d7b1dc in FreeClientResources (client=0x5571c4aed9a0) at 
../dix/resource.c:1146
+ #6  FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1109
+ #7  0x5571c3d5525f in CloseDownClient (client=0x5571c4aed9a0) at 
../dix/dispatch.c:3473
+ #8  0x5571c3d55eeb in Dispatch () at ../dix/dispatch.c:492
+ #9  0x5571c3d59e96 in dix_main (argc=3, argv=0x7ffe7854bc28, 
envp=) at ../dix/main.c:276
+ #10 0x7fea4837cb6b in __libc_start_main (main=0x5571c3d1d060 , 
argc=3, argv=0x7ffe7854bc28, init=, fini=, 
rtld_fini=, stack_end=0x7ffe7854bc18) at ../csu/libc-start.c:308
+ #11 0x5571c3d1d09a in _start () at ../Xext/sync.c:2378
+ (gdb) print client->osPrivate
+ $1 = (void *) 0x0
+
+Since the client is about to be freed, its ignore count doesn't matter and
+AttendClient can simply be a no-op. Check for client->clientGone in 
AttendClient
+and remove similar checks from two callers that had them.
+
+Signed-off-by: Aaron Plattner 
+(cherry picked from commit 4308f5d3d1fbd0f5dce81e22c0c3f08c65a7c9d8)
+
+commit 68cfee97bc59580724d594c82f5ee55a980dadf0
+Author: Adam Jackson 
+Date:   Wed Oct 9 11:57:18 2019 -0400
+
+dix: Call SourceValidate before GetImage
+
+This ensures that any prep work for the drawable we're about to read
+from is already done before we call down to GetImage. This should be no
+functional change as most of the callers with a non-trivial
+SourceValidate are already wrapping GetImage and doing the equivalent
+thing, but we'll be simplifying that shortly.
+
+More importantly this ensures that if any of that prep work would
+generate events - like automatic compositing flushing rendering to a
+parent pixmap which then triggers damage - then it happens entirely
+before we start writing the GetImage 

[UPDATE] xf86-video-amdgpu and xf86-video-ati to versions 19.1.0

2019-10-19 Thread Matthieu Herrb
rtc);
}
@@ -2695,18 +2704,20 @@ void RADEONLeaveVT_KMS(ScrnInfoPtr pScrn
(!clients[i] || clients[i]->clientState != ClientStateRunning))
continue;
 
-   FindClientResourcesByType(clients[i], RT_PIXMAP, pixmap_unref_fb,
- pRADEONEnt);
+   FindClientResourcesByType(clients[i], RT_PIXMAP,
+ client_pixmap_unref_fb, pScreen);
}
 
-   pixmap_unref_fb(pScreen->GetScreenPixmap(pScreen), None, pRADEONEnt);
+   pixmap_unref_fb(pScreen->GetScreenPixmap(pScreen));
 } else {
memset(info->front_buffer->bo.radeon->ptr, 0,
   pScrn->displayWidth * info->pixel_bytes * pScrn->virtualY);
 }
 
-TimerSet(NULL, 0, 1000, cleanup_black_fb, pScreen);
+if (pScreen->GCperDepth[0])
+   TimerSet(NULL, 0, 1000, cleanup_black_fb, pScreen);
 
+ hide_cursors:
 xf86_hide_cursors (pScrn);
 
 radeon_drop_drm_master(pScrn);
Index: driver/xf86-video-ati/src/radeon_present.c
===
RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-ati/src/radeon_present.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 radeon_present.c
--- driver/xf86-video-ati/src/radeon_present.c  8 Mar 2019 21:59:57 -   
1.6
+++ driver/xf86-video-ati/src/radeon_present.c  19 Oct 2019 16:23:21 -
@@ -254,6 +254,7 @@ radeon_present_check_flip(RRCrtcPtr crtc
 xf86CrtcPtr xf86_crtc = crtc->devPrivate;
 ScreenPtr screen = window->drawable.pScreen;
 ScrnInfoPtr scrn = xf86_crtc->scrn;
+struct radeon_pixmap *priv = radeon_get_pixmap_private(pixmap);
 xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 RADEONInfoPtr info = RADEONPTR(scrn);
 PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
@@ -276,6 +277,23 @@ radeon_present_check_flip(RRCrtcPtr crtc
 if (pixmap->devKind != screen_pixmap->devKind)
return FALSE;
 #endif
+
+if (priv && priv->fb_failed)
+   return FALSE;
+
+if (!radeon_pixmap_get_fb(pixmap)) {
+   if (!priv)
+   priv = radeon_get_pixmap_private(pixmap);
+
+   if (priv && !priv->fb_failed) {
+   xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+  "Cannot get FB for Present flip (may be "
+  "normal if using PRIME render offloading)\n");
+   priv->fb_failed = TRUE;
+   }
+
+   return FALSE;
+}
 
 /* The kernel driver doesn't handle flipping between BOs with different
  * tiling parameters correctly yet

-- 
Matthieu Herrb



Re: rcctl issues when running in non-default rdomain

2019-09-06 Thread Matthieu Herrb
On Thu, Sep 05, 2019 at 11:00:06PM +0200, Matthieu Herrb wrote:
> Hi,
> 
> on my redundant firealls I have an " admin" interface in rdomain 1
> with a sshd listening, used to be able to access the slave machine and
> let it access the internet to be able to run syspatch or pkg_add.
> 
> This works well, but but if I use rcctl in this non default rdomain to
> control services normally running in the default rdomain, things don't
> behave too well. In particular, 'rcctl start' or 'restart' starts the
> service with rtable 1.
> 
> Alternatives would be to run the admin interface in the default rdomain
> and all other interfaces in a separate one, but it feels more painful
> to setup.
> 
> It seems to me that the patch below helps, but may be it has other
> unforseen and unwanted effects ?
> 
> Thoughts ?

I've been told privately that this was already handled. Indeed this
was a pair of firewalls still runnuing 6.4.

So issue closed. Thanks.
> 
> Index: rc.subr
> ===
> RCS file: /cvs/OpenBSD/src/etc/rc.d/rc.subr,v
> retrieving revision 1.131
> diff -u -r1.131 rc.subr
> --- rc.subr   21 Mar 2019 15:10:27 -  1.131
> +++ rc.subr   5 Sep 2019 20:56:38 -
> @@ -320,5 +320,4 @@
>  # make sure pexp matches the process (i.e. doesn't include the quotes)
>  pexp="$(eval echo ${daemon}${daemon_flags:+ ${daemon_flags}})"
>  rcexec="su -l -c ${daemon_class} -s /bin/sh ${daemon_user} -c"
> -[ "${daemon_rtable}" -eq "$(id -R)" ] ||
> -     rcexec="route -T ${daemon_rtable} exec ${rcexec}"
> +rcexec="route -T ${daemon_rtable} exec ${rcexec}"
> 
> 
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



rcctl issues when running in non-default rdomain

2019-09-05 Thread Matthieu Herrb
Hi,

on my redundant firealls I have an " admin" interface in rdomain 1
with a sshd listening, used to be able to access the slave machine and
let it access the internet to be able to run syspatch or pkg_add.

This works well, but but if I use rcctl in this non default rdomain to
control services normally running in the default rdomain, things don't
behave too well. In particular, 'rcctl start' or 'restart' starts the
service with rtable 1.

Alternatives would be to run the admin interface in the default rdomain
and all other interfaces in a separate one, but it feels more painful
to setup.

It seems to me that the patch below helps, but may be it has other
unforseen and unwanted effects ?

Thoughts ?

Index: rc.subr
===
RCS file: /cvs/OpenBSD/src/etc/rc.d/rc.subr,v
retrieving revision 1.131
diff -u -r1.131 rc.subr
--- rc.subr 21 Mar 2019 15:10:27 -  1.131
+++ rc.subr 5 Sep 2019 20:56:38 -
@@ -320,5 +320,4 @@
 # make sure pexp matches the process (i.e. doesn't include the quotes)
 pexp="$(eval echo ${daemon}${daemon_flags:+ ${daemon_flags}})"
 rcexec="su -l -c ${daemon_class} -s /bin/sh ${daemon_user} -c"
-[ "${daemon_rtable}" -eq "$(id -R)" ] ||
-   rcexec="route -T ${daemon_rtable} exec ${rcexec}"
+rcexec="route -T ${daemon_rtable} exec ${rcexec}"


-- 
Matthieu Herrb



rad(8) and carp interfaces

2019-09-04 Thread Matthieu Herrb
Hi,

I've a pair of redundant routers, which need to run rad(8) on the
internal interfaces.

But using carp, on the inactive router, rad complains every
time it tries to send a RA:

 rad[65590]: sendmsg on carp2: Can't assign requested address

Which I can understand since it currently doesnt "own" the shared IPv6
address of the carp interface.

Is there a way to configure rad to avoid these errors?
How do other people handle the situation?

Thanks in advance,
-- 
Matthieu Herrb



[UPDATE] freetype 2.10.1

2019-09-01 Thread Matthieu Herrb
Hi,

The diff at https://herrb.eu/freetype-2.10.1-full.diff updates freetype
to version 2.10.1.

To test it, apply the patch to $XSRCDIR and rebuild Xenocara according
the release(8) man page.

Some things about about this update:

- it is a major library bump. I took the opportunity to make the shared
  library build more in-line with what would be produced by the upstream
  build system:  adding symbol visibility and a version map. The result
  is a lot less public symbols. Directly dependent X libraries (Xft,
  fontconfig and Xfont2) have been bumped too.

- the new reference documentation includes a lot of huge binary or packed
  one-liner javascript files that break diff/patch. I've removed that
  part from the diff. I'm undecided wether to remove freetype-doc
  completely from $XSRCDIR and maybe add it as a port, or adding back
  all those binaries manually.

  Unfortunatly, I don't think that the documenation system that is used
  can easyly be converted to mandoc for inclusion as man pages instead
  (which would be ideal). Ingo ?

- The new color emoji support is disabled, since there is no libpng or
  libharfbuzz in the base system.

- The diff is too large to be sent inline. Sorry. This is the checksum
  of the file :

  SHA256 (freetype-2.10.1-full.diff) = 
884e1b38691d15e582934f077b2b2b45fa7e79fe353130b4f9cf825e82bb97e6

ok, comments ?

-- 
Matthieu Herrb



Re: arm64 glass console

2019-08-11 Thread Matthieu Herrb
On Sat, Aug 10, 2019 at 12:16:14AM +0200, Mark Kettenis wrote:
> The diff below makes it possible to switch over to the framebuffer
> console in the bootloader.  Currently, we'll use whatever device is
> designated in the device tree (or the ACPI SPCR table) as the console.
> With this diff you can use:
> 
>   boot> set tty fb0
> 
> to override that default.
> 
> ok?

Hi,

This works great on my PineBook 11" HD
-- 
Matthieu Herrb



Re: [update] libxtrans 1.4.0

2019-08-03 Thread Matthieu Herrb
On Sun, Jul 14, 2019 at 06:31:13PM +0200, Matthieu Herrb wrote:
> Hi,
> 
> the patch below updates libxtrans to version 1.4.0. Since there is one
> removed in a generated file used by other libs, there are also libX11
> and libICE major bumps.

Ping.

In particular, how is the schedule wrt major bumps ? I'd like to commit
this (and the other libs updates) tomorrow  (CET) if possible. 

> 
> comments, oks ?
> 
> Index: lib/libICE/Makefile.bsd-wrapper
> ===
> RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.bsd-wrapper,v
> retrieving revision 1.3
> diff -u -p -u -r1.3 Makefile.bsd-wrapper
> --- lib/libICE/Makefile.bsd-wrapper   13 Aug 2013 07:07:12 -  1.3
> +++ lib/libICE/Makefile.bsd-wrapper   14 Jul 2019 15:36:48 -
> @@ -1,5 +1,5 @@
>  # $OpenBSD: Makefile.bsd-wrapper,v 1.3 2013/08/13 07:07:12 guenther Exp $
>  
> -SHARED_LIBS= ICE 10.0
> +SHARED_LIBS= ICE 11.0
>  
>  .include 
> Index: lib/libX11/Makefile.bsd-wrapper
> ===
> RCS file: /cvs/OpenBSD/xenocara/lib/libX11/Makefile.bsd-wrapper,v
> retrieving revision 1.24
> diff -u -p -u -r1.24 Makefile.bsd-wrapper
> --- lib/libX11/Makefile.bsd-wrapper   11 Mar 2016 13:09:42 -  1.24
> +++ lib/libX11/Makefile.bsd-wrapper   14 Jul 2019 15:36:49 -
> @@ -1,7 +1,7 @@
>  # $OpenBSD: Makefile.bsd-wrapper,v 1.24 2016/03/11 13:09:42 okan Exp $
>  .include 
>  
> -SHARED_LIBS= X11 16.1 X11_xcb 2.0
> +SHARED_LIBS= X11 17.0 X11_xcb 2.0
>  
>  CONFIGURE_ARGS= --enable-tcp-transport --enable-unix-transport --enable-ipv6 
> \
>   --disable-composecache \
> Index: lib/libxtrans/ChangeLog
> ===
> RCS file: /cvs/OpenBSD/xenocara/lib/libxtrans/ChangeLog,v
> retrieving revision 1.8
> diff -u -p -u -r1.8 ChangeLog
> --- lib/libxtrans/ChangeLog   28 Sep 2014 16:56:06 -  1.8
> +++ lib/libxtrans/ChangeLog   14 Jul 2019 15:37:04 -
> @@ -1,3 +1,213 @@
> +commit c4262efc9688e495261d8b23a12f956ab38e006f
> +Author: Alan Coopersmith 
> +Date:   Sat Mar 16 14:25:35 2019 -0700
> +
> +xtrans 1.4.0
> +
> +Signed-off-by: Alan Coopersmith 
> +
> +commit faa42207a0653535ab80825b0acb50b417702ec4
> +Author: Alan Coopersmith 
> +Date:   Fri Dec 7 19:52:43 2018 -0800
> +
> +Update configure.ac bug URL for gitlab migration
> +
> +Signed-off-by: Alan Coopersmith 
> +
> +commit cd22de616c77328da3410b1eaab541c2d331ffdb
> +Author: Alan Coopersmith 
> +Date:   Mon Nov 19 23:12:07 2018 -0800
> +
> +Update README for gitlab migration
> +
> +Signed-off-by: Alan Coopersmith 
> +
> +commit 06cfa80fb3d03ca03fd92f9687a77958338e012c
> +Author: Alan Coopersmith 
> +Date:   Sun Sep 30 17:04:51 2018 -0700
> +
> +Use fchmod() instead of chmod() when creating named pipes
> +
> +Signed-off-by: Alan Coopersmith 
> +
> +commit 7bd504f7ab7799ab77ad50eb39f6afdbaf2f9e50
> +Author: Alan Coopersmith 
> +Date:   Sat Aug 25 11:18:52 2018 -0700
> +
> +Use strcasecmp if it's available, instead of lowercasing strings
> +
> +Signed-off-by: Alan Coopersmith 
> +
> +commit 941cfa50bc2d45f20943fd21bab98e2eceeeb259
> +Author: Alan Coopersmith 
> +Date:   Sat Aug 25 10:45:04 2018 -0700
> +
> +Set freeXLOCAL to NULL after freeing it to prevent double frees
> +
> +We shouldn't be calling the LocalEndTransports routine twice, but
> +just make sure if we do, we don't call free twice on the same pointer.
> +
> +Signed-off-by: Alan Coopersmith 
> +
> +commit a97e5fc6e4f294294d75500068892aea11952773
> +Author: Rin Okuyama 
> +Date:   Tue Feb 21 06:18:37 2017 +
> +
> +avoid -Wformat errors from clang
> +
> +https://bugs.freedesktop.org/show_bug.cgi?id=99882
> +
> +Reviewed-by: Alan Coopersmith 
> +Signed-off-by: Alan Coopersmith 
> +
> +commit 28366676effaa512e43bfd2276a317389a992511
> +Author: Emil Velikov 
> +Date:   Mon Mar 9 12:00:52 2015 +
> +
> +autogen.sh: use quoted string variables
> +
> +Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
> +fall-outs, when they contain space.
> +
> +Signed-off-by: Emil Velikov 
> +Reviewed-by: Peter Hutterer 
> +Signed-off-by: Peter Hutterer 
> +
> +commit 8554cf05262ab6ad6e8da5f11022e5dc2a452e38
> +Author: Peter Hutterer 
> +Date:   Tue Jan 24 10:32:07 2017 +1000
> +
> +autogen.sh: use exec instead of waiting for configure to finish
> +
> +Syncs the invocation of configure with the one from the 

Re: ldomctl.8: split config into new ldom.conf.5

2019-07-27 Thread Matthieu Herrb
On Sat, Jul 27, 2019 at 03:30:53AM +0200, Klemens Nanni wrote:
> Index: usr.sbin/ldomd/Makefile
> ===
> RCS file: /cvs/src/usr.sbin/ldomd/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- usr.sbin/ldomd/Makefile   27 Oct 2012 20:03:24 -  1.3
> +++ usr.sbin/ldomd/Makefile   27 Jul 2019 01:25:36 -
> @@ -16,7 +16,7 @@ NOPROG= yes
>  
>  .endif
>  
> -MAN= ldomd.8
> +MAN= ldomd.8 ldom.conf.5
>  MANSUBDIR=sparc64
>  
>  .include 

Here on amd64 this breaks the build:

install -c -o root -g bin -m 444  /share/OpenBSD/src/usr.sbin/ldomd/ldomd.8 
/usr/share/man/man8/sparc64/ldomd.8
install -c -o root -g bin -m 444  /share/OpenBSD/src/usr.sbin/ldomd/ldom.conf.5 
/usr/share/man/man5/sparc64/ldom.conf.5
install: /usr/share/man/man5/sparc64/INS@uuYbA85wgn: No such file or directory
*** Error 1 in /share/OpenBSD/src/usr.sbin/ldomd (:35 
'/usr/share/man/man5/sparc64/ldom.conf.5')

-- 
Matthieu Herrb



[update] libXdmcp 1.1.3

2019-07-14 Thread Matthieu Herrb
2... " >&6; }
+if ${ac_cv_lib_ws2_32_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ws2_32_main=yes
+else
+  ac_cv_lib_ws2_32_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5
+$as_echo "$ac_cv_lib_ws2_32_main" >&6; }
+if test "x$ac_cv_lib_ws2_32_main" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBWS2_32 1
+_ACEOF
+
+  LIBS="-lws2_32 $LIBS"
+
+fi
+
+;;
+ *)
+;;
+esac
+
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" 
>&5
 $as_echo_n "checking for arc4random_buf in -lbsd... " >&6; }
@@ -18703,7 +18794,7 @@
 
 fi
 
-for ac_func in srand48 lrand48 arc4random_buf
+for ac_func in srand48 lrand48 arc4random_buf getentropy
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -19633,7 +19724,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libXdmcp $as_me 1.1.2, which was
+This file was extended by libXdmcp $as_me 1.1.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -19699,7 +19790,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-libXdmcp config.status 1.1.2
+libXdmcp config.status 1.1.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
Index: configure.ac
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdmcp/configure.ac,v
retrieving revision 1.6
diff -u -r1.6 configure.ac
--- configure.ac6 Apr 2015 13:43:53 -   1.6
+++ configure.ac14 Jul 2019 21:09:27 -
@@ -22,7 +22,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libXdmcp], [1.1.2],
+AC_INIT([libXdmcp], [1.1.3],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXdmcp])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
@@ -55,9 +55,17 @@
 # Checks for libraries.
 AC_SEARCH_LIBS([recvfrom],[socket])
 
+case $host_os in
+ *mingw*)
+AC_CHECK_LIB([ws2_32],[main])
+;;
+ *)
+;;
+esac
+
 # Checks for library functions.
 AC_CHECK_LIB([bsd], [arc4random_buf])
-AC_CHECK_FUNCS([srand48 lrand48 arc4random_buf])
+AC_CHECK_FUNCS([srand48 lrand48 arc4random_buf getentropy])
 
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(XDMCP, xproto)
Index: doc/xdmcp.xml
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdmcp/doc/xdmcp.xml,v
retrieving revision 1.2
diff -u -r1.2 xdmcp.xml
--- doc/xdmcp.xml   10 Mar 2012 13:58:12 -  1.2
+++ doc/xdmcp.xml   14 Jul 2019 21:09:27 -
@@ -23,7 +23,7 @@
 
X Display Manager Control Protocol
X.Org Standard
-   X Version 11, Release 
+   X Version 11
Version 1.1



-- 
Matthieu Herrb



[update] libICE 1.0.10

2019-07-14 Thread Matthieu Herrb
-off-by: Benjamin Tissoires 
+Reviewed-by: Mark Kettenis 
+Reviewed-by: Alan Coopersmith 
+Signed-off-by: Peter Hutterer 
+
+commit 1746abbb1ae1c41ba29c14895c5bd3f1334faef5
+Author: Mihail Konev 
+Date:   Thu Jan 26 13:52:49 2017 +1000
+
+autogen: add default patch prefix
+
+Signed-off-by: Mihail Konev 
+
+commit 3aa14db63fefb7634b1bd4370e33ba14c4ea90ae
+Author: Emil Velikov 
+Date:   Mon Mar 9 12:00:52 2015 +
+
+autogen.sh: use quoted string variables
+
+Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+fall-outs, when they contain space.
+
+Signed-off-by: Emil Velikov 
+Reviewed-by: Peter Hutterer 
+Signed-off-by: Peter Hutterer 
+
+commit d41c57eaa0c1474acf0a6fb271f22106e3070016
+Author: Peter Hutterer 
+Date:   Tue Jan 24 10:32:07 2017 +1000
+
+autogen.sh: use exec instead of waiting for configure to finish
+
+Syncs the invocation of configure with the one from the server.
+
+Signed-off-by: Peter Hutterer 
+Reviewed-by: Emil Velikov 
+
+commit ac4bb20e74e064b219de70e9b54516a921fdb7c3
+Author: Tobias Stoeckmann 
+Date:   Tue Nov 22 20:13:29 2016 +0100
+
+Fix use after free on subsequent calls
+
+The function IceAuthFileName is vulnerable to a use after free. The
+flaw can be triggered by calling the function three times:
+
+- First call succeeds and stores the path in buf, a dynamically
+  allocated buffer with size bsize.
+- Second call fails due to out of memory. It frees buf, but keeps
+  the old size in bsize.
+- Third call only checks if bsize is large enough. Then it uses
+  buf without allocating it again -- the use after free happens.
+
+In order to exploit this, an attacker must change environment variables
+between each call, namely ICEAUTHORITY or HOME. It also takes subsequent
+calls. Due to these limitations, I don't consider this to be of high
+priority.
+
+Reviewed-by: Matthieu Herrb 
+
+commit b1720edc9b9f3e7a05caa3fcd81761e5818ea255
+Author: Remko van der Vossen 
+Date:   Sun Jul 19 08:34:11 2015 -0700
+
+Bug 90616 - libICE build fails on array bounds check
+
+https://bugs.freedesktop.org/show_bug.cgi?id=90616
+
+Recent versions of gcc have array bounds checking turned on by default,
+this leads to build failures of libICE. As the _IceVersionCount variable
+in ICElibint.h is not declared const the compiler cannot assume that the
+nested for loop in ProcessConnectionSetup stays within bounds.
+
+The simple fix is of course to change the declarations of _IceVersionCount,
+_IceVersions, and the local variable myVersionCount to const declarations.
+
+Reviewed-by: Alan Coopersmith 
+Signed-off-by: Alan Coopersmith 
+
+commit 8a511dad53774693ed818d54d7896e1663942b18
+Author: Jon TURNEY 
+Date:   Sat Sep 13 17:13:44 2014 +0100
+
+Include unistd.h for getpid()
+
+Signed-off-by: Jon TURNEY 
+Reviewed-by: David Macek 
+
+commit fd22b62ae6380ddb00fa4c750f5ce175d2a6e76f
+Author: Alan Coopersmith 
+Date:   Sun Sep 14 13:08:17 2014 -0700
+
+spec: Convert troff \*Q..\*U to DocBook ...
+
+Reported-by: Jasper St. Pierre 
+Signed-off-by: Alan Coopersmith 
+Reviewed-by: Jasper St. Pierre 
+
 commit 0dfab4253e26d5c6e5f058126eb5e9f7a7732ae8
 Author: Alan Coopersmith 
 Date:   Fri Jun 6 18:28:28 2014 -0700
Index: Makefile.am
===
RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- Makefile.am 4 Mar 2012 18:57:08 -   1.4
+++ Makefile.am 14 Jul 2019 20:12:15 -
@@ -19,3 +19,5 @@
 lint:
(cd src && $(MAKE) $(MFLAGS) lint)
 endif LINT
+
+EXTRA_DIST = README.md
Index: Makefile.bsd-wrapper
===
RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.bsd-wrapper,v
retrieving revision 1.3
diff -u -r1.3 Makefile.bsd-wrapper
--- Makefile.bsd-wrapper13 Aug 2013 07:07:12 -  1.3
+++ Makefile.bsd-wrapper14 Jul 2019 20:12:15 -
@@ -1,5 +1,5 @@
 # $OpenBSD: Makefile.bsd-wrapper,v 1.3 2013/08/13 07:07:12 guenther Exp $
 
-SHARED_LIBS=   ICE 10.0
+SHARED_LIBS=   ICE 11.0
 
 .include 
Index: Makefile.in
===
RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.in,v
retrieving revision 1.11
diff -u -r1.11 Makefile.in
--- Makefile.in 11 Oct 2016 22:15:18 -  1.11
+++ Makefile.in 14 Jul 2019 20:12:15 -
@@ -51,7 +51,7 @@
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/ice.pc.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL compile config.gues

[update] libXft 2.3.3

2019-07-14 Thread Matthieu Herrb
mat->depth);
-   pa.repeat = True;
-   info->colors[i].pict = XRenderCreatePicture (draw->dpy,
-pix,
-info->solidFormat,
-CPRepeat, );
-   XFreePixmap (dpy, pix);
+if (info->hasSolid) {
+   /*
+* Free any existing entry
+*/
+   if (info->colors[i].pict)
+   XRenderFreePicture (dpy, info->colors[i].pict);
+   /*
+* Create picture
+*/
+   info->colors[i].pict = XRenderCreateSolidFill (draw->dpy, 
>color);
+} else {
+   if (info->colors[i].screen != draw->screen && info->colors[i].pict)
+   {
+   XRenderFreePicture (dpy, info->colors[i].pict);
+   info->colors[i].pict = 0;
+   }
+   /*
+* Create picture if necessary
+*/
+   if (!info->colors[i].pict)
+   {
+   Pixmap  pix;
+   XRenderPictureAttributespa;
+
+   pix = XCreatePixmap (dpy, RootWindow (dpy, draw->screen), 1, 1,
+info->solidFormat->depth);
+   pa.repeat = True;
+   info->colors[i].pict = XRenderCreatePicture (draw->dpy,
+pix,
+info->solidFormat,
+CPRepeat, );
+   XFreePixmap (dpy, pix);
+   }
+   /*
+* Set to the new color
+*/
+   info->colors[i].color = color->color;
+   info->colors[i].screen = draw->screen;
+   XRenderFillRectangle (dpy, PictOpSrc,
+ info->colors[i].pict,
+ >color, 0, 0, 1, 1);
 }
-/*
- * Set to the new color
- */
 info->colors[i].color = color->color;
 info->colors[i].screen = draw->screen;
-XRenderFillRectangle (dpy, PictOpSrc,
- info->colors[i].pict,
- >color, 0, 0, 1, 1);
+
 return info->colors[i].pict;
 }
 
Index: src/xftint.h
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXft/src/xftint.h,v
retrieving revision 1.4
diff -u -p -u -r1.4 xftint.h
--- src/xftint.h11 Jun 2012 19:23:03 -  1.4
+++ src/xftint.h10 Jun 2019 16:52:02 -
@@ -245,6 +245,7 @@ typedef struct _XftDisplayInfo {
 XExtCodes  *codes;
 FcPattern  *defaults;
 FcBool hasRender;
+FcBool hasSolid;
 XftFont*fonts;
 XRenderPictFormat  *solidFormat;
 unsigned long  glyph_memory;

-- 
Matthieu Herrb



[update] libxtrans 1.4.0

2019-07-14 Thread Matthieu Herrb
Hi,

the patch below updates libxtrans to version 1.4.0. Since there is one
removed in a generated file used by other libs, there are also libX11
and libICE major bumps.

comments, oks ?

Index: lib/libICE/Makefile.bsd-wrapper
===
RCS file: /cvs/OpenBSD/xenocara/lib/libICE/Makefile.bsd-wrapper,v
retrieving revision 1.3
diff -u -p -u -r1.3 Makefile.bsd-wrapper
--- lib/libICE/Makefile.bsd-wrapper 13 Aug 2013 07:07:12 -  1.3
+++ lib/libICE/Makefile.bsd-wrapper 14 Jul 2019 15:36:48 -
@@ -1,5 +1,5 @@
 # $OpenBSD: Makefile.bsd-wrapper,v 1.3 2013/08/13 07:07:12 guenther Exp $
 
-SHARED_LIBS=   ICE 10.0
+SHARED_LIBS=   ICE 11.0
 
 .include 
Index: lib/libX11/Makefile.bsd-wrapper
===
RCS file: /cvs/OpenBSD/xenocara/lib/libX11/Makefile.bsd-wrapper,v
retrieving revision 1.24
diff -u -p -u -r1.24 Makefile.bsd-wrapper
--- lib/libX11/Makefile.bsd-wrapper 11 Mar 2016 13:09:42 -  1.24
+++ lib/libX11/Makefile.bsd-wrapper 14 Jul 2019 15:36:49 -
@@ -1,7 +1,7 @@
 # $OpenBSD: Makefile.bsd-wrapper,v 1.24 2016/03/11 13:09:42 okan Exp $
 .include 
 
-SHARED_LIBS=   X11 16.1 X11_xcb 2.0
+SHARED_LIBS=   X11 17.0 X11_xcb 2.0
 
 CONFIGURE_ARGS= --enable-tcp-transport --enable-unix-transport --enable-ipv6 \
--disable-composecache \
Index: lib/libxtrans/ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/lib/libxtrans/ChangeLog,v
retrieving revision 1.8
diff -u -p -u -r1.8 ChangeLog
--- lib/libxtrans/ChangeLog 28 Sep 2014 16:56:06 -  1.8
+++ lib/libxtrans/ChangeLog 14 Jul 2019 15:37:04 -
@@ -1,3 +1,213 @@
+commit c4262efc9688e495261d8b23a12f956ab38e006f
+Author: Alan Coopersmith 
+Date:   Sat Mar 16 14:25:35 2019 -0700
+
+xtrans 1.4.0
+
+Signed-off-by: Alan Coopersmith 
+
+commit faa42207a0653535ab80825b0acb50b417702ec4
+Author: Alan Coopersmith 
+Date:   Fri Dec 7 19:52:43 2018 -0800
+
+Update configure.ac bug URL for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit cd22de616c77328da3410b1eaab541c2d331ffdb
+Author: Alan Coopersmith 
+Date:   Mon Nov 19 23:12:07 2018 -0800
+
+Update README for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit 06cfa80fb3d03ca03fd92f9687a77958338e012c
+Author: Alan Coopersmith 
+Date:   Sun Sep 30 17:04:51 2018 -0700
+
+Use fchmod() instead of chmod() when creating named pipes
+
+Signed-off-by: Alan Coopersmith 
+
+commit 7bd504f7ab7799ab77ad50eb39f6afdbaf2f9e50
+Author: Alan Coopersmith 
+Date:   Sat Aug 25 11:18:52 2018 -0700
+
+Use strcasecmp if it's available, instead of lowercasing strings
+
+Signed-off-by: Alan Coopersmith 
+
+commit 941cfa50bc2d45f20943fd21bab98e2eceeeb259
+Author: Alan Coopersmith 
+Date:   Sat Aug 25 10:45:04 2018 -0700
+
+Set freeXLOCAL to NULL after freeing it to prevent double frees
+
+We shouldn't be calling the LocalEndTransports routine twice, but
+just make sure if we do, we don't call free twice on the same pointer.
+
+Signed-off-by: Alan Coopersmith 
+
+commit a97e5fc6e4f294294d75500068892aea11952773
+Author: Rin Okuyama 
+Date:   Tue Feb 21 06:18:37 2017 +
+
+avoid -Wformat errors from clang
+
+https://bugs.freedesktop.org/show_bug.cgi?id=99882
+
+Reviewed-by: Alan Coopersmith 
+Signed-off-by: Alan Coopersmith 
+
+commit 28366676effaa512e43bfd2276a317389a992511
+Author: Emil Velikov 
+Date:   Mon Mar 9 12:00:52 2015 +
+
+autogen.sh: use quoted string variables
+
+Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
+fall-outs, when they contain space.
+
+Signed-off-by: Emil Velikov 
+Reviewed-by: Peter Hutterer 
+Signed-off-by: Peter Hutterer 
+
+commit 8554cf05262ab6ad6e8da5f11022e5dc2a452e38
+Author: Peter Hutterer 
+Date:   Tue Jan 24 10:32:07 2017 +1000
+
+autogen.sh: use exec instead of waiting for configure to finish
+
+Syncs the invocation of configure with the one from the server.
+
+Signed-off-by: Peter Hutterer 
+Reviewed-by: Emil Velikov 
+
+commit 560d7550e23e9b14056b4a9b2569c2f256015f8a
+Author: Jeremy Huddleston Sequoia 
+Date:   Sat Sep 10 22:09:51 2016 -0700
+
+Update strlcpy macro check to also check HAVE_STRLCPY
+
+xorg-server moved from HAS_STRLCPY to HAVE_STRLCPY in 2011
+
+cf-xserver: d829a7c5cb42c979b58f3547136df5b05d906423
+
+Signed-off-by: Jeremy Huddleston Sequoia 
+
+commit 2e4c338eda8ec6996b7bacc1d0c7dfe7de925864
+Author: Adam Jackson 
+Date:   Thu Sep 1 09:28:58 2016 -0400
+
+Revert "Make FreeConnInfo static"
+
+ ajax: 75419e6b6d985ea8796f05d1acb5e154b065c9b9 of xtrans also
+ seems to have broken xtest.
+
+And indeed it does, xts5 knows a fair amount about xlib internals for
+some reason. Whether that's cromulent or 

Re: ssh-askpass(1): fix indicator size with multiple screens

2019-06-16 Thread Matthieu Herrb
On Sun, Jun 16, 2019 at 09:55:24PM +1000, Damien Miller wrote:
> 
> 
> On Sun, 16 Jun 2019, Matthieu Herrb wrote:
> 
> > On Sun, Jun 09, 2019 at 04:47:53PM +0200, Matthieu Herrb wrote:
> > > Hi,
> > > 
> > > ssh-askpass(1) is trying to be clever and computes the size of its
> > > indicator relatively to the screen resolution.
> > > 
> > > Unfortunatly, when multiple screens are present, this gets ugly. The
> > > support for Xinerama correctly computes the dimensions of the window
> > > to be created, relatively to the screen on which it will appear, but
> > > the computation of the indicator size is based on the size of the
> > > whole display, resulting in too small indicators (and too many of them
> > > if the screens hare layed out horizontally).
> > > 
> > > The patch below fixes that by computing the resolution of the whole
> > > display before taking xinerama into account.
> > > 
> > > A better fix would be to make this application really aware of XRandR
> > > and use the actual screen resolution from XRandR; this is an
> > > interesting project, if anyone wants to give it a try.
> > > 
> > > ok?
> > 
> > ping
> 
> ok djm.

Thanks,

> Is there an upstream for ssh-askpass? The old one I have
> http://www.jmknoble.net/software/x11-ssh-askpass/ doesn't resolve any more.

I have the same (dead) reference in /usr/xenocara/3RDPARTY and google
can't find any newer home, except
https://github.com/sigmavirus24/x11-ssh-askpass but it's just a mirror
of the original code, without anything new.

-- 
Matthieu Herrb



Re: libXfont2: disable font server code

2019-06-16 Thread Matthieu Herrb
On Sun, Jun 09, 2019 at 07:22:26PM +0200, Matthieu Herrb wrote:
> Hi,
> 
> We disabled almost all X font server support code already. The patch
> below removes support for connecting to a font server from libXfont2.
> 
> It means that you X server will no longer be able to use fonts from a
> remote font server. But did you even know this was possible ?
> 
> ok? comments?

ping

> 
> Index: Makefile.bsd-wrapper
> ===
> RCS file: /cvs/OpenBSD/xenocara/lib/libXfont2/Makefile.bsd-wrapper,v
> retrieving revision 1.2
> diff -u -r1.2 Makefile.bsd-wrapper
> --- Makefile.bsd-wrapper  26 May 2018 07:51:00 -  1.2
> +++ Makefile.bsd-wrapper  9 Jun 2019 17:15:38 -
> @@ -3,6 +3,6 @@
>  
>  SHARED_LIBS= Xfont2 1.0
>  
> -CONFIGURE_ARGS+= --with-xmlto=no --disable-devel-docs
> +CONFIGURE_ARGS+= --disable-fc --with-xmlto=no --disable-devel-docs
>  
>  .include 
> 
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



Re: ssh-askpass(1): fix indicator size with multiple screens

2019-06-16 Thread Matthieu Herrb
On Sun, Jun 09, 2019 at 04:47:53PM +0200, Matthieu Herrb wrote:
> Hi,
> 
> ssh-askpass(1) is trying to be clever and computes the size of its
> indicator relatively to the screen resolution.
> 
> Unfortunatly, when multiple screens are present, this gets ugly. The
> support for Xinerama correctly computes the dimensions of the window
> to be created, relatively to the screen on which it will appear, but
> the computation of the indicator size is based on the size of the
> whole display, resulting in too small indicators (and too many of them
> if the screens hare layed out horizontally).
> 
> The patch below fixes that by computing the resolution of the whole
> display before taking xinerama into account.
> 
> A better fix would be to make this application really aware of XRandR
> and use the actual screen resolution from XRandR; this is an
> interesting project, if anyone wants to give it a try.
> 
> ok?

ping

> 
> Index: x11-ssh-askpass.c
> ===
> RCS file: /cvs/OpenBSD/xenocara/app/ssh-askpass/x11-ssh-askpass.c,v
> retrieving revision 1.6
> diff -u -p -u -r1.6 x11-ssh-askpass.c
> --- x11-ssh-askpass.c 24 Apr 2015 02:19:41 -  1.6
> +++ x11-ssh-askpass.c 9 Jun 2019 14:32:59 -
> @@ -1507,6 +1507,12 @@ int main(int argc, char **argv)
> app.screen_height = HeightOfScreen(app.screen);
> app.screen_xoffset = 0;
> app.screen_yoffset = 0;
> +
> +   app.xResolution =
> +  app.screen_width * 1000 / WidthMMOfScreen(app.screen);
> +   app.yResolution =
> +  app.screen_height * 1000 / HeightMMOfScreen(app.screen);
> +
> if (XineramaIsActive(app.dpy) &&
>(screens = XineramaQueryScreens(app.dpy, )) != NULL &&
>nscreens) {
> @@ -1516,11 +1522,6 @@ int main(int argc, char **argv)
>app.screen_yoffset = screens[0].y_org;
>XFree(screens);
> }
> -
> -   app.xResolution =
> -  app.screen_width * 1000 / WidthMMOfScreen(app.screen);
> -   app.yResolution =
> -  app.screen_height * 1000 / HeightMMOfScreen(app.screen);
>  
> createDialog();
> createGCs();
> 
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



update: libXcursor 1.2.0

2019-06-10 Thread Matthieu Herrb
Hi,

another update : libXcursor 1.2.0

ok ?

Index: ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXcursor/ChangeLog,v
retrieving revision 1.7
diff -u -p -u -r1.7 ChangeLog
--- ChangeLog   28 Nov 2017 15:46:58 -  1.7
+++ ChangeLog   17 Mar 2019 10:14:20 -
@@ -1,3 +1,52 @@
+commit b84b5d100f193fda0630c4d6fa889cd3e05ca033
+Author: Alan Coopersmith 
+Date:   Sun Mar 10 17:36:26 2019 -0700
+
+libXcursor 1.2.0
+
+Signed-off-by: Alan Coopersmith 
+
+commit 8ff9605921a6ea3e05b5c72aa1b2a7f78b624699
+Author: Alan Coopersmith 
+Date:   Fri Dec 7 19:41:07 2018 -0800
+
+Update configure.ac bug URL for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit 534456082ed051d6427a77e4bda19473ea8b621c
+Author: Alan Coopersmith 
+Date:   Mon Nov 19 21:47:26 2018 -0800
+
+Update README for gitlab migration
+
+Signed-off-by: Alan Coopersmith 
+
+commit 2263c196cb0dcb8547b378df7b35f83b8b99c01e
+Author: Cosimo Cecchi 
+Date:   Fri Nov 9 20:06:41 2018 -0800
+
+Support XDG user data dir location
+
+Nowadays ~/.icons is not used anymore as the preferred location for
+custom user icon themes; XDG_DATA_HOME/icons (aka ~/.local/share/icons)
+is what toolkits like GTK prefer.
+
+Prepend that location to the default xcursor path, so that cursor
+themes installed there can be used by apps and toolkits that use
+libXcursor.
+
+commit f64a8cc1a65dcad4294e2988b402a34175019663
+Author: Philipp Ludwig 
+Date:   Sun Jan 22 14:21:54 2017 +0100
+
+Fix crash when encountering cursor themes with circular dependencies.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=3603
+
+Signed-off-by: Philipp Ludwig 
+Signed-off-by: Alan Coopersmith 
+
 commit 4828abe494df8fb4aa00dcaa22a03446ba418d01
 Author: Matthieu Herrb 
 Date:   Sat Nov 25 11:59:31 2017 +0100
Index: Makefile.am
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXcursor/Makefile.am,v
retrieving revision 1.5
diff -u -p -u -r1.5 Makefile.am
--- Makefile.am 10 Mar 2012 13:53:27 -  1.5
+++ Makefile.am 17 Mar 2019 10:14:20 -
@@ -43,3 +43,5 @@ ChangeLog:
$(CHANGELOG_CMD)
 
 dist-hook: ChangeLog INSTALL
+
+EXTRA_DIST = README.md
Index: Makefile.in
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXcursor/Makefile.in,v
retrieving revision 1.12
diff -u -p -u -r1.12 Makefile.in
--- Makefile.in 28 Nov 2017 15:46:58 -  1.12
+++ Makefile.in 17 Mar 2019 10:15:21 -
@@ -72,7 +72,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/xcursor.pc.in $(top_srcdir)/configure \
$(top_srcdir)/include/X11/Xcursor/Xcursor.h.in AUTHORS COPYING \
@@ -342,6 +342,7 @@ AM_CFLAGS = $(XRENDER_CFLAGS) $(XFIXES_C
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xcursor.pc
 MAINTAINERCLEANFILES = ChangeLog INSTALL
+EXTRA_DIST = README.md
 all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
Index: README
===
RCS file: README
diff -N README
--- README  31 Oct 2009 17:47:06 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,25 +0,0 @@
-libXcursor - X Window System Cursor management library
-
-All questions regarding this software should be directed at the
-Xorg mailing list:
-
-http://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
-https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
-The master development code repository can be found at:
-
-git://anongit.freedesktop.org/git/xorg/lib/libXcursor
-
-http://cgit.freedesktop.org/xorg/lib/libXcursor
-
-For patch submission instructions, see:
-
-   http://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
-http://wiki.x.org/wiki/GitPage
-
Index: README.md
===
RCS file: README.md
diff -N README.md
--- /dev/null   1 Jan 1970 00:00:00 -
+++ README.md   17 Mar 2019 10:14:20 -
@@ -0,0 +1,18 @@
+libXcursor - X Window System Cursor management library
+--
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+  https://lists.x.org/mailman/listinfo/xorg
+
+The master development code repository can be found at:
+
+  https://gitlab.freedesktop.org/xorg/lib/libXcursor
+
+Please submit bug reports and requests to merge patches there.
+
+For patch submission instructions, see:
+
+  https://www.x.org/wiki/Development

update libXdamage 1.1.5

2019-06-10 Thread Matthieu Herrb
d conditionally." "$LINENO" 5
@@ -18186,7 +18191,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libXdamage $as_me 1.1.4, which was
+This file was extended by libXdamage $as_me 1.1.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -18252,7 +18257,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-libXdamage config.status 1.1.4
+libXdamage config.status 1.1.5
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
Index: configure.ac
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdamage/configure.ac,v
retrieving revision 1.4
diff -u -p -u -r1.4 configure.ac
--- configure.ac5 Jan 2013 15:02:20 -   1.4
+++ configure.ac17 Mar 2019 10:18:21 -
@@ -29,14 +29,13 @@ AC_PREREQ([2.60])
 # digit in the version number to track changes which don't affect the
 # protocol, so Xdamage version l.n.m corresponds to protocol version l.n
 #
-AC_INIT(libXdamage, [1.1.4],
+AC_INIT(libXdamage, [1.1.5],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXdamage])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
 
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
 
 # Initialize libtool
 AC_PROG_LIBTOOL
Index: src/Makefile.am
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdamage/src/Makefile.am,v
retrieving revision 1.3
diff -u -p -u -r1.3 Makefile.am
--- src/Makefile.am 5 Jan 2013 15:02:20 -   1.3
+++ src/Makefile.am 17 Mar 2019 10:18:21 -
@@ -5,11 +5,10 @@ libXdamage_la_SOURCES = \
Xdamage.c
 
 libXdamage_la_LIBADD = $(XDAMAGE_LIBS)
-AM_CFLAGS = $(CWARNFLAGS) $(XDAMAGE_CFLAGS)
-
-INCLUDES = -I$(top_srcdir)/include/X11/extensions
-
 libXdamage_la_LDFLAGS = -version-number 1:1:0 -no-undefined
+
+AM_CFLAGS = $(CWARNFLAGS) $(XDAMAGE_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/include/X11/extensions
 
 libXdamageincludedir = $(includedir)/X11/extensions
 libXdamageinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xdamage.h
Index: src/Makefile.in
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdamage/src/Makefile.in,v
retrieving revision 1.8
diff -u -p -u -r1.8 Makefile.in
--- src/Makefile.in 11 Oct 2016 22:15:26 -  1.8
+++ src/Makefile.in 17 Mar 2019 10:18:52 -
@@ -294,9 +294,9 @@ libXdamage_la_SOURCES = \
Xdamage.c
 
 libXdamage_la_LIBADD = $(XDAMAGE_LIBS)
-AM_CFLAGS = $(CWARNFLAGS) $(XDAMAGE_CFLAGS)
-INCLUDES = -I$(top_srcdir)/include/X11/extensions
 libXdamage_la_LDFLAGS = -version-number 1:1:0 -no-undefined
+AM_CFLAGS = $(CWARNFLAGS) $(XDAMAGE_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/include/X11/extensions
 libXdamageincludedir = $(includedir)/X11/extensions
 libXdamageinclude_HEADERS = $(top_srcdir)/include/X11/extensions/Xdamage.h
 all: all-am
Index: src/Xdamage.c
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdamage/src/Xdamage.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 Xdamage.c
--- src/Xdamage.c   5 Jan 2013 15:02:20 -   1.4
+++ src/Xdamage.c   17 Mar 2019 10:18:21 -
@@ -101,7 +101,7 @@ XDamageExtAddDisplay (XDamageExtInfo*ex
 */
XExtCodes *codes = XAddExtension(dpy);
if (!codes) {
-   XFree(info);
+   Xfree(info);
return NULL;
}
 XESetCloseDisplay (dpy, codes->extension, XDamageCloseDisplay);

-- 
Matthieu Herrb



update: libXcomposite 0.45

2019-06-10 Thread Matthieu Herrb
txt conftest.xml >/dev/null 2>&1; then :
   have_xmlto_text=yes
 else
+  # Try it again with a non-empty XML file.
+  cat > conftest.xml << "EOF"
+
+EOF
+  if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; 
then :
+  have_xmlto_text=yes
+else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto cannot generate text 
format, this format skipped" >&5
 $as_echo "$as_me: WARNING: xmlto cannot generate text format, this format 
skipped" >&2;}
 fi
 fi
+fi
 rm -f conftest.xml
  if test $have_xmlto_text = yes; then
   HAVE_XMLTO_TEXT_TRUE=
@@ -18132,10 +18154,6 @@ else
   am__EXEEXT_FALSE=
 fi
 
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; 
then
-  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   as_fn_error $? "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -18557,7 +18575,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libXcomposite $as_me 0.4.4, which was
+This file was extended by libXcomposite $as_me 0.4.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -18617,13 +18635,13 @@ $config_headers
 Configuration commands:
 $config_commands
 
-Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libXcomposite/issues>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-libXcomposite config.status 0.4.4
+libXcomposite config.status 0.4.5
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
Index: configure.ac
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXcomposite/configure.ac,v
retrieving revision 1.6
diff -u -p -u -r1.6 configure.ac
--- configure.ac5 Jan 2013 14:59:39 -   1.6
+++ configure.ac17 Mar 2019 10:10:24 -
@@ -31,14 +31,13 @@ AC_PREREQ([2.60])
 # that 'revision' number appears in Xcomposite.h and has to be manually
 # synchronized.
 #
-AC_INIT(libXcomposite, [0.4.4],
-   [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], 
[libXcomposite])
+AC_INIT(libXcomposite, [0.4.5],
+   [https://gitlab.freedesktop.org/xorg/lib/libXcomposite/issues], 
[libXcomposite])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
 
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
 
 # Initialize libtool
 AC_PROG_LIBTOOL
Index: man/Xcomposite.man
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXcomposite/man/Xcomposite.man,v
retrieving revision 1.3
diff -u -p -u -r1.3 Xcomposite.man
--- man/Xcomposite.man  5 Jan 2013 14:59:39 -   1.3
+++ man/Xcomposite.man  17 Mar 2019 10:10:24 -
@@ -1,7 +1,7 @@
 '\" t
 .\" Title: Xcomposite
 .\"Author: Keith Packard 
-.\" Generator: DocBook XSL Stylesheets vsnapshot_9276 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
 .\"  Date: 23 April 2007
 .\"Manual: X Composite Extension Library
 .\"Source: __vendorversion__
@@ -9,15 +9,6 @@
 .\"
 .TH "XCOMPOSITE" "__libmansuffix__" "23 April 2007" 
"__vendorversion__" "X Composite Extension Library"
 .\" -
-.\" * Define some portability stuff
-.\" -
-.\" ~
-.\" http://bugs.debian.org/507673
-.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
-.\" ~
-.ie \n(.g .ds Aq \(aq
-.el   .ds Aq '
-.\" -
 .\" * set default formatting
 .\" -----
 .\" disable hyphenation
@@ -252,7 +243,7 @@ The X server must support at least versi
 \fBXCompositeReleaseOverlayWindow\fR
 .RS 4
 This request specifies that the client is no longer using the Composite 
Overlay Window on the screen specified by the argument
-\fIwindow\fR\&. A screen\*(Aqs Composite Overlay Window is unmapped when there 
are no longer any clients using it\&.
+\fIwindow\fR\&. A screen\'s Composite Overlay Window is unmapped when there 
are no longer any clients using it\&.
 .sp
 The X server must support at least version 0\&.3 of the Composite Extension for
 \fBXCompositeReleaseOverlayWindow\fR\&.
Index: src/Xcomposite.c
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXcomposite/src/Xcomposite.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 Xcomposite.c
--- src/Xcomposite.c5 Jan 2013 14:59:39 -   1.4
+++ src/Xcomposite.c17 Mar 2019 10:10:24 -
@@ -147,7 +147,7 @@ XCompositeExtAddDisplay (XCompositeExtIn
 */
XExtCodes *codes = XAddExtension(dpy);
if (!codes) {
-   XFree(info);
+   Xfree(info);
return NULL;
}
 XESetCloseDisplay (dpy, codes->extension, XCompositeCloseDisplay);

-- 
Matthieu Herrb



update: libXdmcp 1.1.3

2019-06-09 Thread Matthieu Herrb
 empty XML docbook file and if
+# it fails try it again with a non-empty XML file.
 have_xmlto_text=no
 cat > conftest.xml << "EOF"
 EOF
@@ -18269,10 +18306,18 @@ if test "$have_xmlto" = yes; then :
   if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; then :
   have_xmlto_text=yes
 else
+  # Try it again with a non-empty XML file.
+  cat > conftest.xml << "EOF"
+
+EOF
+  if $XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1; 
then :
+  have_xmlto_text=yes
+else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xmlto cannot generate text 
format, this format skipped" >&5
 $as_echo "$as_me: WARNING: xmlto cannot generate text format, this format 
skipped" >&2;}
 fi
 fi
+fi
 rm -f conftest.xml
  if test $have_xmlto_text = yes; then
   HAVE_XMLTO_TEXT_TRUE=
@@ -18657,6 +18702,52 @@ if test "$ac_res" != no; then :
 fi
 
 
+case $host_os in
+ *mingw*)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in 
-lws2_32" >&5
+$as_echo_n "checking for main in -lws2_32... " >&6; }
+if ${ac_cv_lib_ws2_32_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lws2_32  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ws2_32_main=yes
+else
+  ac_cv_lib_ws2_32_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5
+$as_echo "$ac_cv_lib_ws2_32_main" >&6; }
+if test "x$ac_cv_lib_ws2_32_main" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBWS2_32 1
+_ACEOF
+
+  LIBS="-lws2_32 $LIBS"
+
+fi
+
+;;
+ *)
+;;
+esac
+
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" 
>&5
 $as_echo_n "checking for arc4random_buf in -lbsd... " >&6; }
@@ -18703,7 +18794,7 @@ _ACEOF
 
 fi
 
-for ac_func in srand48 lrand48 arc4random_buf
+for ac_func in srand48 lrand48 arc4random_buf getentropy
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -19633,7 +19724,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libXdmcp $as_me 1.1.2, which was
+This file was extended by libXdmcp $as_me 1.1.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -19699,7 +19790,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-libXdmcp config.status 1.1.2
+libXdmcp config.status 1.1.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
Index: configure.ac
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdmcp/configure.ac,v
retrieving revision 1.6
diff -u -p -u -r1.6 configure.ac
--- configure.ac6 Apr 2015 13:43:53 -   1.6
+++ configure.ac17 Mar 2019 10:21:28 -
@@ -22,7 +22,7 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libXdmcp], [1.1.2],
+AC_INIT([libXdmcp], [1.1.3],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXdmcp])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
@@ -55,9 +55,17 @@ AC_PROG_LN_S
 # Checks for libraries.
 AC_SEARCH_LIBS([recvfrom],[socket])
 
+case $host_os in
+ *mingw*)
+AC_CHECK_LIB([ws2_32],[main])
+;;
+ *)
+;;
+esac
+
 # Checks for library functions.
 AC_CHECK_LIB([bsd], [arc4random_buf])
-AC_CHECK_FUNCS([srand48 lrand48 arc4random_buf])
+AC_CHECK_FUNCS([srand48 lrand48 arc4random_buf getentropy])
 
 # Obtain compiler/linker options for depedencies
 PKG_CHECK_MODULES(XDMCP, xproto)
Index: doc/xdmcp.xml
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXdmcp/doc/xdmcp.xml,v
retrieving revision 1.2
diff -u -p -u -r1.2 xdmcp.xml
--- doc/xdmcp.xml   10 Mar 2012 13:58:12 -  1.2
+++ doc/xdmcp.xml   17 Mar 2019 10:21:28 -
@@ -23,7 +23,7 @@
 
X Display Manager Control Protocol
X.Org Standard
-   X Version 11, Release 
+   X Version 11
Version 1.1



-- 
Matthieu Herrb



libXfont2: disable font server code

2019-06-09 Thread Matthieu Herrb
Hi,

We disabled almost all X font server support code already. The patch
below removes support for connecting to a font server from libXfont2.

It means that you X server will no longer be able to use fonts from a
remote font server. But did you even know this was possible ?

ok? comments?

Index: Makefile.bsd-wrapper
===
RCS file: /cvs/OpenBSD/xenocara/lib/libXfont2/Makefile.bsd-wrapper,v
retrieving revision 1.2
diff -u -r1.2 Makefile.bsd-wrapper
--- Makefile.bsd-wrapper26 May 2018 07:51:00 -  1.2
+++ Makefile.bsd-wrapper9 Jun 2019 17:15:38 -
@@ -3,6 +3,6 @@
 
 SHARED_LIBS=   Xfont2 1.0
 
-CONFIGURE_ARGS+= --with-xmlto=no --disable-devel-docs
+CONFIGURE_ARGS+= --disable-fc --with-xmlto=no --disable-devel-docs
 
 .include 

-- 
Matthieu Herrb



ssh-askpass(1): fix indicator size with multiple screens

2019-06-09 Thread Matthieu Herrb
Hi,

ssh-askpass(1) is trying to be clever and computes the size of its
indicator relatively to the screen resolution.

Unfortunatly, when multiple screens are present, this gets ugly. The
support for Xinerama correctly computes the dimensions of the window
to be created, relatively to the screen on which it will appear, but
the computation of the indicator size is based on the size of the
whole display, resulting in too small indicators (and too many of them
if the screens hare layed out horizontally).

The patch below fixes that by computing the resolution of the whole
display before taking xinerama into account.

A better fix would be to make this application really aware of XRandR
and use the actual screen resolution from XRandR; this is an
interesting project, if anyone wants to give it a try.

ok?

Index: x11-ssh-askpass.c
===
RCS file: /cvs/OpenBSD/xenocara/app/ssh-askpass/x11-ssh-askpass.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 x11-ssh-askpass.c
--- x11-ssh-askpass.c   24 Apr 2015 02:19:41 -  1.6
+++ x11-ssh-askpass.c   9 Jun 2019 14:32:59 -
@@ -1507,6 +1507,12 @@ int main(int argc, char **argv)
app.screen_height = HeightOfScreen(app.screen);
app.screen_xoffset = 0;
app.screen_yoffset = 0;
+
+   app.xResolution =
+  app.screen_width * 1000 / WidthMMOfScreen(app.screen);
+   app.yResolution =
+  app.screen_height * 1000 / HeightMMOfScreen(app.screen);
+
if (XineramaIsActive(app.dpy) &&
   (screens = XineramaQueryScreens(app.dpy, )) != NULL &&
   nscreens) {
@@ -1516,11 +1522,6 @@ int main(int argc, char **argv)
   app.screen_yoffset = screens[0].y_org;
   XFree(screens);
}
-
-   app.xResolution =
-  app.screen_width * 1000 / WidthMMOfScreen(app.screen);
-   app.yResolution =
-  app.screen_height * 1000 / HeightMMOfScreen(app.screen);
 
createDialog();
createGCs();

-- 
Matthieu Herrb



Re: chown first drm render node in xenodm

2019-05-12 Thread Matthieu Herrb
On Sun, May 12, 2019 at 09:08:23PM +1000, Jonathan Gray wrote:
> This makes vulkan work as a normal user without having to change
> ownership of the device by hand.

ok matthieu@
> 
> Index: GiveConsole
> ===
> RCS file: /cvs/xenocara/app/xenodm/config/GiveConsole,v
> retrieving revision 1.2
> diff -u -p -r1.2 GiveConsole
> --- GiveConsole   11 Jul 2018 19:20:40 -  1.2
> +++ GiveConsole   12 May 2019 11:04:05 -
> @@ -11,4 +11,7 @@ chown $USER /dev/console
>  if [ -c /dev/drm0 ]; then
>  chown $USER /dev/drm0
>  fi
> +if [ -c /dev/drmR128 ]; then
> +chown $USER /dev/drmR128
> +fi
>  /usr/X11R6/bin/sessreg -a -l $DISPLAY -u none $USER
> Index: TakeConsole
> ===
> RCS file: /cvs/xenocara/app/xenodm/config/TakeConsole,v
> retrieving revision 1.3
> diff -u -p -r1.3 TakeConsole
> --- TakeConsole   11 Jul 2018 19:20:40 -  1.3
> +++ TakeConsole   12 May 2019 11:04:05 -
> @@ -8,4 +8,7 @@ chmod 622 /dev/console
>  if [ -c /dev/drm0 ]; then
>  chown root /dev/drm0
>  fi
> +if [ -c /dev/drmR128 ]; then
> +    chown root /dev/drmR128
> +fi
>  /usr/X11R6/bin/sessreg -d -l $DISPLAY -u none $USER

-- 
Matthieu Herrb



Re: Removing old video drivers

2019-05-11 Thread Matthieu Herrb
On Mon, Apr 22, 2019 at 06:47:23PM +0200, Matthieu Herrb wrote:
> Hi,
> 
> In xenocara, we still build a number of video drivers for very old
> hardware, that is mostly useless. For AGP, I don't have a working
> motherboard to test the cards I still have.
> I also still have a few PCI cards for some of them, but most of them
> are dead, or don't work as primary display with modern BIOSes.
> 
> And most important, none of these old cards has enough RAM to run any
> kind of modern 16 or 32 bpp X at a decent resolution. (And the xserver
> version 1.20 has dropped support for 24 bits per pixel modes).
> 
> So rather that try to blindly fix the issues with these drivers I'd
> rather remove them. This is the list of candidates for removing.
> 

Here is the patch that implements the proposed removals. I've kept
xf86-video-savage for now, since they made cards with decent amounts
of RAM that are still usable.

ok ?

Index: Makefile
===
RCS file: /cvs/OpenBSD/xenocara/driver/Makefile,v
retrieving revision 1.73
diff -u -r1.73 Makefile
--- Makefile16 Apr 2019 02:06:30 -  1.73
+++ Makefile11 May 2019 07:56:17 -
@@ -44,16 +44,14 @@
 VIDEO_DRV_alpha=
 
 VIDEO_DRV_amd64= \
-   xf86-video-amdgpu xf86-video-apm xf86-video-ark \
+   xf86-video-amdgpu xf86-video-apm \
xf86-video-ast xf86-video-ati \
-   xf86-video-chips xf86-video-cirrus xf86-video-dummy xf86-video-glint \
-   xf86-video-i128 xf86-video-intel xf86-video-mach64 \
-   xf86-video-mga xf86-video-neomagic \
+   xf86-video-cirrus xf86-video-dummy \
+   xf86-video-intel xf86-video-mach64 \
+   xf86-video-mga \
xf86-video-nv xf86-video-openchrome xf86-video-r128 \
-   xf86-video-rendition xf86-video-s3 \
-   xf86-video-s3virge xf86-video-savage xf86-video-siliconmotion \
-   xf86-video-sis xf86-video-tdfx xf86-video-trident \
-   xf86-video-tseng xf86-video-vesa xf86-video-vmware \
+   xf86-video-savage xf86-video-siliconmotion \
+   xf86-video-vesa xf86-video-vmware \
xf86-video-wsfb xf86-video-wsudl
 
 VIDEO_DRV_arm64= \
@@ -68,9 +66,7 @@
 
 VIDEO_DRV_i386= \
${VIDEO_DRV_amd64} \
-   xf86-video-geode \
-   xf86-video-i740 \
-   xf86-video-voodoo
+   xf86-video-geode
 
 VIDEO_DRV_landisk=
 
@@ -89,7 +85,7 @@
 VIDEO_DRV_sgi= xf86-video-wsfb
 
 VIDEO_DRV_sparc64= \
-   xf86-video-ati xf86-video-mach64 xf86-video-r128 xf86-video-glint \
+   xf86-video-ati xf86-video-mach64 xf86-video-r128 \
xf86-video-sunffb \
    xf86-video-wildcatfb xf86-video-wsfb
 

-- 
Matthieu Herrb



Re: ld.so speedup (part 2)

2019-04-28 Thread Matthieu Herrb
On Sun, Apr 28, 2019 at 08:55:16AM +0100, Stuart Henderson wrote:
> > >> > On Sat, Apr 27, 2019 at 09:55:33PM +0800, Nathanael Rensen wrote:
> > >> > > The diff below speeds up ld.so library intialisation where the
> > >>dependency
> > >> > > tree is broad and deep, such as samba's smbd which links over 100
> > >>libraries.
> 
> Past experience with ld.so changes suggests it would be good to have
> test reports from multiple arches, *especially* hppa.

The regress test seem to pass here on hppa.

-- 
Matthieu Herrb



Re: Removing old video drivers

2019-04-23 Thread Matthieu Herrb
On Tue, Apr 23, 2019 at 10:28:18AM +0100, Craig Skinner wrote:
> On Mon, 22 Apr 2019 18:47:23 +0200 Matthieu Herrb wrote:
> > If you're still using a machine with a graphics card supported by one
> > of these, please speak up, otherwise they are going to be removed:
> 
> Is this a valid way to find out Matthieu?

Hi,

Yes, but it doesn't tell you which X.Org driver is beeing used.
If you are actually running X, A better way is to look in
/var/log/Xorg.0.log

Something like that will print the driver name:
awk -F' ' '/[A-Za-z]+\(0\)/ { print $4 }' /var/log/Xorg.0.log | uniq

(Unfortunatly there is no standard way to query the running X server
for the active video driver(s)...)

I'm interested in the full contents of /var/log/Xorg.0.log if you're
willing to share it. 

> 
> 
> $ grep -i -e vga -e video /var/run/dmesg.boot
> vga1 at pci1 dev 1 function 0 "S3 Trio3D AGP" rev 0x01
> wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)

This is probably using the s3virge driver, which is on the list of
driver that have issues with the next X server version.

> 
> 
> 
> $ grep -i -e vga -e video /var/run/dmesg.boot
> acpivideo0 at acpi0: IGD0
> acpivout0 at acpivideo0: DD01
> vga1 at pci0 dev 2 function 0 "Intel Pineview Video" rev 0x00
> intagp0 at vga1
> inteldrm0 at vga1
> wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
> "Intel Pineview Video" rev 0x00 at pci0 dev 2 function 1 not configured
> uvideo0 at uhub0 port 8 configuration 1 interface 0 "Chicony Corp. Lenovo 
> EasyCamera" rev 2.00/45.42 addr 3
> video0 at uvideo0

This is an intel chipset supported by the current DRM driver. It's not
going away anytime soon.

-- 
Matthieu Herrb



Removing old video drivers

2019-04-22 Thread Matthieu Herrb
Hi,

In xenocara, we still build a number of video drivers for very old
hardware, that is mostly useless. For AGP, I don't have a working
motherboard to test the cards I still have.
I also still have a few PCI cards for some of them, but most of them
are dead, or don't work as primary display with modern BIOSes.

And most important, none of these old cards has enough RAM to run any
kind of modern 16 or 32 bpp X at a decent resolution. (And the xserver
version 1.20 has dropped support for 24 bits per pixel modes).

So rather that try to blindly fix the issues with these drivers I'd
rather remove them. This is the list of candidates for removing.

If you're still using a machine with a graphics card supported by one
of these, please speak up, otherwise they are going to be removed:

xf86-video-ark
xf86-video-chips
xf86-video-glint
xf86-video-i128
xf86-video-i740
xf86-video-neomagic
xf86-video-rendition
xf86-video-s3
xf86-video-s3virge
xf86-video-savage
xf86-video-sis
xf86-video-tdfx
xf86-video-trident
xf86-video-tseng
xf86-video-voodoo

For now, we would keep the following non drm/kms drivers:

xf86-video-ast
xf86-video-cirrus
xf86-video-dummy
xf86-video-mach64
xf86-video-mga
xf86-video-nv
xf86-video-openchrome
xf86-video-r128
xf86-video-siliconmotion
xf86-video-vesa
xf86-video-vmware
xf86-video-wsfb
xf86-video-wsudl

and on i386 only:

xf86-video-geode

--
Matthieu Herrb



Re: xenocara: unlink libFS from the build

2019-04-22 Thread Matthieu Herrb
On Thu, Mar 14, 2019 at 09:31:59PM +0100, Matthieu Herrb wrote:
> Hi,
> 
> all tools dealing with X font server have been already removed, and
> don't seem to be missed since no one asked to re-add them in ports.
> 
> Now, libFS, the font server client library can be removed.
> I've checked in sqlports and with a bulk build on amd64 that nothing
> in ports in depending on it either.
> 
> ok ?

Ping ?

> 
> Index: lib/Makefile
> ===
> RCS file: /cvs/OpenBSD/xenocara/lib/Makefile,v
> retrieving revision 1.41
> diff -u -p -u -r1.41 Makefile
> --- lib/Makefile  11 Sep 2018 19:34:56 -  1.41
> +++ lib/Makefile  14 Mar 2019 20:25:08 -
> @@ -37,7 +37,7 @@ XCB_LIBS= \
>  
>  SUBDIR= freetype fontconfig libxtrans libXau libXdmcp ${XCB_LIBS}\
>   libX11  libXext  libXrender libXft libdmx libfontenc \
> - libFS libICE libSM libXt \
> + libICE libSM libXt \
>   libXmu libXpm libXaw libXfixes libXcomposite \
>   libXdamage libXcursor libXfont2  \
>   libXi libXinerama libxkbfile libxkbui \
> Index: distrib/sets/lists/xbase/mi
> ===
> RCS file: /cvs/OpenBSD/xenocara/distrib/sets/lists/xbase/mi,v
> retrieving revision 1.118
> diff -u -p -u -r1.118 mi
> --- distrib/sets/lists/xbase/mi   19 Jan 2019 13:38:38 -  1.118
> +++ distrib/sets/lists/xbase/mi   14 Mar 2019 20:25:09 -
> @@ -206,9 +206,6 @@
>  ./usr/X11R6/lib/X11/fvwm/system.fvwm2rc-sample-1
>  ./usr/X11R6/lib/X11/fvwm/system.fvwm2rc-sample-2
>  ./usr/X11R6/lib/X11/xman.help
> -./usr/X11R6/lib/libFS.a
> -./usr/X11R6/lib/libFS.la
> -./usr/X11R6/lib/libFS.so.10.0
>  ./usr/X11R6/lib/libICE.a
>  ./usr/X11R6/lib/libICE.la
>  ./usr/X11R6/lib/libICE.so.10.0
> Index: distrib/sets/lists/xshare/mi
> ===
> RCS file: /cvs/OpenBSD/xenocara/distrib/sets/lists/xshare/mi,v
> retrieving revision 1.154
> diff -u -p -u -r1.154 mi
> --- distrib/sets/lists/xshare/mi  10 Feb 2019 23:08:36 -  1.154
> +++ distrib/sets/lists/xshare/mi  14 Mar 2019 20:25:09 -
> @@ -423,7 +423,6 @@
>  ./usr/X11R6/include/X11/extensions/xtestproto.h
>  ./usr/X11R6/include/X11/fonts
>  ./usr/X11R6/include/X11/fonts/FS.h
> -./usr/X11R6/include/X11/fonts/FSlib.h
>  ./usr/X11R6/include/X11/fonts/FSproto.h
>  ./usr/X11R6/include/X11/fonts/font.h
>  ./usr/X11R6/include/X11/fonts/fontenc.h
> @@ -713,7 +712,6 @@
>  ./usr/X11R6/lib/pkgconfig/ice.pc
>  ./usr/X11R6/lib/pkgconfig/inputproto.pc
>  ./usr/X11R6/lib/pkgconfig/kbproto.pc
> -./usr/X11R6/lib/pkgconfig/libfs.pc
>  ./usr/X11R6/lib/pkgconfig/pciaccess.pc
>  ./usr/X11R6/lib/pkgconfig/randrproto.pc
>  ./usr/X11R6/lib/pkgconfig/recordproto.pc
> @@ -3798,8 +3796,6 @@
>  ./usr/X11R6/share/doc/kbproto/ch15.xml
>  ./usr/X11R6/share/doc/kbproto/ch16.xml
>  ./usr/X11R6/share/doc/kbproto/xkbproto.xml
> -./usr/X11R6/share/doc/libFS
> -./usr/X11R6/share/doc/libFS/FSlib.txt
>  ./usr/X11R6/share/doc/libICE
>  ./usr/X11R6/share/doc/libICE/ICElib.xml
>  ./usr/X11R6/share/doc/libICE/ice.xml
> 
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



update pixman to 0.38.4

2019-04-15 Thread Matthieu Herrb
Hi,

the diff below updates pixman to 0.38.4.

Since upstream is too lazy to provide a ChangeLog, here are the main
changes from 0.36, picked up from their git log:

- Implement floating point gradient computation,
- Use maximum precision for pixman-bits-image

As always with pixman, the shared lib version bump is aggressive to
be always greater or equal to the version produced by building the
upstreams tarball, to make developpers life easier.

ok?

Index: Makefile.am
===
RCS file: /cvs/OpenBSD/xenocara/lib/pixman/Makefile.am,v
retrieving revision 1.9
diff -u -r1.9 Makefile.am
--- Makefile.am 18 Jan 2019 14:34:01 -  1.9
+++ Makefile.am 15 Apr 2019 19:35:36 -
@@ -15,15 +15,20 @@
 RELEASE_OR_SNAPSHOT = $$(if test "x$(PIXMAN_VERSION_MINOR)" = "x$$(echo 
"$(PIXMAN_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; 
fi)
 RELEASE_CAIRO_HOST =   $(USERNAME)@cairographics.org
 RELEASE_CAIRO_DIR =/srv/cairo.freedesktop.org/www/$(RELEASE_OR_SNAPSHOT)s
-RELEASE_CAIRO_URL =http://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
-RELEASE_XORG_URL = http://xorg.freedesktop.org/archive/individual/lib
+RELEASE_CAIRO_URL =https://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
+RELEASE_XORG_URL = https://www.x.org/releases/individual/lib
 RELEASE_XORG_HOST =$(USERNAME)@xorg.freedesktop.org
 RELEASE_XORG_DIR = /srv/xorg.freedesktop.org/archive/individual/lib
 RELEASE_ANNOUNCE_LIST = cairo-annou...@cairographics.org, 
xorg-annou...@lists.freedesktop.org, pix...@lists.freedesktop.org
 
 EXTRA_DIST =   \
Makefile.win32  \
-   Makefile.win32.common
+   Makefile.win32.common   \
+   meson.build \
+   meson_options.txt   \
+   neon-test.S \
+   arm-simd-test.S \
+   $(NULL)
 
 tar_gz = $(PACKAGE)-$(VERSION).tar.gz
 tar_bz2 = $(PACKAGE)-$(VERSION).tar.bz2
Index: Makefile.bsd-wrapper
===
RCS file: /cvs/OpenBSD/xenocara/lib/pixman/Makefile.bsd-wrapper,v
retrieving revision 1.24
diff -u -r1.24 Makefile.bsd-wrapper
--- Makefile.bsd-wrapper18 Jan 2019 14:34:01 -  1.24
+++ Makefile.bsd-wrapper15 Apr 2019 19:35:36 -
@@ -2,7 +2,7 @@
 
 .include 
 
-SHARED_LIBS=   pixman-1 36.0
+SHARED_LIBS=   pixman-1 38.4
 
 .if ${MACHINE_ARCH} == arm
 CONFIGURE_ARGS +=  --disable-arm-simd --disable-arm-neon
Index: Makefile.in
===
RCS file: /cvs/OpenBSD/xenocara/lib/pixman/Makefile.in,v
retrieving revision 1.18
diff -u -r1.18 Makefile.in
--- Makefile.in 18 Jan 2019 14:34:01 -  1.18
+++ Makefile.in 15 Apr 2019 19:35:36 -
@@ -329,14 +329,19 @@
 RELEASE_OR_SNAPSHOT = $$(if test "x$(PIXMAN_VERSION_MINOR)" = "x$$(echo 
"$(PIXMAN_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; 
fi)
 RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org
 RELEASE_CAIRO_DIR = /srv/cairo.freedesktop.org/www/$(RELEASE_OR_SNAPSHOT)s
-RELEASE_CAIRO_URL = http://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
-RELEASE_XORG_URL = http://xorg.freedesktop.org/archive/individual/lib
+RELEASE_CAIRO_URL = https://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
+RELEASE_XORG_URL = https://www.x.org/releases/individual/lib
 RELEASE_XORG_HOST = $(USERNAME)@xorg.freedesktop.org
 RELEASE_XORG_DIR = /srv/xorg.freedesktop.org/archive/individual/lib
 RELEASE_ANNOUNCE_LIST = cairo-annou...@cairographics.org, 
xorg-annou...@lists.freedesktop.org, pix...@lists.freedesktop.org
 EXTRA_DIST = \
Makefile.win32  \
-   Makefile.win32.common
+   Makefile.win32.common   \
+   meson.build \
+   meson_options.txt   \
+   neon-test.S \
+   arm-simd-test.S \
+   $(NULL)
 
 tar_gz = $(PACKAGE)-$(VERSION).tar.gz
 tar_bz2 = $(PACKAGE)-$(VERSION).tar.bz2
Index: aclocal.m4
===
RCS file: /cvs/OpenBSD/xenocara/lib/pixman/aclocal.m4,v
retrieving revision 1.12
diff -u -r1.12 aclocal.m4
--- aclocal.m4  11 Oct 2016 22:15:49 -  1.12
+++ aclocal.m4  15 Apr 2019 19:35:36 -
@@ -8606,32 +8606,63 @@
 m4_ifndef([_LT_PROG_FC],   [AC_DEFUN([_LT_PROG_FC])])
 m4_ifndef([_LT_PROG_CXX],  [AC_DEFUN([_LT_PROG_CXX])])
 
-# pkg.m4 - Macros to locate and utilise pkg-config.-*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-# 
-# Copyright © 2004 Scott James Remnant .
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be 

Re: Question about xenodm Xresources config default

2019-04-15 Thread Matthieu Herrb
On Mon, Apr 15, 2019 at 09:03:54PM +0200, Hiltjo Posthuma wrote:
> Hi,
> 
> I noticed in the default config file /etc/X11/xenodm/Xresources
> there is a rule:
> 
> xlogin*login.translations: #override \
> CtrlR: abort-display()\n\
> [...]
> 
> The xenodm(1) man page says:
> "
>   abort-display
>   Terminates the server, disabling it.  This action is not
>   accessible in the default configuration.  There are
>   various reasons to stop xenodm on a system console, such
>   as when shutting the system down, when using xdmshell(1),
>   to start another type of server, or to generally access
>   the console.  Sending xenodm a SIGHUP will restart the
>   display.  See the section CONTROLLING XENODM.
> "
> 
> I think the man page means the action is not accessible in the default
> configuration if there is no Xresources file present.
> 
> Currently in the default configuration a user can kill the xenodm service by
> pressing Ctrl-R. The user usually cannot restart the daemon themself (no
> privileges).
> 
> 
> Is this intended?

Not really. This has all been copied from xdm and never seriously
revisited. I think the best thing to do is to remove the resource to
match what the man page says.

And in the man page, the reference to xdmshell should be removed.

Ok for the patch below ?

Index: config/Xresources.in
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/config/Xresources.in,v
retrieving revision 1.1
diff -u -r1.1 Xresources.in
--- config/Xresources.in26 Jul 2017 21:14:54 -  1.1
+++ config/Xresources.in15 Apr 2019 19:10:51 -
@@ -9,7 +9,6 @@
 
 
 xlogin*login.translations: #override \
-   CtrlR: abort-display()\n\
F1: set-session-argument(failsafe) finish-field()\n\
Left: move-backward-character()\n\
Right: move-forward-character()\n\
Index: man/xenodm.man
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/man/xenodm.man,v
retrieving revision 1.9
diff -u -r1.9 xenodm.man
--- man/xenodm.man  11 Jul 2018 16:28:54 -  1.9
+++ man/xenodm.man  15 Apr 2019 19:10:51 -
@@ -683,7 +683,6 @@
 it usually contains parameters for that widget:
 .Bd -literal -offset Ds
 xlogin*login.translations: #override\e
-   CtrlR: abort-display()\en\e
F1: set-session-argument(failsafe) finish-field()\en\e
Return: set-session-argument() finish-field()
 xlogin*borderWidth: 3
@@ -975,9 +974,8 @@
 This action is not accessible in the default configuration.
 There are various reasons to stop
 .Nm
-on a system console, such as when shutting the system down, when using
-.Xr xdmshell 1 ,
-to start another type of server, or to generally access the console.
+on a system console, such as when shutting the system down,
+or to generally access the console.
 Sending
 .Nm
 a

-- 
Matthieu Herrb



update xf86-video-ati to version 19.0.1

2019-03-19 Thread Matthieu Herrb
>num_props; i++) {
drmModeFreeProperty(drmmode_output->props[i].mode_prop);
free(drmmode_output->props[i].atoms);
Index: src/drmmode_display.h
===
RCS file: /cvs/xenocara/driver/xf86-video-ati/src/drmmode_display.h,v
retrieving revision 1.13
diff -u -p -u -r1.13 drmmode_display.h
--- src/drmmode_display.h   8 Mar 2019 21:59:56 -   1.13
+++ src/drmmode_display.h   19 Mar 2019 22:01:54 -
@@ -142,6 +142,9 @@ typedef struct {
 drmModeConnectorPtr mode_output;
 drmModeEncoderPtr *mode_encoders;
 drmModePropertyBlobPtr edid_blob;
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0)
+drmModePropertyBlobPtr tile_blob;
+#endif
 int dpms_enum_id;
 int num_props;
 drmmode_prop_ptr props;
Index: src/radeon_glamor.c
===
RCS file: /cvs/xenocara/driver/xf86-video-ati/src/radeon_glamor.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 radeon_glamor.c
--- src/radeon_glamor.c 8 Mar 2019 21:59:57 -   1.10
+++ src/radeon_glamor.c 19 Mar 2019 22:01:54 -
@@ -238,7 +238,7 @@ radeon_glamor_create_pixmap(ScreenPtr sc
if (info->shadow_primary) {
if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP)
        return fbCreatePixmap(screen, w, h, depth, 
usage);
-   } else if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) {
+   } else {
pixmap = glamor_create_pixmap(screen, w, h, depth, 
usage);
if (pixmap)
return pixmap;

-- 
Matthieu Herrb



xenocara: unlink libFS from the build

2019-03-14 Thread Matthieu Herrb
Hi,

all tools dealing with X font server have been already removed, and
don't seem to be missed since no one asked to re-add them in ports.

Now, libFS, the font server client library can be removed.
I've checked in sqlports and with a bulk build on amd64 that nothing
in ports in depending on it either.

ok ?

Index: lib/Makefile
===
RCS file: /cvs/OpenBSD/xenocara/lib/Makefile,v
retrieving revision 1.41
diff -u -p -u -r1.41 Makefile
--- lib/Makefile11 Sep 2018 19:34:56 -  1.41
+++ lib/Makefile14 Mar 2019 20:25:08 -
@@ -37,7 +37,7 @@ XCB_LIBS= \
 
 SUBDIR= freetype fontconfig libxtrans libXau libXdmcp ${XCB_LIBS}\
libX11  libXext  libXrender libXft libdmx libfontenc \
-   libFS libICE libSM libXt \
+   libICE libSM libXt \
libXmu libXpm libXaw libXfixes libXcomposite \
libXdamage libXcursor libXfont2  \
libXi libXinerama libxkbfile libxkbui \
Index: distrib/sets/lists/xbase/mi
===
RCS file: /cvs/OpenBSD/xenocara/distrib/sets/lists/xbase/mi,v
retrieving revision 1.118
diff -u -p -u -r1.118 mi
--- distrib/sets/lists/xbase/mi 19 Jan 2019 13:38:38 -  1.118
+++ distrib/sets/lists/xbase/mi 14 Mar 2019 20:25:09 -
@@ -206,9 +206,6 @@
 ./usr/X11R6/lib/X11/fvwm/system.fvwm2rc-sample-1
 ./usr/X11R6/lib/X11/fvwm/system.fvwm2rc-sample-2
 ./usr/X11R6/lib/X11/xman.help
-./usr/X11R6/lib/libFS.a
-./usr/X11R6/lib/libFS.la
-./usr/X11R6/lib/libFS.so.10.0
 ./usr/X11R6/lib/libICE.a
 ./usr/X11R6/lib/libICE.la
 ./usr/X11R6/lib/libICE.so.10.0
Index: distrib/sets/lists/xshare/mi
===
RCS file: /cvs/OpenBSD/xenocara/distrib/sets/lists/xshare/mi,v
retrieving revision 1.154
diff -u -p -u -r1.154 mi
--- distrib/sets/lists/xshare/mi10 Feb 2019 23:08:36 -  1.154
+++ distrib/sets/lists/xshare/mi14 Mar 2019 20:25:09 -
@@ -423,7 +423,6 @@
 ./usr/X11R6/include/X11/extensions/xtestproto.h
 ./usr/X11R6/include/X11/fonts
 ./usr/X11R6/include/X11/fonts/FS.h
-./usr/X11R6/include/X11/fonts/FSlib.h
 ./usr/X11R6/include/X11/fonts/FSproto.h
 ./usr/X11R6/include/X11/fonts/font.h
 ./usr/X11R6/include/X11/fonts/fontenc.h
@@ -713,7 +712,6 @@
 ./usr/X11R6/lib/pkgconfig/ice.pc
 ./usr/X11R6/lib/pkgconfig/inputproto.pc
 ./usr/X11R6/lib/pkgconfig/kbproto.pc
-./usr/X11R6/lib/pkgconfig/libfs.pc
 ./usr/X11R6/lib/pkgconfig/pciaccess.pc
 ./usr/X11R6/lib/pkgconfig/randrproto.pc
 ./usr/X11R6/lib/pkgconfig/recordproto.pc
@@ -3798,8 +3796,6 @@
 ./usr/X11R6/share/doc/kbproto/ch15.xml
 ./usr/X11R6/share/doc/kbproto/ch16.xml
 ./usr/X11R6/share/doc/kbproto/xkbproto.xml
-./usr/X11R6/share/doc/libFS
-./usr/X11R6/share/doc/libFS/FSlib.txt
 ./usr/X11R6/share/doc/libICE
 ./usr/X11R6/share/doc/libICE/ICElib.xml
 ./usr/X11R6/share/doc/libICE/ice.xml

-- 
Matthieu Herrb



Re: Update openchrome to 0.6.182 in Xenocara

2019-03-12 Thread Matthieu Herrb
On Tue, Mar 12, 2019 at 11:28:30AM +0100, Frederic Cambus wrote:
> Hi tech@,
> 
> Here is a diff to update openchrome to 0.6.182 in Xenocara.
> 
> Tested on my VX900 system.
> 
> Comments? OK?

Looks ok, but I can't test it, as I don't have via hardware anymore.

One small nit: please remove $Id$ from the Makefile.am files (and
regenerate the Makefile.in), and sed the diff upstreams.

> 
> Index: driver/xf86-video-openchrome/Makefile.in
> ===
> RCS file: /cvs/xenocara/driver/xf86-video-openchrome/Makefile.in,v
> retrieving revision 1.10
> diff -u -p -r1.10 Makefile.in
> --- driver/xf86-video-openchrome/Makefile.in  9 Dec 2018 21:07:33 -   
> 1.10
> +++ driver/xf86-video-openchrome/Makefile.in  11 Mar 2019 22:46:14 -
> @@ -73,7 +73,7 @@ subdir = .
>  DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
>   $(srcdir)/Makefile.in $(srcdir)/config.h.in \
>   $(top_srcdir)/configure COPYING ChangeLog NEWS config.guess \
> - config.sub install-sh ltmain.sh missing
> + config.sub depcomp install-sh ltmain.sh missing
>  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
>  am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
>   $(top_srcdir)/configure.ac
> Index: driver/xf86-video-openchrome/aclocal.m4
> ===
> RCS file: /cvs/xenocara/driver/xf86-video-openchrome/aclocal.m4,v
> retrieving revision 1.9
> diff -u -p -r1.9 aclocal.m4
> --- driver/xf86-video-openchrome/aclocal.m4   9 Dec 2018 21:07:33 -   
> 1.9
> +++ driver/xf86-video-openchrome/aclocal.m4   11 Mar 2019 22:46:14 -
> @@ -8606,32 +8606,63 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_L
>  m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
>  m4_ifndef([_LT_PROG_CXX],[AC_DEFUN([_LT_PROG_CXX])])
>  
> -# pkg.m4 - Macros to locate and utilise pkg-config.-*- Autoconf 
> -*-
> -# serial 1 (pkg-config-0.24)
> -# 
> -# Copyright © 2004 Scott James Remnant .
> -#
> -# This program is free software; you can redistribute it and/or modify
> -# it under the terms of the GNU General Public License as published by
> -# the Free Software Foundation; either version 2 of the License, or
> -# (at your option) any later version.
> -#
> -# This program is distributed in the hope that it will be useful, but
> -# WITHOUT ANY WARRANTY; without even the implied warranty of
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -# General Public License for more details.
> -#
> -# You should have received a copy of the GNU General Public License
> -# along with this program; if not, write to the Free Software
> -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> -#
> -# As a special exception to the GNU General Public License, if you
> -# distribute this file as part of a program that contains a
> -# configuration script generated by Autoconf, you may include it under
> -# the same distribution terms that you use for the rest of that program.
> -
> -# PKG_PROG_PKG_CONFIG([MIN-VERSION])
> -# --
> +dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
> +dnl serial 11 (pkg-config-0.29.1)
> +dnl
> +dnl Copyright © 2004 Scott James Remnant .
> +dnl Copyright © 2012-2015 Dan Nicholson 
> +dnl
> +dnl This program is free software; you can redistribute it and/or modify
> +dnl it under the terms of the GNU General Public License as published by
> +dnl the Free Software Foundation; either version 2 of the License, or
> +dnl (at your option) any later version.
> +dnl
> +dnl This program is distributed in the hope that it will be useful, but
> +dnl WITHOUT ANY WARRANTY; without even the implied warranty of
> +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +dnl General Public License for more details.
> +dnl
> +dnl You should have received a copy of the GNU General Public License
> +dnl along with this program; if not, write to the Free Software
> +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
> +dnl 02111-1307, USA.
> +dnl
> +dnl As a special exception to the GNU General Public License, if you
> +dnl distribute this file as part of a program that contains a
> +dnl configuration script generated by Autoconf, you may include it under
> +dnl the same distribution terms that you use for the rest of that
> +dnl program.
> +
> +dnl PKG_PREREQ(MIN-VERSION)
> +dnl ---
> +dnl Since: 0.29
> +dnl
> +dnl Verify that the version of the pkg-config macros are at least
> +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
> +dnl installed version of pkg-config, this checks the developer's version
> +dnl of pkg.m4 when generating configure.
> +dnl
> +dnl To ensure that this macro is defined, also add:
> +dnl m4_ifndef([PKG_PREREQ],
> +dnl [m4_fatal([must install pkg-config 0.29 or later before running 
> 

Re: xterm and wcwidth()

2019-03-08 Thread Matthieu Herrb
On Fri, Mar 08, 2019 at 02:39:32PM +0100, Ingo Schwarze wrote:
> Hi,
> 
> Lauri Tirkkonen wrote on Fri, Mar 08, 2019 at 12:43:11PM +0200:
> 
> > I feel like xterm should just use the system wcwidth() to avoid these
> > mismatches, so rudimentary diff to do that below.
> 
> Absolutely, i strongly agree with that sentiment.
> 
> Having a local character width table in an application program is
> just wrong.  Archaic operating systems like Oracle Solaris 11 that
> have broken wcwidth(3) implementations should either fix their C
> library or go to hell.
> 
> I also agree with the details of the diff.  It is minimal in so far
> as it changes only one file, keeping the annoyance minimal when merging
> new xterm releases.  The function systemWcwidthOk() is horrific
> enough that deleting it outright makes sense, to make sure that it
> can never get called by accident.
> 
> Note that the command line options -cjk_width and -mk_width and the
> related resources remain broken.  But i'd say people using them get
> what they deserve.  The disruption to updates that would be caused
> by excising them from multiple files is probably better avoided.
> 
> Unchanged diff left in place below for easy reference.
> 
> OK to commit?

hi,

I would prefer a diff that just add a &&!defined(__OpenBSD__) to the
condition before the definition of systemWcwidthOk(). This will cause
less risk of conflicts in future updates and clearly show the
intention.

but either way ok matthieu@

>   Ingo
> 
> 
> diff --git a/app/xterm/util.c b/app/xterm/util.c
> index a3de4a005..9b6443683 100644
> --- a/app/xterm/util.c
> +++ b/app/xterm/util.c
> @@ -4980,61 +4980,6 @@ decode_keyboard_type(XtermWidget xw, XTERM_RESOURCE * 
> rp)
>  }
>  
>  #if OPT_WIDE_CHARS
> -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCWIDTH)
> -/*
> - * If xterm is running in a UTF-8 locale, it is still possible to encounter
> - * old runtime configurations which yield incomplete or inaccurate data.
> - */
> -static Bool
> -systemWcwidthOk(int samplesize, int samplepass)
> -{
> -wchar_t n;
> -int oops = 0;
> -
> -for (n = 21; n <= 25; ++n) {
> - wchar_t code = (wchar_t) dec2ucs(NULL, (unsigned) n);
> - int system_code = wcwidth(code);
> - int intern_code = mk_wcwidth(code);
> -
> - /*
> -  * Solaris 10 wcwidth() returns "2" for all of the line-drawing (page
> -  * 0x2500) and most of the geometric shapes (a few are excluded, just
> -  * to make it more difficult to use).  Do a sanity check to avoid using
> -  * it.
> -  */
> - if ((system_code < 0 && intern_code >= 1)
> - || (system_code >= 0 && intern_code != system_code)) {
> - TRACE(("systemWcwidthOk: broken system line-drawing wcwidth\n"));
> - oops += (samplepass + 1);
> - break;
> - }
> -}
> -
> -for (n = 0; n < (wchar_t) samplesize; ++n) {
> - int system_code = wcwidth(n);
> - int intern_code = mk_wcwidth(n);
> -
> - /*
> -  * When this check was originally implemented, there were few if any
> -  * libraries with full Unicode coverage.  Time passes, and it is
> -  * possible to make a full comparison of the BMP.  There are some
> -  * differences: mk_wcwidth() marks some codes as combining and some
> -  * as single-width, differing from GNU libc.
> -  */
> - if ((system_code < 0 && intern_code >= 1)
> - || (system_code >= 0 && intern_code != system_code)) {
> - TRACE((".. width(U+%04X) = %d, expected %d\n",
> -(unsigned) n, system_code, intern_code));
> - if (++oops > samplepass)
> - break;
> - }
> -}
> -TRACE(("systemWcwidthOk: %d/%d mismatches, allowed %d\n",
> -oops, (int) n, samplepass));
> -return (oops <= samplepass);
> -}
> -#endif /* HAVE_WCWIDTH */
> -
>  void
>  decode_wcwidth(XtermWidget xw)
>  {
> @@ -5045,8 +4990,7 @@ decode_wcwidth(XtermWidget xw)
>  switch (mode) {
>  default:
>  #if defined(HAVE_WCHAR_H) && defined(HAVE_WCWIDTH)
> - if (xtermEnvUTF8() &&
> - systemWcwidthOk(xw->misc.mk_samplesize, xw->misc.mk_samplepass)) {
> + if (xtermEnvUTF8()) {
>   my_wcwidth = wcwidth;
>   TRACE(("using system wcwidth() function\n"));
>   break;

-- 
Matthieu Herrb



Re: radeon driver argb cursor fixes (was Re: X segmentation fault by chromium)

2019-03-08 Thread Matthieu Herrb
On Fri, Mar 08, 2019 at 10:09:55AM +1100, Jonathan Gray wrote:
> On Tue, Mar 05, 2019 at 10:24:10PM +0100, Matthieu Herrb wrote:
> > On Mon, Mar 04, 2019 at 09:14:45AM +0100, Matthieu Herrb wrote:
> > > On Sat, Mar 02, 2019 at 10:24:22PM +0200, Mihai Popescu wrote:
> > > > Hello,
> > > > 
> > > > I am able to generate a segmentation fault on X with chromium help.
> > > > This is happening each time I visit the web page at [1]. Basically,
> > > > there is a picture of a product and whenever I hover the mouse over
> > > > it, X gets a segmentation fault and exits at xenodm login prompt.
> > > > Sometimes, if I repeat this procedure over and over, I get an offset
> > > > for the image on my display, making things hard to see.
> > > > 
> > > > [1] 
> > > > https://computers.woot.com/offers/lenovo-thinkcentre-m78-amd-a4-sff-desktop-1
> > > > 
> > > > I have inspected the web page in question with firefox, and I can tell
> > > > the page loads a special image cursor when I hover on the picture in
> > > > question. No segmentation fault for X this time.
> > > > 
> > > 
> > > Hi,
> > > 
> > > Thanks for the bug report. Can you try the attached patch (from
> > > upstream) ?
> > 
> > The patch below is in the most recent snapshots and Mihai reported that it
> > fixes the issue for him. So if you're using the ati/radeon driver
> > please test (and pay attention to possible cursor corruption...)
> > 
> > The relevant upstream commits are:
> > https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati/commit/0c40a76d1c050d018e6d59bebb5efc9c62be308c
> > 
> > Detect and fix up non-premultiplied cursor data
> > 
> > and
> > https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati/commit/99ac121770da53196124d80375a5c8edbcf827fa
> > 
> > Skip gamma correction of cursor data if premultiplied R/G/B > alpha
> > 
> > ok ?
> 
> As xf86-video-ati 19.0.0 recently released
> https://lists.x.org/archives/xorg-announce/2019-March/002967.html
> 
> I'd prefer if we just went to that which includes the commits.

Yes sure. I couldn't predict that 19.0.0 would be released the next
day :)

I've the same diff as you. so ok matthieu@
-- 
Matthieu Herrb



radeon driver argb cursor fixes (was Re: X segmentation fault by chromium)

2019-03-05 Thread Matthieu Herrb
On Mon, Mar 04, 2019 at 09:14:45AM +0100, Matthieu Herrb wrote:
> On Sat, Mar 02, 2019 at 10:24:22PM +0200, Mihai Popescu wrote:
> > Hello,
> > 
> > I am able to generate a segmentation fault on X with chromium help.
> > This is happening each time I visit the web page at [1]. Basically,
> > there is a picture of a product and whenever I hover the mouse over
> > it, X gets a segmentation fault and exits at xenodm login prompt.
> > Sometimes, if I repeat this procedure over and over, I get an offset
> > for the image on my display, making things hard to see.
> > 
> > [1] 
> > https://computers.woot.com/offers/lenovo-thinkcentre-m78-amd-a4-sff-desktop-1
> > 
> > I have inspected the web page in question with firefox, and I can tell
> > the page loads a special image cursor when I hover on the picture in
> > question. No segmentation fault for X this time.
> > 
> 
> Hi,
> 
> Thanks for the bug report. Can you try the attached patch (from
> upstream) ?

The patch below is in the most recent snapshots and Mihai reported that it
fixes the issue for him. So if you're using the ati/radeon driver
please test (and pay attention to possible cursor corruption...)

The relevant upstream commits are:
https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati/commit/0c40a76d1c050d018e6d59bebb5efc9c62be308c

Detect and fix up non-premultiplied cursor data

and
https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati/commit/99ac121770da53196124d80375a5c8edbcf827fa

Skip gamma correction of cursor data if premultiplied R/G/B > alpha

ok ?

Index: src/drmmode_display.c
===
RCS file: /cvs/OpenBSD/xenocara/driver/xf86-video-ati/src/drmmode_display.c,v
retrieving revision 1.18
diff -u -p -u -r1.18 drmmode_display.c
--- src/drmmode_display.c   13 Jan 2019 07:16:48 -  1.18
+++ src/drmmode_display.c   4 Mar 2019 08:12:30 -
@@ -1038,29 +1038,62 @@ drmmode_cursor_src_offset(Rotation rotat
 
 #endif
 
-static uint32_t
-drmmode_cursor_gamma(xf86CrtcPtr crtc, uint32_t argb)
+static Bool
+drmmode_cursor_pixel(xf86CrtcPtr crtc, uint32_t *argb, Bool *premultiplied,
+Bool *apply_gamma)
 {
-   uint32_t alpha = argb >> 24;
+   uint32_t alpha = *argb >> 24;
uint32_t rgb[3];
int i;
 
-   if (!alpha)
-   return 0;
+   if (premultiplied) {
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 18, 4, 0, 0)
+   if (alpha == 0 && (*argb & 0xff) != 0) {
+   /* Doesn't look like premultiplied alpha */
+   *premultiplied = FALSE;
+   return FALSE;
+   }
+#endif
 
-   if (crtc->scrn->depth != 24 && crtc->scrn->depth != 32)
-   return argb;
+   if (!(*apply_gamma))
+   return TRUE;
+
+   if (*argb > (alpha | alpha << 8 | alpha << 16 | alpha << 24)) {
+   /* Un-premultiplied R/G/B would overflow gamma LUT,
+* don't apply gamma correction
+*/
+   *apply_gamma = FALSE;
+   return FALSE;
+   }
+   }
+
+   if (!alpha) {
+   *argb = 0;
+   return TRUE;
+   }
 
-   /* Un-premultiply alpha */
+   /* Extract RGB */
for (i = 0; i < 3; i++)
-   rgb[i] = ((argb >> (i * 8)) & 0xff) * 0xff / alpha;
+   rgb[i] = (*argb >> (i * 8)) & 0xff;
 
-   /* Apply gamma correction and pre-multiply alpha */
-   rgb[0] = (crtc->gamma_blue[rgb[0]] >> 8) * alpha / 0xff;
-   rgb[1] = (crtc->gamma_green[rgb[1]] >> 8) * alpha / 0xff;
-   rgb[2] = (crtc->gamma_red[rgb[2]] >> 8) * alpha / 0xff;
+   if (premultiplied) {
+   /* Un-premultiply alpha */
+   for (i = 0; i < 3; i++)
+   rgb[i] = rgb[i] * 0xff / alpha;
+   }
+
+   if (*apply_gamma) {
+   rgb[0] = crtc->gamma_blue[rgb[0]] >> 8;
+   rgb[1] = crtc->gamma_green[rgb[1]] >> 8;
+   rgb[2] = crtc->gamma_red[rgb[2]] >> 8;
+   }
 
-   return alpha << 24 | rgb[2] << 16 | rgb[1] << 8 | rgb[0];
+   /* Premultiply alpha */
+   for (i = 0; i < 3; i++)
+   rgb[i] = rgb[i] * alpha / 0xff;
+
+   *argb = alpha << 24 | rgb[2] << 16 | rgb[1] << 8 | rgb[0];
+   return TRUE;
 }
 
 static void
@@ -1069,27 +1102,36 @@ drmmode_load_cursor_argb (xf86CrtcPtr cr
ScrnInfoPtr pScrn = crtc->scrn;
RADEONInfoPtr info = RADEONPTR(pScrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+   Boo

update xserver to version 1.19.7

2019-03-03 Thread Matthieu Herrb
Hi,

the patch below updates the X server to version 1.19.7. It's a bug-fix
release. You'll find the change log at the begining of the patch.

To test, apply the patch with patch -p0 -E in /usr/xenocara/xserver,
and then re build xenocara as documented in release(8).

The patch is also available at https://herrb.eu/xserver-1.19.7.diff

Test reports and/or Oks welcome,

Thanks,

Index: ChangeLog
===
RCS file: /cvs/OpenBSD/xenocara/xserver/ChangeLog,v
retrieving revision 1.31
diff -u -p -u -r1.31 ChangeLog
--- ChangeLog   18 Feb 2018 17:16:37 -  1.31
+++ ChangeLog   3 Mar 2019 09:25:45 -
@@ -1,3 +1,547 @@
+commit 937391523eef6459d1f8b1ae25fe7e1f77b8a12a
+Author: Kevin Brace 
+Date:   Sat Mar 2 14:13:20 2019 -0800
+
+xserver 1.19.7
+
+Signed-off-by: Kevin Brace 
+
+commit a93f8f74b54accfb94a8c56357e566db76c24b22
+Author: Kevin Brace 
+Date:   Sat Mar 2 14:10:41 2019 -0800
+
+Update configure.ac bug URL for gitlab migration
+
+It is based on Alan Coopersmith's commit for various fd.o projects.
+
+Signed-off-by: Kevin Brace 
+
+commit af63efe470417cde8a64068b1e6965b2677d92d9
+Author: Kevin Brace 
+Date:   Thu Dec 13 22:32:27 2018 -0600
+
+Add 24-bit color support to exaGetPixmapFirstPixel
+
+It appears that people who developed EXA forgot that there used to be
+graphics devices that used 24-bits (3 bytes) instead of 32-bits (4 bytes)
+in order to display one pixel. The lack of 24-bit color support inside
+exaGetPixmapFirstPixel causes SiS 6326 to crash when running Xfce since
+SiS 6326 does not support 32-bit color.
+
+Signed-off-by: Kevin Brace 
+
+commit 56547b196660e246e37132960723819972b99c8c
+Author: Mario Kleiner 
+Date:   Mon Feb 5 11:20:41 2018 +0100
+
+glx: Only assign 8 bpc fbconfigs for composite visuals.
+
+Commit 91c42093b248 ("glx: Duplicate relevant fbconfigs for
+compositing visuals") adds many new depth 32 fbconfigs as
+composite visuals. On a X-Screen running at depth 24, this
+also adds bgra 10-10-10-2 fbconigs, as they also have
+config.rgbBits == 32, but these are not displayable on a
+depth 24 screen, leading to visually corrupted desktops
+under some compositors, e.g., fdo bug 104597 "Compton
+weird colors" when running compton with
+"compton --backend glx".
+
+Be more conservative for now and only select fbconfigs with
+8 bpc red, green, blue components for composite visuals.
+
+Fixes: 91c42093b248 ("glx: Duplicate relevant fbconfigs for
+  compositing visuals")
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104597
+Signed-off-by: Mario Kleiner 
+Reviewed-by: Thomas Hellstrom 
+Reviewed-by: Adam Jackson 
+(cherry picked from commit bebcc8477c8070ade9dd4be7299c718baeab3d7a)
+
+commit e96bd477395af3c2c3157ebda0f55ea4b672a114
+Author: Lyude Paul 
+Date:   Tue Feb 6 12:41:47 2018 -0500
+
+xwayland: Don't process cursor warping without an xwl_seat
+
+Unfortunately, on my machine Xwayland immediately crashes when I try to
+start it. gdb backtrace:
+
+ #0  0x774f0e79 in wl_proxy_marshal () from 
target:/lib64/libwayland-client.so.0
+ #1  0x00413172 in zwp_confined_pointer_v1_destroy 
(zwp_confined_pointer_v1=0x7)
+ at 
hw/xwayland/Xwayland@exe/pointer-constraints-unstable-v1-client-protocol.h:612
+ #2  0x00418bc0 in xwl_seat_destroy_confined_pointer 
(xwl_seat=0x8ba2a0)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2839
+ #3  0x00418c09 in xwl_seat_unconfine_pointer (xwl_seat=0x8ba2a0)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-input.c:2849
+ #4  0x00410d97 in xwl_cursor_confined_to (device=0xa5a000, 
screen=0x8b9d80, window=0x9bdb70)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland.c:328
+ #5  0x004a8571 in ConfineCursorToWindow (pDev=0xa5a000, 
pWin=0x9bdb70, generateEvents=1,
+ confineToScreen=0) at /home/lyudess/Projects/xserver/dix/events.c:900
+ #6  0x004a94b7 in ScreenRestructured (pScreen=0x8b9d80)
+ at /home/lyudess/Projects/xserver/dix/events.c:1387
+ #7  0x00502386 in RRScreenSizeNotify (pScreen=0x8b9d80)
+ at /home/lyudess/Projects/xserver/randr/rrscreen.c:160
+ #8  0x0041a83c in update_screen_size (xwl_output=0x8e7670, 
width=3840, height=2160)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:203
+ #9  0x0041a9f0 in apply_output_change (xwl_output=0x8e7670)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:252
+ #10 0x0041aaeb in xdg_output_handle_done (data=0x8e7670, 
xdg_output=0x8e7580)
+ at /home/lyudess/Projects/xserver/hw/xwayland/xwayland-output.c:307
+ #11 0x750e9d1e in ffi_call_unix64 () at 

xenocara: update to libfontenc 1.1.4

2019-02-26 Thread Matthieu Herrb
e
+else
+  SYSV_MAN_SECTIONS=true
+fi
+
+;;
+*) SYSV_MAN_SECTIONS=false ;;
+esac
+
 if test x$APP_MAN_SUFFIX = x; then
 APP_MAN_SUFFIX=1
 fi
@@ -17520,9 +17552,9 @@
 fi
 
 if test x$FILE_MAN_SUFFIX = x; then
-case $host_os in
-   solaris*)   FILE_MAN_SUFFIX=4  ;;
-   *)  FILE_MAN_SUFFIX=5  ;;
+case $SYSV_MAN_SECTIONS in
+   true)   FILE_MAN_SUFFIX=4  ;;
+   *)  FILE_MAN_SUFFIX=5  ;;
 esac
 fi
 if test x$FILE_MAN_DIR = x; then
@@ -17530,9 +17562,9 @@
 fi
 
 if test x$MISC_MAN_SUFFIX = x; then
-case $host_os in
-   solaris*)   MISC_MAN_SUFFIX=5  ;;
-   *)  MISC_MAN_SUFFIX=7  ;;
+case $SYSV_MAN_SECTIONS in
+   true)   MISC_MAN_SUFFIX=5  ;;
+   *)  MISC_MAN_SUFFIX=7  ;;
 esac
 fi
 if test x$MISC_MAN_DIR = x; then
@@ -17540,9 +17572,9 @@
 fi
 
 if test x$DRIVER_MAN_SUFFIX = x; then
-case $host_os in
-   solaris*)   DRIVER_MAN_SUFFIX=7  ;;
-   *)  DRIVER_MAN_SUFFIX=4  ;;
+case $SYSV_MAN_SECTIONS in
+   true)   DRIVER_MAN_SUFFIX=7  ;;
+   *)  DRIVER_MAN_SUFFIX=4  ;;
 esac
 fi
 if test x$DRIVER_MAN_DIR = x; then
@@ -17550,9 +17582,9 @@
 fi
 
 if test x$ADMIN_MAN_SUFFIX = x; then
-case $host_os in
-   solaris*)   ADMIN_MAN_SUFFIX=1m ;;
-   *)  ADMIN_MAN_SUFFIX=8  ;;
+case $SYSV_MAN_SECTIONS in
+   true)   ADMIN_MAN_SUFFIX=1m ;;
+   *)  ADMIN_MAN_SUFFIX=8  ;;
 esac
 fi
 if test x$ADMIN_MAN_DIR = x; then
@@ -18485,7 +18517,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libfontenc $as_me 1.1.3, which was
+This file was extended by libfontenc $as_me 1.1.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -18545,13 +18577,13 @@
 Configuration commands:
 $config_commands
 
-Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+Report bugs to <https://gitlab.freedesktop.org/xorg/lib/libfontenc/issues>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/&/g'`"
 ac_cs_version="\\
-libfontenc config.status 1.1.3
+libfontenc config.status 1.1.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
Index: configure.ac
===
RCS file: /cvs/OpenBSD/xenocara/lib/libfontenc/configure.ac,v
retrieving revision 1.6
diff -u -r1.6 configure.ac
--- configure.ac10 May 2015 09:27:16 -  1.6
+++ configure.ac26 Feb 2019 21:10:35 -
@@ -21,8 +21,8 @@
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libfontenc], [1.1.3],
-[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], 
[libfontenc])
+AC_INIT([libfontenc], [1.1.4],
+[https://gitlab.freedesktop.org/xorg/lib/libfontenc/issues], 
[libfontenc])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])
 
Index: include/X11/fonts/fontenc.h
===
RCS file: /cvs/OpenBSD/xenocara/lib/libfontenc/include/X11/fonts/fontenc.h,v
retrieving revision 1.3
diff -u -r1.3 fontenc.h
--- include/X11/fonts/fontenc.h 10 May 2015 09:27:16 -  1.3
+++ include/X11/fonts/fontenc.h 26 Feb 2019 21:10:35 -
@@ -109,7 +109,7 @@
 
 /* Return a pointer to the name of the system encodings directory. */
 /* This string is static and should not be modified. */
-char *FontEncDirectory(void);
+const char *FontEncDirectory(void);
 
 /* Identify an encoding file.  If fileName doesn't exist, or is not an
encoding file, return NULL, otherwise returns a NULL-terminated
Index: src/encparse.c
===
RCS file: /cvs/OpenBSD/xenocara/lib/libfontenc/src/encparse.c,v
retrieving revision 1.5
diff -u -r1.5 encparse.c
--- src/encparse.c  10 May 2015 09:27:16 -  1.5
+++ src/encparse.c  26 Feb 2019 21:10:35 -
@@ -827,13 +827,13 @@
 return NULL;
 }
 
-char *
+const char *
 FontEncDirectory(void)
 {
-static char *dir = NULL;
+static const char *dir = NULL;
 
 if (dir == NULL) {
-char *c = getenv("FONT_ENCODINGS_DIRECTORY");
+const char *c = getenv("FONT_ENCODINGS_DIRECTORY");
 
 if (c) {
 dir = strdup(c);
@@ -941,7 +941,7 @@
 {
 FontEncPtr encoding;
 char dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN];
-char *d;
+const char *d;
 
 if (fontFileName) {
 parseFontFileName(fontFileName, dirname, dir);
Index: src/fontenc.c
===
RCS file: /cvs/OpenBSD/xenocara/lib/libfontenc/src/fontenc.c,v
retrieving revision 1.6
diff -u -r1.6 fontenc.c
--- src/fontenc.c   10 May 2015 09:27:16 -  1.6
+++ src/fontenc.c   26 Feb 2019 21:10:35 -
@@ -274,14 +274,14 @@
 isocode == 0xB7 || isocode == 0xBB || isocode == 0xBD)
 return isocode;
 else if (isocode == 0xA1)
-return 0x02BD;
+return 0x2018;
 else if (isocode == 0xA2)
-return 0x02BC;
+return 0x2019;
 else if (isocode == 0xAF)
 return 0x2015;
 else if (isocode == 0xD2)   /* unassigned */
 return 0;
-else if (isocode >= 0xB4)
+else if (isocode >= 0xB4 && isocode <= 0xFE)
 return isocode - 0xA0 + 0x0370;
 else
 return 0;

-- 
Matthieu Herrb



xterm: fix build with -DOPT_TRACE=1

2019-02-26 Thread Matthieu Herrb
Hi,

The patch below allows to build a version of xterm with tracing (very
verbose debugging log) active. This is only useful to debug xterm, and
I've been carrying this local change for years now.
After all, every developer may want to be able to see how xterm is
processing its data.

To enable tracing, add -DOPT_TRACE=1 to CPPFLAGS Makefile. Avoid
installing this version, it will fill your disks.

The patch builds an additional file needed for tracing (VTparse.cin)
and disables visibleTekparse() if the Tektronics widget isn't built.

ok ?

Index: Makefile
===
RCS file: /cvs/OpenBSD/xenocara/app/xterm/Makefile,v
retrieving revision 1.32
diff -u -r1.32 Makefile
--- Makefile18 Jun 2017 21:09:07 -  1.32
+++ Makefile26 Feb 2019 20:53:28 -
@@ -37,6 +37,8 @@
 
 misc.o:builtin_icons.h
 
+trace.o: VTparse.cin
+
 # do this to quiet gcc -Wcast-qual warnings 
 builtin_icons.h :
@echo "#if OPT_BUILTIN_XPMS" >$@
@@ -57,7 +59,7 @@
 beforedepend: builtin_icons.h VTparse.hin
 BUILDFIRST = builtin_icons.h VTparse.hin
 
-.SUFFIXES: .man .1
+.SUFFIXES: .man .1 .def .cin .hin
 
 PATCH_NUM != sed -n '/XTERM_PATCH/s/[^0-9]*//gp' ${.CURDIR}/version.h
 PATCH_YMD != sed -n '/XTERM_DATE/s,[^0-9/.-]*,,gp' ${.CURDIR}/version.h
@@ -82,7 +84,7 @@
-e s%/etc/wtmp%/var/run/wtmp%g \
 < $< > $@
 
-CLEANFILES+=   ${MAN} builtin_icons.h VTparse.hin
+CLEANFILES+=   ${MAN} builtin_icons.h VTparse.cin VTparse.hin
 
 afterinstall:
${INSTALL} ${INSTALL_COPY} -m ${SHAREMODE} \
@@ -93,6 +95,14 @@
${DESTDIR}${X11BASE}/share/X11/app-defaults/XTerm-color
 
 obj: _xenocara_obj
+
+AWK?= awk
+
+.def.cin:
+   $(AWK) '/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
+
+.def.hin:
+   $(AWK) '/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
 
 .include 
 .include 
Index: trace.c
===
RCS file: /cvs/OpenBSD/xenocara/app/xterm/trace.c,v
retrieving revision 1.29
diff -u -r1.29 trace.c
--- trace.c 24 Feb 2019 11:41:42 -  1.29
+++ trace.c 26 Feb 2019 20:53:31 -
@@ -492,6 +492,7 @@
 return result;
 }
 
+#if OPT_TEK4014
 const char *
 visibleTekparse(int code)
 {
@@ -511,6 +512,7 @@
 }
 return result;
 }
+#endif
 
 const char *
 visibleVTparse(int code)

-- 
Matthieu Herrb



Re: switch Xorg protos to xorgproto 2018.4

2019-02-24 Thread Matthieu Herrb
On Thu, Feb 14, 2019 at 09:38:33AM +0100, Matthieu Herrb wrote:
> On Mon, Feb 11, 2019 at 07:34:46AM +0100, Matthieu Herrb wrote:
> > Hi,
> > 
> > I've recently imported xorgproto 2018.4 in xenocara. This is a package
> > the unifies all the previous *proto packages from X.Org (except
> > xcb-proto which is special), and enabled it yesterday.
> > 
> > I had to revert that last commit since it is suspected to be the cause
> > for this regression mentionned on misc:
> > https://marc.info/?l=openbsd-misc=154983711329128=2
> > 
> > So please test the following diff for other possible regressions,
> > while we're looking at the compton issue.
> 
> The compton issue has been found and a patch got committed to ports.
> 
> So any ok for this ?

ping ?
> 
> > 
> > Index: Makefile
> > ===
> > RCS file: /cvs/xenocara/proto/Makefile,v
> > retrieving revision 1.17
> > diff -u -r1.17 Makefile
> > --- Makefile10 Feb 2019 23:07:47 -  1.17
> > +++ Makefile11 Feb 2019 00:05:49 -
> > @@ -2,17 +2,7 @@
> >  
> >  .include 
> >  
> > -SUBDIR= bigreqsproto compositeproto dmxproto damageproto \
> > -   fixesproto fontsproto glproto inputproto \
> > -   kbproto pmproto xineramaproto presentproto randrproto \
> > -   recordproto renderproto resourceproto scrnsaverproto \
> > -   videoproto x11proto xcb-proto xcmiscproto xextproto \
> > -   xf86bigfontproto xf86dgaproto \
> > -   xf86vidmodeproto
> > -
> > -.if ${XENOCARA_BUILD_DRI:L} == "yes"
> > -SUBDIR+= xf86driproto dri2proto dri3proto
> > -.endif
> > +SUBDIR= xcb-proto xorgproto
> >  
> >  .include 
> >  
> > -- 
> > Matthieu Herrb
> 
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



Re: update xserver dri2 pci_ids

2019-02-17 Thread Matthieu Herrb
t;Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)")
> +CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT3)")
>  CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)")
>  CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)")
>  CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)")
> @@ -188,3 +201,15 @@ CHIPSET(0x5A50, cnl_5x8, "Intel(R) HD Gr
>  CHIPSET(0x5A51, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)")
>  CHIPSET(0x5A52, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)")
>  CHIPSET(0x5A54, cnl_5x8, "Intel(R) HD Graphics (Cannonlake 5x8 GT2)")
> +CHIPSET(0x8A50, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)")
> +CHIPSET(0x8A51, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)")
> +CHIPSET(0x8A52, icl_8x8, "Intel(R) HD Graphics (Ice Lake 8x8 GT2)")
> +CHIPSET(0x8A56, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)")
> +CHIPSET(0x8A57, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)")
> +CHIPSET(0x8A58, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)")
> +CHIPSET(0x8A59, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)")
> +CHIPSET(0x8A5A, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)")
> +CHIPSET(0x8A5B, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)")
> +CHIPSET(0x8A5C, icl_6x8, "Intel(R) HD Graphics (Ice Lake 6x8 GT1.5)")
> +CHIPSET(0x8A5D, icl_4x8, "Intel(R) HD Graphics (Ice Lake 4x8 GT1)")
> +CHIPSET(0x8A71, icl_1x8, "Intel(R) HD Graphics (Ice Lake 1x8 GT0.5)")
> Index: radeonsi_pci_ids.h
> ===
> RCS file: /cvs/xenocara/xserver/hw/xfree86/dri2/pci_ids/radeonsi_pci_ids.h,v
> retrieving revision 1.4
> diff -u -p -r1.4 radeonsi_pci_ids.h
> --- radeonsi_pci_ids.h8 Dec 2017 15:02:00 -   1.4
> +++ radeonsi_pci_ids.h17 Feb 2019 10:43:16 -
> @@ -202,6 +202,54 @@ CHIPSET(0x67C9, POLARIS10_, POLARIS10)
>  CHIPSET(0x67CA, POLARIS10_, POLARIS10)
>  CHIPSET(0x67CC, POLARIS10_, POLARIS10)
>  CHIPSET(0x67CF, POLARIS10_, POLARIS10)
> +CHIPSET(0x67D0, POLARIS10_, POLARIS10)
>  CHIPSET(0x67DF, POLARIS10_, POLARIS10)
> +CHIPSET(0x6FDF, POLARIS10_, POLARIS10)
>  
>  CHIPSET(0x98E4, STONEY_, STONEY)
> +
> +CHIPSET(0x6980, POLARIS12_, POLARIS12)
> +CHIPSET(0x6981, POLARIS12_, POLARIS12)
> +CHIPSET(0x6985, POLARIS12_, POLARIS12)
> +CHIPSET(0x6986, POLARIS12_, POLARIS12)
> +CHIPSET(0x6987, POLARIS12_, POLARIS12)
> +CHIPSET(0x6995, POLARIS12_, POLARIS12)
> +CHIPSET(0x6997, POLARIS12_, POLARIS12)
> +CHIPSET(0x699F, POLARIS12_, POLARIS12)
> +
> +CHIPSET(0x694C, VEGAM_, VEGAM)
> +CHIPSET(0x694E, VEGAM_, VEGAM)
> +CHIPSET(0x694F, VEGAM_, VEGAM)
> +
> +CHIPSET(0x6860, VEGA10_, VEGA10)
> +CHIPSET(0x6861, VEGA10_, VEGA10)
> +CHIPSET(0x6862, VEGA10_, VEGA10)
> +CHIPSET(0x6863, VEGA10_, VEGA10)
> +CHIPSET(0x6864, VEGA10_, VEGA10)
> +CHIPSET(0x6867, VEGA10_, VEGA10)
> +CHIPSET(0x6868, VEGA10_, VEGA10)
> +CHIPSET(0x6869, VEGA10_, VEGA10)
> +CHIPSET(0x686A, VEGA10_, VEGA10)
> +CHIPSET(0x686B, VEGA10_, VEGA10)
> +CHIPSET(0x686C, VEGA10_, VEGA10)
> +CHIPSET(0x686D, VEGA10_, VEGA10)
> +CHIPSET(0x686E, VEGA10_, VEGA10)
> +CHIPSET(0x686F, VEGA10_, VEGA10)
> +CHIPSET(0x687F, VEGA10_, VEGA10)
> +
> +CHIPSET(0x69A0, VEGA12_, VEGA12)
> +CHIPSET(0x69A1, VEGA12_, VEGA12)
> +CHIPSET(0x69A2, VEGA12_, VEGA12)
> +CHIPSET(0x69A3, VEGA12_, VEGA12)
> +CHIPSET(0x69AF, VEGA12_, VEGA12)
> +
> +CHIPSET(0x66A0, VEGA20_, VEGA20)
> +CHIPSET(0x66A1, VEGA20_, VEGA20)
> +CHIPSET(0x66A2, VEGA20_, VEGA20)
> +CHIPSET(0x66A3, VEGA20_, VEGA20)
> +CHIPSET(0x66A4, VEGA20_, VEGA20)
> +CHIPSET(0x66A7, VEGA20_, VEGA20)
> +CHIPSET(0x66AF, VEGA20_, VEGA20)
> +
> +CHIPSET(0x15DD, RAVEN_, RAVEN)
> +CHIPSET(0x15D8, RAVEN_, RAVEN)

-- 
Matthieu Herrb



Re: switch Xorg protos to xorgproto 2018.4

2019-02-14 Thread Matthieu Herrb
On Mon, Feb 11, 2019 at 07:34:46AM +0100, Matthieu Herrb wrote:
> Hi,
> 
> I've recently imported xorgproto 2018.4 in xenocara. This is a package
> the unifies all the previous *proto packages from X.Org (except
> xcb-proto which is special), and enabled it yesterday.
> 
> I had to revert that last commit since it is suspected to be the cause
> for this regression mentionned on misc:
> https://marc.info/?l=openbsd-misc=154983711329128=2
> 
> So please test the following diff for other possible regressions,
> while we're looking at the compton issue.

The compton issue has been found and a patch got committed to ports.

So any ok for this ?

> 
> Index: Makefile
> ===
> RCS file: /cvs/xenocara/proto/Makefile,v
> retrieving revision 1.17
> diff -u -r1.17 Makefile
> --- Makefile  10 Feb 2019 23:07:47 -  1.17
> +++ Makefile  11 Feb 2019 00:05:49 -
> @@ -2,17 +2,7 @@
>  
>  .include 
>  
> -SUBDIR= bigreqsproto compositeproto dmxproto damageproto \
> - fixesproto fontsproto glproto inputproto \
> - kbproto pmproto xineramaproto presentproto randrproto \
> - recordproto renderproto resourceproto scrnsaverproto \
> - videoproto x11proto xcb-proto xcmiscproto xextproto \
> - xf86bigfontproto xf86dgaproto \
> - xf86vidmodeproto
> -
> -.if ${XENOCARA_BUILD_DRI:L} == "yes"
> -SUBDIR+= xf86driproto dri2proto dri3proto
> -.endif
> +SUBDIR= xcb-proto xorgproto
>  
>  .include 
>  
> -- 
> Matthieu Herrb

-- 
Matthieu Herrb



switch Xorg protos to xorgproto 2018.4

2019-02-10 Thread Matthieu Herrb
Hi,

I've recently imported xorgproto 2018.4 in xenocara. This is a package
the unifies all the previous *proto packages from X.Org (except
xcb-proto which is special), and enabled it yesterday.

I had to revert that last commit since it is suspected to be the cause
for this regression mentionned on misc:
https://marc.infœ?l=openbsd-misc=154983711329128=2

So please test the following diff for other possible regressions,
while we're looking at the compton issue.

Index: Makefile
===
RCS file: /cvs/xenocara/proto/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile10 Feb 2019 23:07:47 -  1.17
+++ Makefile11 Feb 2019 00:05:49 -
@@ -2,17 +2,7 @@
 
 .include 
 
-SUBDIR= bigreqsproto compositeproto dmxproto damageproto \
-   fixesproto fontsproto glproto inputproto \
-   kbproto pmproto xineramaproto presentproto randrproto \
-   recordproto renderproto resourceproto scrnsaverproto \
-   videoproto x11proto xcb-proto xcmiscproto xextproto \
-   xf86bigfontproto xf86dgaproto \
-   xf86vidmodeproto
-
-.if ${XENOCARA_BUILD_DRI:L} == "yes"
-SUBDIR+= xf86driproto dri2proto dri3proto
-.endif
+SUBDIR= xcb-proto xorgproto
 
 .include 
 
-- 
Matthieu Herrb



xtsscale - use abs() for integers

2019-02-10 Thread Matthieu Herrb
Noticed by clang warning.

ok ?

Index: xtsscale.c
===
RCS file: /cvs/OpenBSD/xenocara/app/xtsscale/xtsscale.c,v
retrieving revision 1.23
diff -u -r1.23 xtsscale.c
--- xtsscale.c  6 Mar 2012 23:24:37 -   1.23
+++ xtsscale.c  10 Feb 2019 15:53:44 -
@@ -732,7 +732,7 @@
cleanup_exit(device);
 
/* Check if  X and Y should be swapped */
-   if (fabs(x[0] - x[1]) > fabs(y[0] - y[1])) {
+   if (abs(x[0] - x[1]) > abs(y[0] - y[1])) {
 
calib.swapxy = 1;
 

-- 
Matthieu Herrb



Re: video(1) pledge

2019-01-21 Thread Matthieu Herrb
On Mon, Jan 21, 2019 at 09:27:57PM +0100, Landry Breuil wrote:
> Hi,
>

Hi,

> now that the 'video' promise is in, looking for okays to pledge
> video(1).
> 
> with help & hints from semarie@.

One comment in-line.
> 
> Index: video.c
> ===
> RCS file: /cvs/xenocara/app/video/video.c,v
> retrieving revision 1.25
> diff -u -r1.25 video.c
> --- video.c   9 Apr 2018 18:16:44 -   1.25
> +++ video.c   30 Dec 2018 09:39:27 -
> @@ -1961,6 +1961,8 @@
>   argv += optind;
>  
>   if (vid.mode & M_QUERY) {
> + if (pledge("stdio rpath wpath video", NULL) == -1)
> + err(1, "pledge");
>   dev_dump_query();
>   cleanup(, 0);
>   }
> @@ -1970,6 +1972,14 @@
>  
>   if (!setup())
>   cleanup(, 1);
> +
> + if (vid.mode & M_IN_FILE) {
> + if (pledge("stdio", NULL) == -1)

Like people have found out the hard way recently, X libs need "rpath"
in case the X error handler needs to be called.


> + err(1, "pledge");
> + } else {
> +     if (pledge("stdio rpath video", NULL) == -1)
> + err(1, "pledge");
> + }
>  
>   if (!stream())
>   cleanup(, 1);

-- 
Matthieu Herrb



Re: video(1) pledge (& updated kernel diff)

2019-01-04 Thread Matthieu Herrb
On Sun, Dec 30, 2018 at 12:14:58PM +0100, Sebastien Marie wrote:
> On Sun, Dec 30, 2018 at 10:58:58AM +0100, Landry Breuil wrote:
> > On Sat, Dec 29, 2018 at 09:30:22AM +0100, Sebastien Marie wrote:
> > > On Fri, Dec 28, 2018 at 09:41:06PM +0100, Landry Breuil wrote:
> > > 
> > > I would separate the addition of pledge(2) and unrelated fixes.
> > 
> > Right, two separated diffs attached for this.
> > 
> 
> the err->errs diff to avoid shadowing is ok semarie@
> 
> mherrb@, any objections to it ?

Hi,

sorry for not noticing that I was summoned...
No objection.

> 
> Thanks
> -- 
> Sebastien Marie
> 
> > Index: video.c
> > ===
> > RCS file: /cvs/xenocara/app/video/video.c,v
> > retrieving revision 1.25
> > diff -u -r1.25 video.c
> > --- video.c 9 Apr 2018 18:16:44 -   1.25
> > +++ video.c 30 Dec 2018 09:39:21 -
> > @@ -1854,7 +1854,7 @@
> > struct xdsp *x = 
> > const char *errstr;
> > size_t len;
> > -   int ch, err = 0;
> > +   int ch, errs = 0;
> >  
> > bzero(, sizeof(struct video));
> >  
> > @@ -1872,21 +1872,21 @@
> > x->cur_adap = strtonum(optarg, 0, 4, );
> > if (errstr != NULL) {
> > warnx("Xv adaptor '%s' is %s", optarg, errstr);
> > -   err++;
> > +   errs++;
> > }
> > break;
> > case 'e':
> > vid.enc = find_enc(optarg);
> > if (vid.enc >= ENC_LAST) {
> > warnx("encoding '%s' is invalid", optarg);
> > -   err++;
> > +   errs++;
> > }
> > break;
> > case 'f':
> > len = strlcpy(d->path, optarg, sizeof(d->path));
> > if (len >= sizeof(d->path)) {
> > warnx("file path is too long: %s", optarg);
> > -   err++;
> > +   errs++;
> > }
> > break;
> > case 'g':
> > @@ -1894,8 +1894,8 @@
> > break;
> > case 'i':
> > if (vid.mode & (M_IN_FILE | M_OUT_FILE)) {
> > -   warnx("only one input or ouput file allowed");
> > -   err++;
> > +   warnx("only one input or output file allowed");
> > +   errs++;
> > } else {
> > vid.mode = (vid.mode & ~M_IN_DEV) | M_IN_FILE;
> > vid.mmap_on = 0; /* mmap mode does not work for 
> > files */
> > @@ -1904,15 +1904,15 @@
> > if (len >= sizeof(vid.iofile)) {
> > warnx("input path is too long: %s",
> > optarg);
> > -   err++;
> > +   errs++;
> > }
> > }
> > break;
> > case 'o':
> > case 'O':
> > if (vid.mode & (M_IN_FILE | M_OUT_FILE)) {
> > -   warnx("only one input or ouput file allowed");
> > -   err++;
> > +   warnx("only one input or output file allowed");
> > +   errs++;
> > } else {
> > vid.mode |= M_OUT_FILE;
> > if (ch != 'O')
> > @@ -1922,7 +1922,7 @@
> > if (len >= sizeof(vid.iofile)) {
> > warnx("output path is too long: %s",
> > optarg);
> > -   err++;
> > +   errs++;
> > }
> > }
> > break;
> > @@ -1937,7 +1937,7 @@
> > vid.fps = strtonum(optarg, 1, 100, );
> > if (errstr != NULL) {
> > warnx("frame rate '%s' is %s", optarg, errstr);
> > -   err++;
> > +   errs++;
> > }
> > break;
> > case 's':
> > @@ -1947,13 +1947,13 @@
> > vid.verbose++;
> > break;
> > default:
> > -   err++;
> > +   errs++;
> > break;
> > }
> > -   if (err > 0)
> > +   if (errs > 0)
> > break;
> > }
> > -   if (err > 0) {
> > +   if (errs > 0) {
> > usage();
> > cleanup(, 1);
> > }

-- 
Matthieu Herrb



Re: running Xorg without root

2018-12-12 Thread Matthieu Herrb
On Wed, Dec 12, 2018 at 01:27:24AM +0200, Lauri Tirkkonen wrote:
> Hi,
> 
> since the Xorg setuid bit was removed, I looked a little bit into what
> it would take to run it without root privs. I have a proof of concept
> put together, and things seem to work (on an X220 amd64 + modesetting
> driver, inteldrm; login on ttyC0 and running xinit).  Testing the waters
> here to see if anyone else is interested :)
> 
> First, we need Xorg to attempt xf86OpenConsole even when we're not uid
> 0. That will call xf86OpenWScons (through xf86ConsTab), which opens the
> console device and does wscons ioctls on it -- succeeding if the user
> running X has logged in on that console.
> 
> diff --git a/xserver/hw/xfree86/common/xf86Init.c 
> b/xserver/hw/xfree86/common/xf86Init.c
> index 2a04da045..b814eb412 100644
> --- a/xserver/hw/xfree86/common/xf86Init.c
> +++ b/xserver/hw/xfree86/common/xf86Init.c
> @@ -967,9 +967,13 @@ OsVendorInit(void)
>  #endif
>  #endif
>  #if defined(X_PRIVSEP)
> -  if (!beenHere && !xf86KeepPriv && geteuid() == 0) {
> -   xf86PrivilegedInit();
> -   xf86DropPriv();
> +  if (!beenHere) {
> +   if(!xf86KeepPriv && geteuid() == 0) {
> +   xf86PrivilegedInit();
> +   xf86DropPriv();
> +   } else {
> +   xf86OpenConsole();
> +   }
>}
>  #endif

This shouldn't be needed (And wasn't when I did my own tests with
running X without root). With startx you can re-use the virtual
console from which X was started, there won't be any other process
(like getty(8) fighting with the X server for input.

What was the issue that prompted you to make this change ?

>  
> 
> Next, we need the user logging in on ttyC0 to be able to access
> /dev/pci0 and /dev/ttyC4:
> 
> diff --git a/etc/etc.amd64/fbtab b/etc/etc.amd64/fbtab
> index 79cfb535c9f..b746b7684f7 100644
> --- a/etc/etc.amd64/fbtab
> +++ b/etc/etc.amd64/fbtab
> @@ -1 +1 @@
> -/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/drm0
> +/dev/ttyC0   0600
> /dev/console:/dev/wskbd:/dev/wskbd0:/dev/wsmouse:/dev/wsmouse0:/dev/ttyCcfg:/dev/drm0:/dev/pci0:/dev/ttyC4
> 
> 
> Finally, there's a check in drm_drv.c that only allows superuser to
> become a master on /dev/drm0 and fails the open for other users. I
> removed the superuser check; filesystem permissions should prevent
> anyone except the user logging in on ttyC0 from accessing this device
> anyway. I haven't studied what exactly being the master allows here and
> if there's possible privilege escalation hiding there; my reading of
> drm_do_ioctl is that ioctls marked DRM_ROOT_ONLY will still fail, so I
> admit I don't really know what the check was there for...
> 
> Still, this allows running X without any user processes as root (and
> unbreaks xinit/startx) - is there any potential here? :)

Yes. We dont wan't to do that. Mark has some plans to implement the
proper solution here.

Also note that this will only work for the modesetting
driver. Unfortnatly, even the other KMS based driver (intel and
radeon) still need more work to run without some root privileges.
And older drivers (non AMD/intel cards) will stop working completly.

> 
> diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
> index e09380e3257..be9773b0671 100644
> --- a/sys/dev/pci/drm/drm_drv.c
> +++ b/sys/dev/pci/drm/drm_drv.c
> @@ -745,14 +745,10 @@ drmopen(dev_t kdev, int flags, int fmt, struct proc *p)
>   }
>  
>   mutex_lock(>struct_mutex);
> - /* first opener automatically becomes master if root */
> - if (SPLAY_EMPTY(>files) && !DRM_SUSER(p)) {
> - mutex_unlock(>struct_mutex);
> - ret = EPERM;
> - goto free_priv;
> - }
> -
> + /* first opener automatically becomes master */
>   file_priv->is_master = SPLAY_EMPTY(>files);
> + if (!file_priv->authenticated)
> + file_priv->authenticated = file_priv->is_master;
>  
>   SPLAY_INSERT(drm_file_tree, >files, file_priv);
>   mutex_unlock(>struct_mutex);
> 
> -- 
> Lauri Tirkkonen | lotheac @ IRCnet

-- 
Matthieu Herrb



xenodm: remove unused 'keyFile' resource

2018-11-03 Thread Matthieu Herrb
Hi,

The 'keyfile' resource is not used anymore in xenodm (it was used to
specify the secret keys for the XDM-AUTHORIZATION-1 authentication
protocol in xdm with xdmcp).

ok?

Index: config/xenodm-config.in
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/config/xenodm-config.in,v
retrieving revision 1.4
diff -u -p -u -r1.4 xenodm-config.in
--- config/xenodm-config.in 5 Sep 2017 17:48:07 -   1.4
+++ config/xenodm-config.in 3 Nov 2018 16:37:43 -
@@ -2,7 +2,6 @@
 !
 DisplayManager.authDir:@XENODMXAUTHDIR@
 DisplayManager.errorLogFile:   @XENODMLOGDIR@/xenodm.log
-DisplayManager.keyFile:@XENODMCONFIGDIR@/xenodm-keys
 DisplayManager.servers:@XENODMCONFIGDIR@/Xservers
 DisplayManager*resources:  @XENODMCONFIGDIR@/Xresources
 ! All displays should use authorization, but we cannot be sure
Index: include/dm.h
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/include/dm.h,v
retrieving revision 1.13
diff -u -p -u -r1.13 dm.h
--- include/dm.h10 Jul 2018 14:20:42 -  1.13
+++ include/dm.h3 Nov 2018 16:35:48 -
@@ -182,7 +182,6 @@ extern int  daemonMode;
 extern char*authDir;
 extern int autoRescan;
 extern int removeDomainname;
-extern char*keyFile;
 extern char**exportList;
 
 extern struct display  *FindDisplayByName (char *name),
Index: xenodm/resource.c
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/xenodm/resource.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 resource.c
--- xenodm/resource.c   10 Jul 2018 15:32:27 -  1.4
+++ xenodm/resource.c   3 Nov 2018 16:36:16 -
@@ -50,7 +50,6 @@ int   sourceAddress;
 char   *authDir;
 intautoRescan;
 intremoveDomainname;
-char   *keyFile;
 char   **exportList;
 
 #define DM_STRING  0
@@ -95,9 +94,6 @@ char  **exportList;
 #ifndef DEF_USER_AUTH_DIR
 # define DEF_USER_AUTH_DIR "/tmp"
 #endif
-#ifndef DEF_KEY_FILE
-# define DEF_KEY_FILE  ""
-#endif
 #ifndef DEF_ACCESS_FILE
 # define DEF_ACCESS_FILE   ""
 #endif
@@ -122,8 +118,6 @@ struct dmResources {
"true"} ,
 { "removeDomainname","RemoveDomainname",DM_BOOL,(char **) ,
"true"} ,
-{ "keyFile",   "KeyFile",  DM_STRING,  ,
-   DEF_KEY_FILE} ,
 { "exportList","ExportList",   DM_ARGV,(char **) ,
    ""} ,
 { "sourceAddress","SourceAddress",DM_BOOL, (char **) ,

-- 
Matthieu Herrb



Re: pledge xenodm

2018-11-03 Thread Matthieu Herrb
On Fri, Nov 02, 2018 at 07:03:11PM +, Ricardo Mestre wrote:
> Hi,
> 
> Looking at pledging xenodm a little bit more I was able to run it with
> the diff below across X restarts, with stock configuration.
> 
> Please test it, if you have special configs better since most likely
> this will break it but we need to know where and why and with that maybe
> trim xenodm's bloat.

Hi,

xenodm crashes if one logs out from the first session that was
created.  the pldege() call in StartDisplay is too strict.

I've not had time to fully figure out if this can be fixed. Iirc I
tried when I did the initial work on adding pledge to xenodm and it's
not possible because of the code that creates the auth cookie and
chown()s it to _x11.

I didn't have time yet to do a more serious testing of the session
pledge. 

> 
> DisplayManager:
> rpath: open(2) /etc/X11/xenodm/xenodm-config
> cpath: unlink(2) d->authFile
> proc: kill(2)
> 
> Session:
> rpath: open(2) /etc/fbtab
> wpath/cpath: open(2) d->authFile
> fattr: chmod(2) d->authFile
> dns: sysctl(2) for name resolution
> proc: kill(2)
> exec: execve(2) /etc/X11/xenodm/TakeConsole
> id: setuid(2)
> 
> Index: dm.c
> ===
> RCS file: /cvs/xenocara/app/xenodm/xenodm/dm.c,v
> retrieving revision 1.6
> diff -u -p -u -r1.6 dm.c
> --- dm.c  11 Jul 2018 16:57:04 -  1.6
> +++ dm.c  31 Oct 2018 15:15:49 -
> @@ -604,6 +604,10 @@ StartDisplay (struct display *d)
>   Debug ("pid: %d\n", pid);
>   d->pid = pid;
>   d->status = running;
> +
> + if (pledge("stdio rpath cpath proc", NULL) == -1)
> + exit(OPENFAILED_DISPLAY);
> +
>   break;
>  }
>  }
> Index: session.c
> ===
> RCS file: /cvs/xenocara/app/xenodm/xenodm/session.c,v
> retrieving revision 1.12
> diff -u -p -u -r1.12 session.c
> --- session.c 11 Jul 2018 20:28:41 -  1.12
> +++ session.c 31 Oct 2018 15:15:49 -
> @@ -378,6 +378,10 @@ StartClient (
>  default:
>   Debug ("StartSession, fork succeeded %d\n", pid);
>   *pidp = pid;
> +
> + if (pledge("stdio rpath wpath cpath fattr dns proc exec id", NULL) == 
> -1)
> + exit(25);
> +
>   return 1;
>  }
>  }
> 
> - End forwarded message -

-- 
Matthieu Herrb



Xenocara: disable xdm-authorization-1 cleanly

2018-11-01 Thread Matthieu Herrb
Hi,

The XDM-AUTHORIZATION-1 protocol is currenly disabled in xenocara.
It makes sense: this auth protocol doesn't work with IPv6, is relying
on weak DES encryption and only useful with XDMP which isn't supported
by xenodm.

But it's currently only disabled as a side-effect of a buggy check in
xenodm. (If written correctly the test whould enable it...).
This buggy check is a left-over from xdm, and is useless for xenodm.

So let's remove it, and explicitely disable xdm-auth-1 in xserver.

ok ?

Index: app/xenodm/configure.ac
===
RCS file: /cvs/xenocara/app/xenodm/configure.ac,v
retrieving revision 1.9
diff -u -r1.9 configure.ac
--- app/xenodm/configure.ac 15 Jul 2018 09:05:11 -  1.9
+++ app/xenodm/configure.ac 1 Nov 2018 11:49:32 -
@@ -198,8 +198,6 @@
 XENODM_CFLAGS="$XENODM_CFLAGS $DMCP_CFLAGS $XLIB_CFLAGS $AUTH_CFLAGS 
$STATIC_GREETER_CFLAGS"
 XENODM_LIBS="$XENODM_LIBS $DMCP_LIBS"
 
-AC_CHECK_LIB(Xdmcp, XdmcpWrap, [xdmauth="yes"], [xdmauth="no"], [$DMCP_LIBS])
-
 AC_SUBST(XENODM_CFLAGS)
 AC_SUBST(XENODM_LIBS)
 
Index: xserver/Makefile.bsd-wrapper
===
RCS file: /cvs/xenocara/xserver/Makefile.bsd-wrapper,v
retrieving revision 1.67
diff -u -r1.67 Makefile.bsd-wrapper
--- xserver/Makefile.bsd-wrapper25 Oct 2018 21:55:18 -  1.67
+++ xserver/Makefile.bsd-wrapper1 Nov 2018 11:49:32 -
@@ -35,7 +35,7 @@
--with-module-dir=${LIBDIR}/modules ${GLX_OPTION} \
--disable-install-setuid --enable-privsep \
${KDRIVE_OPTION} \
-   --enable-xcsecurity \
+   --enable-xcsecurity --disable-xdm-auth-1 \
--without-fop --without-xmlto --without-xsltproc \
--disable-dmx ${NO_XORG_OPTION} \
    --disable-unit-tests \

-- 
Matthieu Herrb



Re: unveil bdftopcf

2018-10-24 Thread Matthieu Herrb
On Wed, Oct 24, 2018 at 11:24:59AM +0100, Ricardo Mestre wrote:
> Hi,
> 
> If input_name is provided we can unveil it with read permissions, if
> output_name is provided we need to unveil this one with rwc. Additionally
> depending on the different combinations of if these files are passed via args
> or from stdin/to stdout we can also pledge accordingly to the code path. This
> has been tested succefully with bdf fonts we have bundled in
> xenocara.

This one looks ok, but it lacks autoconf support to allow the
application to build on other systems.
> 
> Since I have several other X apps unveiled and/or pledged could you please
> comment not only with the unveil/pledge part, but also err vs fprintf/exit, 
> the
> placement of the #includes and also tabs vs spaces?


Generally, I'm not too found of pledging/unveiling random X client
programs. There are a lot of "hidden" features in X libraries that
will probably break with too strict pledges and/or unveils.

Also since this is OpenBSD-specific, it will be difficult to get it
upstreams, especially if you don't provide the autoconf goo to make
the code still build/work on Linux. And when not upstreaming it
creates more burden to merge new versions of the applications.


> 
> Index: bdftopcf.c
> ===
> RCS file: /cvs/xenocara/app/bdftopcf/bdftopcf.c,v
> retrieving revision 1.5
> diff -u -p -u -r1.5 bdftopcf.c
> --- bdftopcf.c29 Mar 2018 20:34:30 -  1.5
> +++ bdftopcf.c24 Oct 2018 10:15:41 -
> @@ -38,7 +38,9 @@ from The Open Group.
>  #include "fntfil.h"
>  #include "bdfint.h"
>  #include "pcf.h"
> +#include 
>  #include 
> +#include 
>  #include 
>  
>  int
> @@ -158,6 +160,26 @@ main(int argc, char *argv[])
>  }
>  argv++;
>  }
> +
> + if (input_name) {
> + if (unveil(input_name, "r") == -1)
> + err(1, "unveil");
> + }
> + if (output_name) {
> + if (unveil(output_name, "rwc") == -1)
> + err(1, "unveil");
> + if (pledge("stdio rpath wpath cpath", NULL) == -1)
> + err(1, "pledge");
> + }
> + if (input_name && !output_name) {
> + if (pledge("stdio rpath", NULL) == -1)
> + err(1, "pledge");
> + }
> + if (!input_name && !output_name) {
> + if (pledge("stdio", NULL) == -1)
> + err(1, "pledge");
> + }
> +
>  if (input_name) {
>  input = FontFileOpen(input_name);
>  if (!input) {

-- 
Matthieu Herrb


signature.asc
Description: PGP signature


Re: unveil xserver's priv proc

2018-10-24 Thread Matthieu Herrb
On Wed, Oct 24, 2018 at 10:36:58AM +0100, Ricardo Mestre wrote:
> Hello,
> 
> semarie@ already gave positive feedback for unveiling xserver, did
> anyone tested it yet and comment on it or OK?

Sorry I almost forgot I was running with this patch for some days
now.

ok matthieu@

> 
> Index: privsep.c
> ===
> RCS file: /cvs/xenocara/xserver/os/privsep.c,v
> retrieving revision 1.29
> diff -u -p -u -r1.29 privsep.c
> --- privsep.c 6 Aug 2018 20:11:34 -   1.29
> +++ privsep.c 24 Oct 2018 09:35:01 -
> @@ -274,6 +274,10 @@ priv_init(uid_t uid, gid_t gid)
>   setproctitle("[priv]");
>   close(socks[1]);
>  
> + for (dev = allowed_devices; dev->name != NULL; dev++) {
> + if (unveil(dev->name, "rw") == -1)
> + err(1, "unveil");
> + }
>   if (pledge("stdio rpath wpath sendfd proc", NULL) == -1)
>   err(1, "pledge");
>  

-- 
Matthieu Herrb



update libxcb to 1.13.1

2018-09-29 Thread Matthieu Herrb
e
  # FIXME: insert proper C++ library support
@@ -7286,7 +7301,7 @@ if test yes != "$_lt_caught_CXX_error"; 
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
-   output_verbose_link_cmd='$CC -shared $CFLAGS -v 
conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+   output_verbose_link_cmd='$CC -shared $CFLAGS -v 
conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
  else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -7297,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error"; 
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
-   output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+   output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
  fi
 
  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
Index: dist/libxcb/src/xcb_in.c
===
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/src/xcb_in.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 xcb_in.c
--- dist/libxcb/src/xcb_in.c11 Sep 2018 19:34:56 -  1.12
+++ dist/libxcb/src/xcb_in.c27 Sep 2018 19:16:38 -
@@ -958,8 +958,20 @@ void _xcb_in_replies_done(xcb_connection
 pend = container_of(c->in.pending_replies_tail, struct pending_reply, 
next);
 if(pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER)
 {
-pend->last_request = c->out.request;
-pend->workaround = WORKAROUND_NONE;
+if (XCB_SEQUENCE_COMPARE(pend->first_request, <=, c->out.request)) 
{
+pend->last_request = c->out.request;
+pend->workaround = WORKAROUND_NONE;
+} else {
+/* The socket was taken, but no requests were actually sent
+ * so just discard the pending_reply that was created.
+ */
+struct pending_reply **prev_next = >in.pending_replies;
+while (*prev_next != pend)
+prev_next = &(*prev_next)->next;
+*prev_next = NULL;
+c->in.pending_replies_tail = prev_next;
+free(pend);
+}
 }
 }
 }
Index: dist/libxcb/src/xcb_out.c
===
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/src/xcb_out.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 xcb_out.c
--- dist/libxcb/src/xcb_out.c   2 Sep 2016 10:09:43 -   1.10
+++ dist/libxcb/src/xcb_out.c   27 Sep 2018 19:16:38 -
@@ -387,8 +387,14 @@ int xcb_take_socket(xcb_connection_t *c,
 {
 c->out.return_socket = return_socket;
 c->out.socket_closure = closure;
-if(flags)
-_xcb_in_expect_reply(c, c->out.request, 
WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
+if(flags) {
+/* c->out.request + 1 will be the first request sent by the 
external
+ * socket owner. If the socket is returned before this request is 
sent
+ * it will be detected in _xcb_in_replies_done and this 
pending_reply
+ * will be discarded.
+ */
+_xcb_in_expect_reply(c, c->out.request + 1, 
WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
+}
 assert(c->out.request == c->out.request_written);
 *sent = c->out.request;
 }
Index: lib/libxcb/src/Makefile
===
RCS file: /cvs/OpenBSD/xenocara/lib/libxcb/src/Makefile,v
retrieving revision 1.10
diff -u -p -u -r1.10 Makefile
--- lib/libxcb/src/Makefile 11 Sep 2018 19:34:57 -  1.10
+++ lib/libxcb/src/Makefile 27 Sep 2018 19:17:51 -
@@ -6,7 +6,7 @@
 DATADIR=   ${X11BASE}/share
 PYTHON=python${PYTHON_VERSION}
 
-MANOPTIONS=-c 'libxcb 1.13' -l 'X Version 11' -s 3
+MANOPTIONS=-c 'libxcb 1.13.1' -l 'X Version 11' -s 3
 
 SRCS= \
bigreq.c \
Index: lib/libxcb/src/config.h
===
RCS file: /cvs/OpenBSD/xenocara/lib/libxcb/src/config.h,v
retrieving revision 1.6
diff -u -p -u -r1.6 config.h
--- lib/libxcb/src/config.h 11 Sep 2018 19:34:57 -  1.6
+++ lib/libxcb/src/config.h 27 Sep 2018 19:18:59 -
@@ -77,7 +77,7 @@
 #define PACKAGE_NAME "libxcb"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libxcb 1.13"
+#define PACKAGE_STRING "libxcb 1.13.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libxcb"
@@ -86,7 +86,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.13"
+#define PACKAGE_VERSION "1.13.1"
 
 /* Major version of this package */
 #define PACKAGE_VERSION_MAJOR 1
@@ -95,7 +95,7 @@
 #define PACKAGE_VERSION_MINOR 13
 
 /* Patch version of this package */
-#define PACKAGE_VERSION_PATCHLEVEL 0
+#define PACKAGE_VERSION_PATCHLEVEL 1
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1

-- 
Matthieu Herrb



Re: [bugfix] xterm(1) needs "cpath" pledge(2)

2018-07-29 Thread Matthieu Herrb
On Sun, Jul 29, 2018 at 07:28:19AM +0200, Sebastien Marie wrote:
> Hi,
> 
> First, thanks to (trying) to search for solve the problem you encountered.
> 
> On Sat, Jul 28, 2018 at 10:08:04PM +0300, Leonid Bobrov wrote:
> > Hi!
> > 
> > Like I said yesterday, I don't know how to reproduce this bug, it just
> > happened to me and I got this dmesg(1):
> > xterm[90461]: pledge "cpath", syscall 5
> > 
> > Right now I quickly grep(1)'ed xterm(1)'s source code:
> > mazocomp$ egrep "mkdir\(|unlink\(|rmdir\(" -R . -n
> > ./misc.c:760:   && mkdir(filename, 0700) == 0) {
> > ./misc.c:804:   unlink(xterm_cursor_theme);
> > ./misc.c:805:   rmdir(my_path);
> > 
> 
> your search isn't accurate regarding the error message you got.
> 
> the pledge error in dmesg could be read as:
>   xterm (pid 90461) has been killed due to pledge violation.
>   the program tried to use syscall 5 using "cpath" promise, but it
>   didn't pledged for it.
> 
> what is the syscall 5 ?
> 
> $ grep '5$' /usr/include/sys/syscall.h
> #define SYS_open5
> 
> So it is an open(2) call which need "cpath".
> 
> if it needs "cpath", the flags argument of open(2) should contains
> O_CREAT:
> 
> kern/vfs_syscalls.c
>   1018  if (oflags & O_CREAT)
>   1019  ni_pledge |= PLEDGE_CPATH;
> 
> 
> so at some point after calling pledge(2), xterm called open(?, ?|O_CREAT).
> 
> it could be a direct call to open(2), or an indirect call (like calling
> fopen(3) with "w").
> 
> if you search in xterm code source, you should find several occurrences
> of such calls. But like deraadt@ told you, you should also ensure this
> call is effectively *after* the pledge call.
> 
> as hint, you know it seems to be triggerable from some keyboard
> combinaison. enumerating what xterm does by default for such things
> could help too to track the problem.
> 
> there is a open(2) call somewhere: the pledge violation is proof of
> that. but the solution isn't necessary to allow this file creation (by
> bindly extending the pledge promises). it could be to disallow the file
> creation.
> 
> but to decide, we should know *what* triggered this behaviour.

Hi,

After digging a bit, there is at least the 'Print All Immediatly'
function from button 1 menu that will trigger the creation of a file
and violate  the pledge.

see xtermPrintImmediately() in print.c:789. The fopen() itself appears
in charToPrinter() on line 498 of the same file.

Should this feature be disabled in xterm ?
-- 
Matthieu Herrb



Re: Remove i386 specific mention for pcvtfonts in hier.7

2018-07-11 Thread Matthieu Herrb
On Wed, Jul 11, 2018 at 10:34:39AM +0200, Frederic Cambus wrote:
> Hi tech@,
> 
> Remove the i386 specific mention for pcvtfonts, they are also installed
> on alpha and amd64.

I guess they could be installed on all archirectures. 
load_font is supported on many of them and the risk of forgetting to
add new ones to that Makefile is high :)

> 
> From share/misc/Makefile:
> 
> .if (${MACHINE} == "i386") || (${MACHINE} == "amd64") || \
> (${MACHINE} == "alpha")
> SUBDIR= pcvtfonts
> .endif
> 
> Comments? OK?
> 
> Index: share/man/man7/hier.7
> ===
> RCS file: /cvs/src/share/man/man7/hier.7,v
> retrieving revision 1.159
> diff -u -p -r1.159 hier.7
> --- share/man/man7/hier.7 8 Nov 2017 11:24:24 -   1.159
> +++ share/man/man7/hier.7 11 Jul 2018 08:24:33 -
> @@ -407,7 +407,7 @@ Miscellaneous system-wide ASCII text fil
>  Terminal characteristics database (see
>  .Xr termcap 5 ) .
>  .It pcvtfonts/
> -Additional i386 console fonts.
> +Additional console fonts.
>  .El
>  .Pp
>  .It mk/

-- 
Matthieu Herrb



xenodm: source Xsetup before initializing the greeter

2018-07-08 Thread Matthieu Herrb
Hi,

prompted by a question by weerd@ who wanted to be able to rotate the
screen of his gpd win *before* the Xenodm greeter is displayed, I came
up with this (simple) patch that sources the Xsetup_0 script before
initializing the greeter widget.

I can't think of any down sides of doing this, and it may even help
with some further pledges or privilege separation for the greeter.

ok ?

Index: greeter/greet.c
===
RCS file: /cvs/OpenBSD/xenocara/app/xenodm/greeter/greet.c,v
retrieving revision 1.5
diff -u -r1.5 greet.c
--- greeter/greet.c 6 May 2018 15:25:27 -   1.5
+++ greeter/greet.c 30 Jun 2018 08:51:44 -
@@ -301,13 +301,13 @@
 Argarglist[2];
 Display*dpy;
 
-dpy = InitGreet (d);
 /*
  * Run the setup script - note this usually will not work when
  * the server is grabbed, so we don't even bother trying.
  */
 if (!d->grabServer)
SetupDisplay (d);
+dpy = InitGreet (d);
 if (!dpy) {
LogError ("Cannot reopen display %s for greet window\n", d->name);
exit (RESERVER_DISPLAY);

-- 
Matthieu Herrb



Re: DRI3/prime kernel implementation for OpenBSD

2018-06-21 Thread Matthieu Herrb
On Wed, Jun 20, 2018 at 08:55:39PM +0200, Mark Kettenis wrote:
> This diff adds DRI3/prime support to the OpenBSD kernel.  The whole
> idea behind this is to allow graphics buffers to be exchanged between
> processes (typically X client and X server) by passing file
> descriptors.  The curremt (DRI2) method of exchanging graphics buffers
> uses guessable 32-bit integers.  That means that it is fairly easy for
> other applications running on the machine to snoop the contents of a
> graphics buffer.  Apart from the improved security, this also gets us
> to execute the code paths in X, Mesa, etc. that Linux uses.  Hopefully
> that makes us less susceptible to bugs in the abandoned codepaths.
> 
> This diff explicitly does not enable sharing of graphics buffers
> between graphics cards.  That aspect of DRI3 needs more work.  It
> would be pretty pointless at this point anyway since this only enables
> the feature for inteldrm(4).
> 
> To actually use this, a xenocara patch is needed as well.  I'll post
> that one in a separate message.
> 
> I've used this quite extensively now on my own laptop for a while.  It
> works fine with pledged Chrome and pledged Firefox.  Now this collides
> heavily with the file descriptor unlocking work that mpi@ is doing.
> Still, I'd like to get this in soonish such that this can be widely
> tested and won't ruin g2k18.

Together with enabling the bits in xenocara this also works for me on
my X240. I'm seeing videos causing firefox tabs to crash, but I'm not
sure if its related to dri3 or firefox's pleges or something else.

Videos play fine in chrome and with the gld river  in mplayer.

Thanks,
-- 
Matthieu Herrb



  1   2   3   >