Update to 0.8.
Diff originally from Gleydson Soares <gsoares at gmail dot com>, who also takes maintainership. Thanks! Tweaks from kili@ (the Makefile nazi) and myself. ok kili@
This commit is contained in:
parent
f2ba44922b
commit
48c639f70b
@ -1,14 +1,14 @@
|
||||
# $OpenBSD: Makefile,v 1.4 2008/01/26 18:48:19 matthieu Exp $
|
||||
# $OpenBSD: Makefile,v 1.5 2008/06/02 20:09:53 wcmaier Exp $
|
||||
|
||||
COMMENT= simple X screen locker
|
||||
|
||||
DISTNAME= slock-0.7
|
||||
DISTNAME= slock-0.8
|
||||
|
||||
CATEGORIES= x11
|
||||
|
||||
HOMEPAGE= http://www.suckless.org/wiki/tools/xlib
|
||||
|
||||
MAINTAINER= Will Maier <willmaier@ml1.net>
|
||||
MAINTAINER= Gleydson Soares <gsoares@gmail.com>
|
||||
|
||||
# BSD
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
@ -16,10 +16,12 @@ PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
WANTLIB= X11 c
|
||||
WANTLIB= X11 c Xext
|
||||
|
||||
MASTER_SITES= http://www.suckless.org/download/
|
||||
|
||||
MAKE_ENV= CC="${CC}" \
|
||||
LDFLAGS="${LDFLAGS}"
|
||||
FAKE_FLAGS= DESTDIR=""
|
||||
|
||||
USE_X11= Yes
|
||||
|
@ -1,5 +1,5 @@
|
||||
MD5 (slock-0.7.tar.gz) = JZ5Z/Xo72xpa1IWOKJxVPQ==
|
||||
RMD160 (slock-0.7.tar.gz) = V2X/oGIauvKHGFE+gRkGlt8oe74=
|
||||
SHA1 (slock-0.7.tar.gz) = NRNV1uCb5zkRnl/WsWBsebW153c=
|
||||
SHA256 (slock-0.7.tar.gz) = YupuOnSAim03Xdc505NqUo5/0wMFDPcC5pcgWlzU5Gw=
|
||||
SIZE (slock-0.7.tar.gz) = 3487
|
||||
MD5 (slock-0.8.tar.gz) = b6buFqmJPsFXA0P+U76AbQ==
|
||||
RMD160 (slock-0.8.tar.gz) = FmYf2iQEHFk/SzBUg0kQPtW/gFQ=
|
||||
SHA1 (slock-0.8.tar.gz) = LmLnHqLx7/VkJyu+MJlDjO5nU+I=
|
||||
SHA256 (slock-0.8.tar.gz) = l548MmosigTqcNQgs07kwBigUs0XduH6Z9dJHMjsa+I=
|
||||
SIZE (slock-0.8.tar.gz) = 3730
|
||||
|
@ -1,14 +1,32 @@
|
||||
$OpenBSD: patch-Makefile,v 1.1 2008/01/26 18:48:19 matthieu Exp $
|
||||
--- Makefile.orig Sat Nov 24 21:18:01 2007
|
||||
+++ Makefile Fri Jan 25 21:46:27 2008
|
||||
@@ -41,9 +41,7 @@
|
||||
$OpenBSD: patch-Makefile,v 1.2 2008/06/02 20:09:53 wcmaier Exp $
|
||||
--- Makefile.orig Thu Mar 13 11:58:47 2008
|
||||
+++ Makefile Mon Jun 2 14:55:45 2008
|
||||
@@ -16,14 +16,12 @@ options:
|
||||
@echo "LD = ${LD}"
|
||||
|
||||
.c.o:
|
||||
- @echo CC $<
|
||||
- @${CC} -c ${CFLAGS} $<
|
||||
+ ${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.mk
|
||||
|
||||
slock: ${OBJ}
|
||||
- @echo LD $@
|
||||
- @${LD} -o $@ ${OBJ} ${LDFLAGS}
|
||||
+ ${LD} -o $@ ${OBJ} ${LDFLAGS}
|
||||
@strip $@
|
||||
|
||||
clean:
|
||||
@@ -40,10 +38,7 @@ dist: clean
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
- @mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
- @cp -f slock ${DESTDIR}${PREFIX}/bin
|
||||
- @chmod 755 ${DESTDIR}${PREFIX}/bin/slock
|
||||
- @chmod u+s ${DESTDIR}${PREFIX}/bin/slock
|
||||
+ @install -c -m ${MODE} -o root -g ${GROUP} slock ${DESTDIR}${PREFIX}/bin
|
||||
+ @${BSD_INSTALL_PROGRAM} slock ${DESTDIR}${PREFIX}/bin
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
|
@ -1,7 +1,7 @@
|
||||
$OpenBSD: patch-config_mk,v 1.2 2008/01/26 18:48:19 matthieu Exp $
|
||||
--- config.mk.orig Fri Jan 25 21:48:50 2008
|
||||
+++ config.mk Fri Jan 25 21:48:38 2008
|
||||
@@ -4,24 +4,29 @@
|
||||
$OpenBSD: patch-config_mk,v 1.3 2008/06/02 20:09:53 wcmaier Exp $
|
||||
--- config.mk.orig Thu Mar 13 11:58:47 2008
|
||||
+++ config.mk Mon Jun 2 14:48:38 2008
|
||||
@@ -4,18 +4,18 @@ VERSION = 0.8
|
||||
# Customize below to fit your system
|
||||
|
||||
# paths
|
||||
@ -15,26 +15,29 @@ $OpenBSD: patch-config_mk,v 1.2 2008/01/26 18:48:19 matthieu Exp $
|
||||
|
||||
# includes and libs
|
||||
-INCS = -I. -I/usr/include -I${X11INC}
|
||||
-LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11
|
||||
-LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext
|
||||
+INCS = -I${X11INC}
|
||||
+LIBS = -L${X11LIB} -lX11
|
||||
+LIBS = -L${X11LIB} -lX11 -lXext
|
||||
|
||||
# flags
|
||||
-CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
|
||||
+CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_BSD_AUTH
|
||||
LDFLAGS = ${LIBS}
|
||||
-CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
|
||||
-LDFLAGS = ${LIBS}
|
||||
+CFLAGS += ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_BSD_AUTH
|
||||
+LDFLAGS += ${LIBS}
|
||||
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" -DHAVE_SHADOW_H
|
||||
#LDFLAGS = -g ${LIBS}
|
||||
|
||||
-# On *BSD remove -DHAVE_SHADOW_H from CFLAGS
|
||||
+# On *BSD remove -DHAVE_SHADOW_H from CFLAGS and add -DHAVE_BSD_AUTH
|
||||
@@ -23,10 +23,10 @@ LDFLAGS = ${LIBS}
|
||||
# On OpenBSD and Darwin remove -lcrypt from LIBS
|
||||
|
||||
# compiler and linker
|
||||
CC = cc
|
||||
-CC = cc
|
||||
+CC ?= cc
|
||||
LD = ${CC}
|
||||
+
|
||||
+# Install mode. On BSD systems MODE=2755 and GROUP=auth
|
||||
+# On others MODE=4755 and GROUP=root
|
||||
|
||||
# Install mode. On BSD systems MODE=2755 and GROUP=auth
|
||||
# On others MODE=4755 and GROUP=root
|
||||
-#MODE=2755
|
||||
-#GROUP=auth
|
||||
+MODE=2755
|
||||
+GROUP=auth
|
||||
|
@ -1,65 +0,0 @@
|
||||
$OpenBSD: patch-slock_c,v 1.1 2008/01/26 18:48:19 matthieu Exp $
|
||||
--- slock.c.orig Sat Nov 24 21:18:01 2007
|
||||
+++ slock.c Fri Jan 25 21:43:05 2008
|
||||
@@ -17,6 +17,11 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
+#if HAVE_BSD_AUTH
|
||||
+#include <login_cap.h>
|
||||
+#include <bsd_auth.h>
|
||||
+#endif
|
||||
+
|
||||
void
|
||||
eprint(const char *errstr, ...) {
|
||||
va_list ap;
|
||||
@@ -27,6 +32,7 @@
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
+#ifndef HAVE_BSD_AUTH
|
||||
const char *
|
||||
get_password() { /* only run as root */
|
||||
const char *rval;
|
||||
@@ -51,13 +57,16 @@
|
||||
eprint("slock: cannot drop privileges\n");
|
||||
return rval;
|
||||
}
|
||||
+#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv) {
|
||||
char curs[] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
char buf[32], passwd[256];
|
||||
int num, screen;
|
||||
+#ifndef HAVE_BSD_AUTH
|
||||
const char *pws;
|
||||
+#endif
|
||||
unsigned int len;
|
||||
Bool running = True;
|
||||
Cursor invisible;
|
||||
@@ -71,7 +80,9 @@
|
||||
|
||||
if((argc > 1) && !strncmp(argv[1], "-v", 3))
|
||||
eprint("slock-"VERSION", © 2006-2007 Anselm R. Garbe, Sander van Dijk\n");
|
||||
+#ifndef HAVE_BSD_AUTH
|
||||
pws = get_password();
|
||||
+#endif
|
||||
if(!(dpy = XOpenDisplay(0)))
|
||||
eprint("slock: cannot open display\n");
|
||||
screen = DefaultScreen(dpy);
|
||||
@@ -118,7 +129,13 @@
|
||||
switch(ksym) {
|
||||
case XK_Return:
|
||||
passwd[len] = 0;
|
||||
- if((running = strcmp(crypt(passwd, pws), pws)) != 0)
|
||||
+#ifndef HAVE_BSD_AUTH
|
||||
+ running = strcmp(crypt(passwd, pws), pws);
|
||||
+#else
|
||||
+ running = !auth_userokay(getlogin(), NULL,
|
||||
+ "auth-xlock", passwd);
|
||||
+#endif
|
||||
+ if (running != 0)
|
||||
XBell(dpy, 100);
|
||||
len = 0;
|
||||
break;
|
Loading…
Reference in New Issue
Block a user