From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-auth/thinkfinger/files/0.3-tftoolgroup.patch | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sys-auth/thinkfinger/files/0.3-tftoolgroup.patch (limited to 'sys-auth/thinkfinger/files/0.3-tftoolgroup.patch') diff --git a/sys-auth/thinkfinger/files/0.3-tftoolgroup.patch b/sys-auth/thinkfinger/files/0.3-tftoolgroup.patch new file mode 100644 index 000000000000..169b7cefe286 --- /dev/null +++ b/sys-auth/thinkfinger/files/0.3-tftoolgroup.patch @@ -0,0 +1,64 @@ +--- tf-tool/tf-tool.c 2007-03-30 11:00:45.000000000 +0200 ++++ tf-tool/tf-tool.c 2009-02-18 14:57:24.316197097 +0100 +@@ -26,6 +26,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -54,6 +57,21 @@ + int swipe_failed; + } s_tfdata; + ++int changegroup(const char *groupname,const char *filename) ++{ ++ struct group *g; ++ g = getgrnam(groupname); ++ if(g == NULL) { ++ perror("getgrnam:"); ++ return 1; ++ } ++ if( chown(filename,-1,g->gr_gid) == -1) { ++ perror("chown: "); ++ return 1; ++ } ++ return 0; ++} ++ + static void print_status (int swipe_success, int swiped_required, int swipe_failed) + { + printf ("\rPlease swipe your finger (successful swipes %i/%i, failed swipes: %i)...", +@@ -64,6 +82,8 @@ + static void callback (libthinkfinger_state state, void *data) + { + char *str; ++ int err; ++ gid_t gfp; + s_tfdata *tfdata = (s_tfdata *) data; + + if (tfdata->verbose == true) { +@@ -108,8 +128,18 @@ + case TF_STATE_ENROLL_SUCCESS: + print_status (tfdata->swipe_success, 3, tfdata->swipe_failed); + printf (" done.\nStoring data (%s)...", tfdata->bir); +- fflush (stdout); +- break; ++ /*small hack to change group and chmod 640 on created bir file*/ ++ err = chmod(tfdata->bir, S_IRUSR | S_IWUSR | S_IRGRP); ++ if(err == -1) { ++ printf("Couldn't change perms on file %s\n",tfdata->bir); ++ perror("chmod:"); ++ fflush(stdout); ++ break; ++ } ++ changegroup("fingerprint",tfdata->bir); ++ fflush(stdout); ++ break; ++ /*done*/ + case TF_STATE_SWIPE_FAILED: + print_status (tfdata->swipe_success, 3, ++tfdata->swipe_failed); + break; -- cgit v1.2.3