aboutsummaryrefslogtreecommitdiff
path: root/x11/slock
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2017-02-24 17:14:38 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2017-02-24 17:14:38 +0000
commit00d6b428b3a993d81ed65db421f9e3bf74dc1722 (patch)
treefecc0721eb6d352ee9883baa97fbc7b3645e0f80 /x11/slock
parentfbcdef4829d331657f0a54143eeb5211720b32f9 (diff)
downloadports-00d6b428b3a993d81ed65db421f9e3bf74dc1722.tar.gz
ports-00d6b428b3a993d81ed65db421f9e3bf74dc1722.zip
Notes
Diffstat (limited to 'x11/slock')
-rw-r--r--x11/slock/Makefile2
-rw-r--r--x11/slock/distinfo5
-rw-r--r--x11/slock/files/patch-config.mk16
-rw-r--r--x11/slock/files/patch-slock.c104
4 files changed, 13 insertions, 114 deletions
diff --git a/x11/slock/Makefile b/x11/slock/Makefile
index dc017b70cbe5..70683de36530 100644
--- a/x11/slock/Makefile
+++ b/x11/slock/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= slock
-PORTVERSION= 1.3
+PORTVERSION= 1.4
CATEGORIES= x11
MASTER_SITES= http://dl.suckless.org/tools/
diff --git a/x11/slock/distinfo b/x11/slock/distinfo
index b82c9d0c5c3f..97f456375ac0 100644
--- a/x11/slock/distinfo
+++ b/x11/slock/distinfo
@@ -1,2 +1,3 @@
-SHA256 (slock-1.3.tar.gz) = bab4a3aea4046aa0fd0361c3649b79b90ca531bc5dfae3c4a6c0fe436152bd18
-SIZE (slock-1.3.tar.gz) = 5943
+TIMESTAMP = 1487670784
+SHA256 (slock-1.4.tar.gz) = b53849dbc60109a987d7a49b8da197305c29307fd74c12dc18af0d3044392e6a
+SIZE (slock-1.4.tar.gz) = 6889
diff --git a/x11/slock/files/patch-config.mk b/x11/slock/files/patch-config.mk
index dca389751d17..0cb87fe91040 100644
--- a/x11/slock/files/patch-config.mk
+++ b/x11/slock/files/patch-config.mk
@@ -1,11 +1,13 @@
---- config.mk.orig 2013-10-09 16:23:24.000000000 +0200
-+++ config.mk 2013-10-09 16:25:18.000000000 +0200
-@@ -18,6 +18,9 @@
- CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
- LDFLAGS = -s ${LIBS}
+--- config.mk.orig 2016-11-20 00:31:23 UTC
++++ config.mk
+@@ -22,6 +22,10 @@ COMPATSRC = explicit_bzero.c
+ # On OpenBSD and Darwin remove -lcrypt from LIBS
+ #LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lXext -lXrandr
++
+# To enable PAM-based authentication, remove -DHAVE_SHADOW_H from CPPFLAGS
+# and add -DHAVE_PAM instead. Also, add -lpam to LDFLAGS.
+#
- # On *BSD remove -DHAVE_SHADOW_H from CPPFLAGS and add -DHAVE_BSD_AUTH
- # On OpenBSD and Darwin remove -lcrypt from LIBS
+ # On *BSD remove -DHAVE_SHADOW_H from CPPFLAGS
+ # On NetBSD add -D_NETBSD_SOURCE to CPPFLAGS
+ #CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE -D_NETBSD_SOURCE
diff --git a/x11/slock/files/patch-slock.c b/x11/slock/files/patch-slock.c
deleted file mode 100644
index 61797d0797b1..000000000000
--- a/x11/slock/files/patch-slock.c
+++ /dev/null
@@ -1,104 +0,0 @@
---- slock.c.orig 2016-02-17 12:36:44.640577000 -0800
-+++ slock.c 2016-02-17 12:48:20.966625000 -0800
-@@ -23,6 +23,10 @@
- #include <bsd_auth.h>
- #endif
-
-+#if HAVE_PAM
-+#include <security/pam_appl.h>
-+#endif
-+
- enum {
- INIT,
- INPUT,
-@@ -85,7 +89,7 @@
- }
- #endif
-
--#ifndef HAVE_BSD_AUTH
-+#if !defined(HAVE_BSD_AUTH) && !defined(HAVE_PAM)
- /* only run as root */
- static const char *
- getpw(void)
-@@ -119,8 +123,41 @@
- }
- #endif
-
-+#ifdef HAVE_PAM
-+static int
-+slock_conv (int nof_msg, const struct pam_message **msg, struct pam_response **resp, void *data) {
-+ struct pam_response *r = calloc (nof_msg, sizeof **resp);
-+ if (r == NULL) {
-+ die("slock: malloc: %s", strerror(errno));
-+ }
-+
-+ while (nof_msg--) {
-+ r[nof_msg].resp_retcode = 0;
-+ r[nof_msg].resp = strdup (data);
-+ }
-+
-+ *resp = r;
-+
-+ return PAM_SUCCESS;
-+}
-+
-+static int
-+auth_pam (const char *user, char *pass) {
-+ static struct pam_conv conv = {slock_conv, NULL};
-+ pam_handle_t *ph;
-+
-+ conv.appdata_ptr = pass;
-+
-+ if (pam_start("slock", user, &conv, &ph) != PAM_SUCCESS) {
-+ die("slock: pam_start");
-+ }
-+
-+ return (pam_authenticate(ph, 0) == PAM_SUCCESS);
-+}
-+#endif
-+
- static void
--#ifdef HAVE_BSD_AUTH
-+#if defined(HAVE_BSD_AUTH) || defined(HAVE_PAM)
- readpw(Display *dpy)
- #else
- readpw(Display *dpy, const char *pws)
-@@ -159,8 +196,10 @@
- switch (ksym) {
- case XK_Return:
- passwd[len] = 0;
--#ifdef HAVE_BSD_AUTH
-+#if defined (HAVE_BSD_AUTH)
- running = !auth_userokay(getlogin(), NULL, "auth-xlock", passwd);
-+#elif defined (HAVE_PAM)
-+ running = !auth_pam(getlogin(), passwd);
- #else
- running = !!strcmp(crypt(passwd, pws), pws);
- #endif
-@@ -289,7 +328,7 @@
-
- int
- main(int argc, char **argv) {
--#ifndef HAVE_BSD_AUTH
-+#if !defined(HAVE_BSD_AUTH) && !defined(HAVE_PAM)
- const char *pws;
- #endif
- Display *dpy;
-@@ -308,7 +347,7 @@
- if (!getpwuid(getuid()))
- die("slock: no passwd entry for you\n");
-
--#ifndef HAVE_BSD_AUTH
-+#if !defined(HAVE_BSD_AUTH) && !defined(HAVE_PAM)
- pws = getpw();
- #endif
-
-@@ -341,7 +380,7 @@
- }
-
- /* Everything is now blank. Now wait for the correct password. */
--#ifdef HAVE_BSD_AUTH
-+#if defined(HAVE_BSD_AUTH) || defined(HAVE_PAM)
- readpw(dpy);
- #else
- readpw(dpy, pws);