svn commit: r409502 - in head/x11/slock: . files
Raphael Kubo da Costa
rakuco at FreeBSD.org
Thu Feb 25 10:13:30 UTC 2016
Author: rakuco
Date: Thu Feb 25 10:13:28 2016
New Revision: 409502
URL: https://svnweb.freebsd.org/changeset/ports/409502
Log:
Update to 1.3.
PR: 207289
Submitted by: Chris Hutchinson <portmaster at bsdforge.com> (maintainer)
Added:
head/x11/slock/files/patch-config.mk (contents, props changed)
head/x11/slock/files/patch-slock.c (contents, props changed)
Deleted:
head/x11/slock/files/patch-pam
Modified:
head/x11/slock/Makefile
head/x11/slock/distinfo
head/x11/slock/pkg-plist
Modified: head/x11/slock/Makefile
==============================================================================
--- head/x11/slock/Makefile Thu Feb 25 10:03:17 2016 (r409501)
+++ head/x11/slock/Makefile Thu Feb 25 10:13:28 2016 (r409502)
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= slock
-PORTVERSION= 1.2
-PORTREVISION= 1
+PORTVERSION= 1.3
CATEGORIES= x11
MASTER_SITES= http://dl.suckless.org/tools/
@@ -15,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cpe
CPE_VENDOR= suckless
-USE_XORG= x11 xt xproto xext
+USE_XORG= x11 xext xproto xrandr xt
MAKE_ARGS= PREFIX="${PREFIX}" X11LIB="${LOCALBASE}/lib" \
X11INC="${LOCALBASE}/include" CC="${CC}" \
MANPREFIX="${MANPREFIX}/man"
Modified: head/x11/slock/distinfo
==============================================================================
--- head/x11/slock/distinfo Thu Feb 25 10:03:17 2016 (r409501)
+++ head/x11/slock/distinfo Thu Feb 25 10:13:28 2016 (r409502)
@@ -1,2 +1,2 @@
-SHA256 (slock-1.2.tar.gz) = 3402658f890a88da3f34db04fca1783ed549ade45c2ebb8d8f0cd2b549f633b3
-SIZE (slock-1.2.tar.gz) = 4853
+SHA256 (slock-1.3.tar.gz) = bab4a3aea4046aa0fd0361c3649b79b90ca531bc5dfae3c4a6c0fe436152bd18
+SIZE (slock-1.3.tar.gz) = 5943
Added: head/x11/slock/files/patch-config.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/x11/slock/files/patch-config.mk Thu Feb 25 10:13:28 2016 (r409502)
@@ -0,0 +1,11 @@
+--- 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}
+
++# 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
Added: head/x11/slock/files/patch-slock.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/x11/slock/files/patch-slock.c Thu Feb 25 10:13:28 2016 (r409502)
@@ -0,0 +1,104 @@
+--- 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);
Modified: head/x11/slock/pkg-plist
==============================================================================
--- head/x11/slock/pkg-plist Thu Feb 25 10:03:17 2016 (r409501)
+++ head/x11/slock/pkg-plist Thu Feb 25 10:13:28 2016 (r409502)
@@ -1 +1,2 @@
@(,,4755) bin/slock
+man/man1/slock.1.gz
More information about the svn-ports-head
mailing list