On Sat Oct 10, 2026 at 10:17 PM EDT, Andrew Kloet wrote: > Hello ports@ > > This diff updates x11/slock 1.5.0 -> 1.7.0 > > Port changes: > * Most Makefile nits have been upstreamed. > * Moved HAVE_BSD_AUTH guard to mask unused variables. > * Added pledge/unveil... > Due to post-lock cmd we have to lock unveil late. > HEAD removed post-lock cmd which will let us lock immediately.
My pledge additions seem to have broken some behaviour. Maybe needs more TLC before adopting pledge. Here is the diff sans-pledge: diff --git a/x11/slock/Makefile b/x11/slock/Makefile index 33b2d85ec..95e80912e 100644 --- a/x11/slock/Makefile +++ b/x11/slock/Makefile @@ -1,6 +1,6 @@ COMMENT= simple X screen locker -DISTNAME= slock-1.5 +DISTNAME= slock-1.7 CATEGORIES= x11 @@ -11,6 +11,7 @@ MAINTAINER= Gleydson Soares <[email protected]> # BSD PERMIT_PACKAGE= Yes +# uses unveil() WANTLIB= X11 c Xext Xrandr SITES= http://dl.suckless.org/tools/ diff --git a/x11/slock/distinfo b/x11/slock/distinfo index 733233143..3f2ac7d95 100644 --- a/x11/slock/distinfo +++ b/x11/slock/distinfo @@ -1,2 +1,2 @@ -SHA256 (slock-1.5.tar.gz) = ruHj+/aid/tiWjg4BzuXm2SD57rKTOgvVt4f8ZLbDk0= -SIZE (slock-1.5.tar.gz) = 6898 +SHA256 (slock-1.7.tar.gz) = mXEea0GbIhrp/D6cjzHmsWjbURVCeJlvPQLOZcwZgwE= +SIZE (slock-1.7.tar.gz) = 7240 diff --git a/x11/slock/patches/patch-Makefile b/x11/slock/patches/patch-Makefile index 0274d88e7..05473e614 100644 --- a/x11/slock/patches/patch-Makefile +++ b/x11/slock/patches/patch-Makefile @@ -1,39 +1,17 @@ Index: Makefile --- Makefile.orig +++ Makefile -@@ -15,8 +15,7 @@ options: - @echo "CC = ${CC}" - - .c.o: -- @echo CC $< -- @${CC} -c ${CFLAGS} $< -+ ${CC} -c ${CFLAGS} $< - - ${OBJ}: config.h config.mk arg.h util.h - -@@ -25,8 +24,7 @@ config.h: - @cp config.def.h $@ - - slock: ${OBJ} -- @echo CC -o $@ -- @${CC} -o $@ ${OBJ} ${LDFLAGS} -+ ${CC} -o $@ ${OBJ} ${LDFLAGS} - - clean: - @echo cleaning -@@ -42,15 +40,12 @@ dist: clean - @rm -rf slock-${VERSION} +@@ -31,13 +31,12 @@ dist: clean + rm -rf slock-${VERSION} install: all -- @echo installing executable file to ${DESTDIR}${PREFIX}/bin -- @mkdir -p ${DESTDIR}${PREFIX}/bin -- @cp -f slock ${DESTDIR}${PREFIX}/bin -- @chmod 755 ${DESTDIR}${PREFIX}/bin/slock -- @chmod u+s ${DESTDIR}${PREFIX}/bin/slock -- @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 -- @mkdir -p ${DESTDIR}${MANPREFIX}/man1 -- @sed "s/VERSION/${VERSION}/g" <slock.1 >${DESTDIR}${MANPREFIX}/man1/slock.1 -- @chmod 644 ${DESTDIR}${MANPREFIX}/man1/slock.1 +- mkdir -p ${DESTDIR}${PREFIX}/bin +- cp -f slock ${DESTDIR}${PREFIX}/bin +- chmod 755 ${DESTDIR}${PREFIX}/bin/slock +- chmod u+s ${DESTDIR}${PREFIX}/bin/slock +- mkdir -p ${DESTDIR}${MANPREFIX}/man1 +- sed "s/VERSION/${VERSION}/g" <slock.1 >${DESTDIR}${MANPREFIX}/man1/slock.1 +- chmod 644 ${DESTDIR}${MANPREFIX}/man1/slock.1 + ${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin + ${BSD_INSTALL_PROGRAM} slock ${DESTDIR}${PREFIX}/bin + ${BSD_INSTALL_MAN_DIR} ${DESTDIR}${MANPREFIX}/man1 @@ -42,4 +20,4 @@ Index: Makefile + ${BSD_INSTALL_MAN} slock.1 ${DESTDIR}${MANPREFIX}/man1 uninstall: - @echo removing executable file from ${DESTDIR}${PREFIX}/bin + rm -f ${DESTDIR}${PREFIX}/bin/slock diff --git a/x11/slock/patches/patch-slock_c b/x11/slock/patches/patch-slock_c index fa650f778..033ca2d16 100644 --- a/x11/slock/patches/patch-slock_c +++ b/x11/slock/patches/patch-slock_c @@ -3,7 +3,7 @@ Add back bsd-auth support, removed in 04143fd68dbc Index: slock.c --- slock.c.orig +++ slock.c -@@ -19,6 +19,11 @@ +@@ -20,6 +20,11 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> @@ -15,7 +15,7 @@ Index: slock.c #include "arg.h" #include "util.h" -@@ -83,6 +88,7 @@ dontkillme(void) +@@ -84,6 +89,7 @@ dontkillme(void) } #endif @@ -23,7 +23,7 @@ Index: slock.c static const char * gethash(void) { -@@ -123,13 +129,21 @@ gethash(void) +@@ -124,13 +130,21 @@ gethash(void) return hash; } @@ -46,7 +46,7 @@ Index: slock.c int num, screen, running, failure, oldc; unsigned int len, color; KeySym ksym; -@@ -160,10 +174,14 @@ readpw(Display *dpy, struct xrandr *rr, struct lock ** +@@ -161,10 +175,14 @@ readpw(Display *dpy, struct xrandr *rr, struct lock ** case XK_Return: passwd[len] = '\0'; errno = 0; @@ -61,17 +61,35 @@ Index: slock.c if (running) { XBell(dpy, 100); failure = 1; -@@ -303,7 +321,9 @@ main(int argc, char **argv) { +@@ -311,11 +329,13 @@ int + main(int argc, char **argv) { + struct xrandr rr; + struct lock **locks; ++#ifndef HAVE_BSD_AUTH + struct passwd *pwd; struct group *grp; uid_t duid; gid_t dgid; -+#ifndef HAVE_BSD_AUTH const char *hash; +#endif Display *dpy; int s, nlocks, nscreens; -@@ -331,14 +351,23 @@ main(int argc, char **argv) { +@@ -327,6 +347,7 @@ main(int argc, char **argv) { + usage(); + } ARGEND + ++#ifndef HAVE_BSD_AUTH + /* validate drop-user and -group */ + errno = 0; + if (!(pwd = getpwnam(user))) +@@ -338,19 +359,29 @@ main(int argc, char **argv) { + die("slock: getgrnam %s: %s\n", group, + errno ? strerror(errno) : "group entry not found"); + dgid = grp->gr_gid; ++#endif + + #ifdef __linux__ dontkillme(); #endif @@ -95,7 +113,7 @@ Index: slock.c /* drop privileges */ if (setgroups(0, NULL) < 0) die("slock: setgroups: %s\n", strerror(errno)); -@@ -346,6 +375,7 @@ main(int argc, char **argv) { +@@ -358,6 +389,7 @@ main(int argc, char **argv) { die("slock: setgid: %s\n", strerror(errno)); if (setuid(duid) < 0) die("slock: setuid: %s\n", strerror(errno)); @@ -103,9 +121,13 @@ Index: slock.c /* check for Xrandr support */ rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase); -@@ -381,7 +411,11 @@ main(int argc, char **argv) { +@@ -389,8 +421,15 @@ main(int argc, char **argv) { + } } ++ if (unveil(NULL, NULL) == -1) ++ die("slock: unveil: %s\n", strerror(errno)); ++ /* everything is now blank. Wait for the correct password */ +#ifdef HAVE_BSD_AUTH + readpw(dpy, &rr, locks, nscreens);
signature.asc
Description: PGP signature
