Index: slock/Makefile =================================================================== --- slock/Makefile (revision 409069) +++ slock/Makefile (working copy) @@ -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 @@ 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" Index: slock/distinfo =================================================================== --- slock/distinfo (revision 409069) +++ slock/distinfo (working copy) @@ -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 Index: slock/files/patch-config.mk =================================================================== --- slock/files/patch-config.mk (nonexistent) +++ slock/files/patch-config.mk (working copy) @@ -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 Property changes on: slock/files/patch-config.mk ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: slock/files/patch-pam =================================================================== --- slock/files/patch-pam (revision 409069) +++ slock/files/patch-pam (nonexistent) @@ -1,116 +0,0 @@ ---- 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 - ---- slock.c.orig 2013-10-09 16:23:14.000000000 +0200 -+++ slock.c 2013-10-09 16:23:18.000000000 +0200 -@@ -23,6 +23,10 @@ - #include - #endif - -+#if HAVE_PAM -+#include -+#endif -+ - typedef struct { - int screen; - Window root, win; -@@ -44,7 +48,7 @@ - exit(EXIT_FAILURE); - } - --#ifndef HAVE_BSD_AUTH -+#if !defined(HAVE_BSD_AUTH) && !defined(HAVE_PAM) - static const char * - getpw(void) { /* only run as root */ - const char *rval; -@@ -74,8 +78,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) -@@ -111,8 +148,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 -@@ -233,7 +272,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; -@@ -247,7 +286,7 @@ - if(!getpwuid(getuid())) - die("slock: no passwd entry for you"); - --#ifndef HAVE_BSD_AUTH -+#if !defined(HAVE_BSD_AUTH) && !defined(HAVE_PAM) - pws = getpw(); - #endif - -@@ -273,7 +312,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); Property changes on: slock/files/patch-pam ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: slock/files/patch-slock.c =================================================================== --- slock/files/patch-slock.c (nonexistent) +++ slock/files/patch-slock.c (working copy) @@ -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 + #endif + ++#if HAVE_PAM ++#include ++#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); Property changes on: slock/files/patch-slock.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: slock/pkg-plist =================================================================== --- slock/pkg-plist (revision 409069) +++ slock/pkg-plist (working copy) @@ -1 +1,2 @@ @(,,4755) bin/slock +man/man1/slock.1.gz