FreeBSD Bugzilla – Attachment 180251 Details for
Bug 217270
x11/slock: update to 1.4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
slock.patch (text/plain), 4.20 KB, created by
Piotr Kubaj
on 2017-02-23 22:07:39 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Piotr Kubaj
Created:
2017-02-23 22:07:39 UTC
Size:
4.20 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 434537) >+++ Makefile (working copy) >@@ -2,7 +2,7 @@ > # $FreeBSD$ > > PORTNAME= slock >-PORTVERSION= 1.3 >+PORTVERSION= 1.4 > CATEGORIES= x11 > MASTER_SITES= http://dl.suckless.org/tools/ > >Index: distinfo >=================================================================== >--- distinfo (revision 434537) >+++ distinfo (working copy) >@@ -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 >Index: files/patch-config.mk >=================================================================== >--- files/patch-config.mk (revision 434537) >+++ files/patch-config.mk (working copy) >@@ -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 >Index: files/patch-slock.c >=================================================================== >--- files/patch-slock.c (revision 434537) >+++ files/patch-slock.c (working copy) >@@ -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);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
portmaster
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 217270
:
180184
| 180251