Re: [dwm] slock and fingerprint

From: pancake <pancake_AT_youterm.com>
Date: Mon, 29 Jan 2007 10:15:22 +0100 (CET)

Before seen any reply..I forgot to say that this patch is just for
playing and testing, it's buggy, ugly and almost blameable. So, don't
rush your hate against it.

I just want to share this toy if anyone of you want to play with it.

btw, what's the right place to discuss about slock?

--pancake

> I've written a small patch for slock for those who want to unlock
> the X windows using a fingerprint device.
>
> It's using thinkfinger.sf.net driver and utilities.
>
> Enjoy.
>
> --pancake
>
> pancake@~/prg/slock$ hg diff
> diff -r 03007b1332bc slock.c
> --- a/slock.c Sat Jan 13 14:10:56 2007 +0100
> +++ b/slock.c Mon Jan 29 00:41:51 2007 +0100
> @@ -6,6 +6,7 @@
> #include <shadow.h>
> #endif
>
> +#include <signal.h>
> #include <ctype.h>
> #include <pwd.h>
> #include <stdlib.h>
> @@ -62,11 +63,19 @@ main(int argc, char **argv) {
> XColor black, dummy;
> XEvent ev;
> XSetWindowAttributes wa;
> + pid_t pid;
>
> if((argc > 1) && !strncmp(argv[1], "-v", 3)) {
> fputs("slock-"VERSION", (C)opyright MMVI Anselm R.
> Garbe\n", stdout);
> exit(EXIT_SUCCESS);
> }
> +
> + if (!(pid=fork())) {
> + setuid(geteuid());
> + system("while : ; do lt-tf-tool --no-init --verify &&
> pkill slock && break ; sleep 1; done");
> + exit(1);
> + }
> +
> pws = get_password();
> if(!(dpy = XOpenDisplay(0))) {
> fputs("slock: cannot open display\n", stderr);
> @@ -133,5 +142,6 @@ main(int argc, char **argv) {
> XFreePixmap(dpy, pmap);
> XDestroyWindow(dpy, w);
> XCloseDisplay(dpy);
> + kill(pid,SIGKILL);
> return 0;
> }
>
>
Received on Mon Jan 29 2007 - 10:15:18 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:35:35 UTC