From owner-svn-ports-head@freebsd.org Thu Feb 25 10:13:30 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE5ACAB31A6; Thu, 25 Feb 2016 10:13:30 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF581A6E; Thu, 25 Feb 2016 10:13:30 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PADT2X088089; Thu, 25 Feb 2016 10:13:29 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PADTL5088084; Thu, 25 Feb 2016 10:13:29 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201602251013.u1PADTL5088084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Thu, 25 Feb 2016 10:13:29 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r409502 - in head/x11/slock: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 10:13:30 -0000 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 (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 + #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); 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