Re: slock 1.4 / bsd-auth

2020-05-24 Thread Stuart Henderson
On 2020/05/21 13:49, Theo Buehler wrote:
> On Thu, May 21, 2020 at 11:58:37AM +0100, Stuart Henderson wrote:
> > I've written a patch to add bsd-auth support back to slock 1.4 which
> > I've been using for a while. Tidied the make variable handling a bit
> > as well, no need to patch to use ?=, they can just be overridden with
> > MAKE_FLAGS. OK?
> 
> I would prefer if this used the libc version of explicit_bzero instead
> of the local copy. For this, set COMPATSRC to empty in compat.mk (why do
> you add a COPTSFLAG=-Os via a patch?).

I wanted to keep the patched Makefile doing the same thing as the original,
just allowing optimizer flags to be changed without having to copy the set of
standard flags to the port.

> Out of curiosity: what prompted this update?

I wanted to try jcs's modified version that adds DPMS support (which was forked
after bsd-auth was removed) so I had to add that back in. And having done that
I though I might as well send a diff for the port.

On 2020/05/23 20:40, Gleydson Soares wrote:
> On Thu, May 21, 2020 at 01:49:36PM +0200, Theo Buehler wrote:
> > While the updated slock seems to work fine from the command line, it
> > doesn't lock at all if I use it from a i3 binding.  I have been using
> > 
> > bindsym $mod+Mod1+l exec "slock"
> 
> It happens with some X11 apps that request the mouse pointer right away, 
> but it is grabbed so it fails, 
> 
> You can fix it changing your bindkey to something like:
> "bindsym --release $mod+Mod1+l exec "sleep 0.5 ; slock"
> 
> Actually, i3 has a feature for dealing with it though, --release:
> try better: bindsym --release $mod+Mod1+l exec "slock"

Thanks for tracking that down + the workaround!




Re: slock 1.4 / bsd-auth

2020-05-24 Thread Gleydson Soares
On Sun, May 24, 2020 at 02:15:58AM +0200, Theo Buehler wrote:
> > Actually, i3 has a feature for dealing with it though, --release:
> > try better: bindsym --release $mod+Mod1+l exec "slock"
> 
> That works, thanks. I'm fine with this going in if the port's copy of
> explicit_bzero is disabled with "COMPATSRC=".

sthen@
You have my OK either way, with or w/o COMPATSRC stuff tweak
requested by tb@



Re: slock 1.4 / bsd-auth

2020-05-23 Thread Theo Buehler
> Actually, i3 has a feature for dealing with it though, --release:
> try better: bindsym --release $mod+Mod1+l exec "slock"

That works, thanks. I'm fine with this going in if the port's copy of
explicit_bzero is disabled with "COMPATSRC=".



Re: slock 1.4 / bsd-auth

2020-05-23 Thread Gleydson Soares
On Thu, May 21, 2020 at 01:49:36PM +0200, Theo Buehler wrote:
> On Thu, May 21, 2020 at 11:58:37AM +0100, Stuart Henderson wrote:
> > I've written a patch to add bsd-auth support back to slock 1.4 which
> > I've been using for a while. Tidied the make variable handling a bit
> > as well, no need to patch to use ?=, they can just be overridden with
> > MAKE_FLAGS. OK?
> 
> I would prefer if this used the libc version of explicit_bzero instead
> of the local copy. For this, set COMPATSRC to empty in compat.mk (why do
> you add a COPTSFLAG=-Os via a patch?).
> 
> While the updated slock seems to work fine from the command line, it
> doesn't lock at all if I use it from a i3 binding.  I have been using
> 
>   bindsym $mod+Mod1+l exec "slock"

It happens with some X11 apps that request the mouse pointer right away, 
but it is grabbed so it fails, 

You can fix it changing your bindkey to something like:
"bindsym --release $mod+Mod1+l exec "sleep 0.5 ; slock"

Actually, i3 has a feature for dealing with it though, --release:
try better: bindsym --release $mod+Mod1+l exec "slock"



Re: slock 1.4 / bsd-auth

2020-05-23 Thread Gleydson Soares
On Thu, May 21, 2020 at 11:58:37AM +0100, Stuart Henderson wrote:
> I've written a patch to add bsd-auth support back to slock 1.4 which
> I've been using for a while. Tidied the make variable handling a bit
> as well, no need to patch to use ?=, they can just be overridden with
> MAKE_FLAGS. OK?

OK gsoares@



Re: slock 1.4 / bsd-auth

2020-05-21 Thread Theo Buehler
On Thu, May 21, 2020 at 11:58:37AM +0100, Stuart Henderson wrote:
> I've written a patch to add bsd-auth support back to slock 1.4 which
> I've been using for a while. Tidied the make variable handling a bit
> as well, no need to patch to use ?=, they can just be overridden with
> MAKE_FLAGS. OK?

I would prefer if this used the libc version of explicit_bzero instead
of the local copy. For this, set COMPATSRC to empty in compat.mk (why do
you add a COPTSFLAG=-Os via a patch?).

While the updated slock seems to work fine from the command line, it
doesn't lock at all if I use it from a i3 binding.  I have been using

bindsym $mod+Mod1+l exec "slock"

in my ~/.i3/config for many years without issue, but this breaks with
this update. In my xsession-errors I see:

slock: unable to grab mouse pointer for screen 0
slock: unable to grab keyboard for screen 0

I haven't looked more closely into why this happens, but I would
appreciate a workaround for this so I can keep a binding for the lock.

Out of curiosity: what prompted this update?

> 
> Index: Makefile
> ===
> RCS file: /cvs/ports/x11/slock/Makefile,v
> retrieving revision 1.17
> diff -u -p -r1.17 Makefile
> --- Makefile  12 Jul 2019 20:51:21 -  1.17
> +++ Makefile  21 May 2020 10:58:17 -
> @@ -2,9 +2,7 @@
>  
>  COMMENT= simple X screen locker
>  
> -# slock-1.4 drops bsd-auth support; CVE-2016-6866 doesn't affect 
> HAVE_BSD_AUTH
> -DISTNAME=slock-1.3
> -REVISION=1
> +DISTNAME=slock-1.4
>  
>  CATEGORIES=  x11
>  
> @@ -19,9 +17,11 @@ WANTLIB=   X11 c Xext Xrandr
>  
>  MASTER_SITES=http://dl.suckless.org/tools/
>  
> -MAKE_ENV=CC="${CC}" \
> - LDFLAGS="${LDFLAGS}"
> -FAKE_FLAGS=  DESTDIR=""
> +MAKE_FLAGS=  CC="${CC}" \
> + COPTFLAGS="${CFLAGS}" \
> + MANPREFIX=${PREFIX}/man \
> + X11INC=${X11BASE}/include \
> + X11LIB=${X11BASE}/lib
>  
>  NO_TEST= Yes
>  
> Index: distinfo
> ===
> RCS file: /cvs/ports/x11/slock/distinfo,v
> retrieving revision 1.10
> diff -u -p -r1.10 distinfo
> --- distinfo  5 Mar 2016 19:17:01 -   1.10
> +++ distinfo  21 May 2020 10:58:17 -
> @@ -1,2 +1,2 @@
> -SHA256 (slock-1.3.tar.gz) = urSjrqQEaqD9A2HDZJt5uQylMbxd+uPEpsD+Q2FSvRg=
> -SIZE (slock-1.3.tar.gz) = 5943
> +SHA256 (slock-1.4.tar.gz) = tThJ28YBCamH16SbjaGXMFwpMH/XTBLcGK8NMEQ5Lmo=
> +SIZE (slock-1.4.tar.gz) = 6889
> Index: patches/patch-Makefile
> ===
> RCS file: /cvs/ports/x11/slock/patches/patch-Makefile,v
> retrieving revision 1.5
> diff -u -p -r1.5 patch-Makefile
> --- patches/patch-Makefile5 Mar 2016 19:17:01 -   1.5
> +++ patches/patch-Makefile21 May 2020 10:58:17 -
> @@ -1,6 +1,8 @@
> -$OpenBSD: patch-Makefile,v 1.5 2016/03/05 19:17:01 jung Exp $
>  Makefile.origFri Feb 12 20:29:02 2016
> -+++ Makefile Fri Feb 26 21:06:04 2016
> +$OpenBSD$
> +
> +Index: Makefile
> +--- Makefile.orig
>  Makefile
>  @@ -15,8 +15,7 @@ options:
>   @echo "CC   = ${CC}"
>   
> @@ -9,7 +11,7 @@ $OpenBSD: patch-Makefile,v 1.5 2016/03/0
>  -@${CC} -c ${CFLAGS} $<
>  +${CC} -c ${CFLAGS} $<
>   
> - ${OBJ}: config.h config.mk
> + ${OBJ}: config.h config.mk arg.h util.h
>   
>  @@ -25,8 +24,7 @@ config.h:
>   @cp config.def.h $@
> Index: patches/patch-config_def_h
> ===
> RCS file: patches/patch-config_def_h
> diff -N patches/patch-config_def_h
> --- patches/patch-config_def_h5 Mar 2016 19:17:01 -   1.2
> +++ /dev/null 1 Jan 1970 00:00:00 -
> @@ -1,11 +0,0 @@
> -$OpenBSD: patch-config_def_h,v 1.2 2016/03/05 19:17:01 jung Exp $
>  config.def.h.origFri Feb 12 20:29:02 2016
> -+++ config.def.h Fri Feb 26 20:57:47 2016
> -@@ -1,6 +1,6 @@
> - static const char *colorname[NUMCOLS] = {
> - "black", /* after initialization */
> --"#005577",   /* during input */
> -+"#404040",   /* during input */
> - "#CC",   /* failed/cleared the input */
> - };
> - static const Bool failonclear = True;
> Index: patches/patch-config_mk
> ===
> RCS file: /cvs/ports/x11/slock/patches/patch-config_mk,v
> retrieving revision 1.9
> diff -u -p -r1.9 patch-config_mk
> --- patches/patch-config_mk   13 Aug 2016 14:00:00 -  1.9
> +++ patches/patch-config_mk   21 May 2020 10:58:17 -
> @@ -1,44 +1,23 @@
> -$OpenBSD: patch-config_mk,v 1.9 2016/08/13 14:00:00 tb Exp $
>  config.mk.orig   Fri Feb 12 20:29:02 2016
> -+++ config.mkSat Aug 13 15:38:13 2016
> -@@ -4,28 +4,28 @@ VERSION = 1.3
> - # Customize below to fit your system
> - 
> - # 

slock 1.4 / bsd-auth

2020-05-21 Thread Stuart Henderson
I've written a patch to add bsd-auth support back to slock 1.4 which
I've been using for a while. Tidied the make variable handling a bit
as well, no need to patch to use ?=, they can just be overridden with
MAKE_FLAGS. OK?

Index: Makefile
===
RCS file: /cvs/ports/x11/slock/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile12 Jul 2019 20:51:21 -  1.17
+++ Makefile21 May 2020 10:58:17 -
@@ -2,9 +2,7 @@
 
 COMMENT=   simple X screen locker
 
-# slock-1.4 drops bsd-auth support; CVE-2016-6866 doesn't affect HAVE_BSD_AUTH
-DISTNAME=  slock-1.3
-REVISION=  1
+DISTNAME=  slock-1.4
 
 CATEGORIES=x11
 
@@ -19,9 +17,11 @@ WANTLIB= X11 c Xext Xrandr
 
 MASTER_SITES=  http://dl.suckless.org/tools/
 
-MAKE_ENV=  CC="${CC}" \
-   LDFLAGS="${LDFLAGS}"
-FAKE_FLAGS=DESTDIR=""
+MAKE_FLAGS=CC="${CC}" \
+   COPTFLAGS="${CFLAGS}" \
+   MANPREFIX=${PREFIX}/man \
+   X11INC=${X11BASE}/include \
+   X11LIB=${X11BASE}/lib
 
 NO_TEST=   Yes
 
Index: distinfo
===
RCS file: /cvs/ports/x11/slock/distinfo,v
retrieving revision 1.10
diff -u -p -r1.10 distinfo
--- distinfo5 Mar 2016 19:17:01 -   1.10
+++ distinfo21 May 2020 10:58:17 -
@@ -1,2 +1,2 @@
-SHA256 (slock-1.3.tar.gz) = urSjrqQEaqD9A2HDZJt5uQylMbxd+uPEpsD+Q2FSvRg=
-SIZE (slock-1.3.tar.gz) = 5943
+SHA256 (slock-1.4.tar.gz) = tThJ28YBCamH16SbjaGXMFwpMH/XTBLcGK8NMEQ5Lmo=
+SIZE (slock-1.4.tar.gz) = 6889
Index: patches/patch-Makefile
===
RCS file: /cvs/ports/x11/slock/patches/patch-Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 patch-Makefile
--- patches/patch-Makefile  5 Mar 2016 19:17:01 -   1.5
+++ patches/patch-Makefile  21 May 2020 10:58:17 -
@@ -1,6 +1,8 @@
-$OpenBSD: patch-Makefile,v 1.5 2016/03/05 19:17:01 jung Exp $
 Makefile.orig  Fri Feb 12 20:29:02 2016
-+++ Makefile   Fri Feb 26 21:06:04 2016
+$OpenBSD$
+
+Index: Makefile
+--- Makefile.orig
 Makefile
 @@ -15,8 +15,7 @@ options:
@echo "CC   = ${CC}"
  
@@ -9,7 +11,7 @@ $OpenBSD: patch-Makefile,v 1.5 2016/03/0
 -  @${CC} -c ${CFLAGS} $<
 +  ${CC} -c ${CFLAGS} $<
  
- ${OBJ}: config.h config.mk
+ ${OBJ}: config.h config.mk arg.h util.h
  
 @@ -25,8 +24,7 @@ config.h:
@cp config.def.h $@
Index: patches/patch-config_def_h
===
RCS file: patches/patch-config_def_h
diff -N patches/patch-config_def_h
--- patches/patch-config_def_h  5 Mar 2016 19:17:01 -   1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,11 +0,0 @@
-$OpenBSD: patch-config_def_h,v 1.2 2016/03/05 19:17:01 jung Exp $
 config.def.h.orig  Fri Feb 12 20:29:02 2016
-+++ config.def.h   Fri Feb 26 20:57:47 2016
-@@ -1,6 +1,6 @@
- static const char *colorname[NUMCOLS] = {
-   "black", /* after initialization */
--  "#005577",   /* during input */
-+  "#404040",   /* during input */
-   "#CC",   /* failed/cleared the input */
- };
- static const Bool failonclear = True;
Index: patches/patch-config_mk
===
RCS file: /cvs/ports/x11/slock/patches/patch-config_mk,v
retrieving revision 1.9
diff -u -p -r1.9 patch-config_mk
--- patches/patch-config_mk 13 Aug 2016 14:00:00 -  1.9
+++ patches/patch-config_mk 21 May 2020 10:58:17 -
@@ -1,44 +1,23 @@
-$OpenBSD: patch-config_mk,v 1.9 2016/08/13 14:00:00 tb Exp $
 config.mk.orig Fri Feb 12 20:29:02 2016
-+++ config.mk  Sat Aug 13 15:38:13 2016
-@@ -4,28 +4,28 @@ VERSION = 1.3
- # Customize below to fit your system
- 
- # paths
--PREFIX = /usr/local
--MANPREFIX = ${PREFIX}/share/man
-+PREFIX ?= /usr/local
-+MANPREFIX = ${PREFIX}/man
- 
--X11INC = /usr/X11R6/include
--X11LIB = /usr/X11R6/lib
-+X11INC = ${X11BASE}/include
-+X11LIB = ${X11BASE}/lib
+$OpenBSD$
+
+Index: config.mk
+--- config.mk.orig
 config.mk
+@@ -12,12 +12,13 @@ X11LIB = /usr/X11R6/lib
  
  # includes and libs
--INCS = -I. -I/usr/include -I${X11INC}
+ INCS = -I. -I/usr/include -I${X11INC}
 -LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr
-+INCS = -I${X11INC}
-+LIBS = -L${X11LIB} -lX11 -lXext -lXrandr
++LIBS = -L/usr/lib -L${X11LIB} -lX11 -lXext -lXrandr
  
  # flags
--CPPFLAGS = -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
+-CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H
 -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
 -LDFLAGS = -s ${LIBS}
-+CPPFLAGS += -DVERSION=\"${VERSION}\" -DHAVE_BSD_AUTH -D_BSD_SOURCE
-+CFLAGS += -std=c99 -pedantic -Wall ${INCS} ${CPPFLAGS}
-+LDFLAGS += ${LIBS}