Hello community,
here is the log from the commit of package yast2-fingerprint-reader
checked in at Wed Aug 15 20:40:55 CEST 2007.
--------
--- yast2-fingerprint-reader/yast2-fingerprint-reader.changes 2007-08-01 18:14:34.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-fingerprint-reader/yast2-fingerprint-reader.changes 2007-08-15 12:52:56.370552000 +0200
@@ -1,0 +2,14 @@
+Wed Aug 15 09:12:05 CEST 2007 - jsuchome@suse.cz
+
+- use Pam module to check the status and FingerprintReader.ycp for
+ devices listing
+- mkdir /etc/pam_thinkfinger if not present
+- 2.15.2
+
+-------------------------------------------------------------------
+Tue Aug 14 09:26:55 CEST 2007 - jsuchome@suse.cz
+
+- fixed text in .desktop file, changed icon name
+- 2.15.1
+
+-------------------------------------------------------------------
Old:
----
yast2-fingerprint-reader-2.15.0.tar.bz2
New:
----
yast2-fingerprint-reader-2.15.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-fingerprint-reader.spec ++++++
--- /var/tmp/diff_new_pack.Ve6506/_old 2007-08-15 20:38:45.000000000 +0200
+++ /var/tmp/diff_new_pack.Ve6506/_new 2007-08-15 20:38:45.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-fingerprint-reader (Version 2.15.0)
+# spec file for package yast2-fingerprint-reader (Version 2.15.2)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-fingerprint-reader
-Version: 2.15.0
+Version: 2.15.2
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-fingerprint-reader-2.15.0.tar.bz2
+Source0: yast2-fingerprint-reader-2.15.2.tar.bz2
prefix: /usr
Requires: yast2 yast2-pam
BuildRequires: libthinkfinger libusb-devel
@@ -35,7 +35,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-fingerprint-reader-2.15.0
+%setup -n yast2-fingerprint-reader-2.15.2
%build
%{prefix}/bin/y2tool y2autoconf
@@ -72,6 +72,14 @@
%doc %{prefix}/share/doc/packages/yast2-fingerprint-reader
%changelog
+* Wed Aug 15 2007 - jsuchome@suse.cz
+- use Pam module to check the status and FingerprintReader.ycp for
+ devices listing
+- mkdir /etc/pam_thinkfinger if not present
+- 2.15.2
+* Tue Aug 14 2007 - jsuchome@suse.cz
+- fixed text in .desktop file, changed icon name
+- 2.15.1
* Wed Aug 01 2007 - jsuchome@suse.cz
- feature 301952
- initial dialog with PAM configuration
++++++ yast2-fingerprint-reader-2.15.0.tar.bz2 -> yast2-fingerprint-reader-2.15.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/agent-thinkfinger/src/ThinkFingerAgent.cc new/yast2-fingerprint-reader-2.15.2/agent-thinkfinger/src/ThinkFingerAgent.cc
--- old/yast2-fingerprint-reader-2.15.0/agent-thinkfinger/src/ThinkFingerAgent.cc 2007-07-23 14:41:15.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/agent-thinkfinger/src/ThinkFingerAgent.cc 2007-08-10 14:05:33.000000000 +0200
@@ -20,8 +20,6 @@
int write_fd;
} s_tfdata;
-static bool child_exited = false;
-
/**
* callback function to be called from libthinkfinger_acquire
* @param state current device status
@@ -34,19 +32,12 @@
y2error("write to pipe failed: %d (%m)", errno);
}
-// handler for SIGCHLD signal (child exited)
-static void catch_child_exit (int sig_num)
-{
- child_exited = true;
-}
-
/**
* Constructor
*/
ThinkFingerAgent::ThinkFingerAgent() : SCRAgent()
{
child_pid = -1;
- child_exited = false;
}
/**
@@ -56,6 +47,87 @@
{
}
+// return the only instance of the class
+ThinkFingerAPI& ThinkFingerAPI::instance()
+{
+ static ThinkFingerAPI _instance; // The singleton
+ return _instance;
+}
+
+// handler for SIGTERM signal (it is necessary to kill the process when
+// user his Cancel)
+void ThinkFingerAPI::catch_sigterm (int sig_num)
+{
+ instance().finalize ();
+ exit (256);
+}
+
+// de-initialize finger print reader (must be called at the end!)
+void ThinkFingerAPI::finalize ()
+{
+ if (instance().tf != NULL)
+ {
+ libthinkfinger_free (instance().tf);
+ instance().tf = NULL;
+ }
+}
+
+ThinkFingerAPI::ThinkFingerAPI()
+{
+ tf = NULL;
+}
+
+ThinkFingerAPI::~ThinkFingerAPI ()
+{
+}
+
+/**
+ * wrapper for libthinkfinger_acquire function;
+ * - we need to take care of the errors and signals
+ * @param file descriptor of the pipe
+ * @param path to the target bir file
+ */
+int ThinkFingerAPI::acquire (int write_fd, string bir_path)
+{
+ signal (15, catch_sigterm);
+
+ int retval = 255;
+ s_tfdata tfdata;
+ tfdata.write_fd = write_fd;
+
+ libthinkfinger_init_status init_status;
+ instance().tf = libthinkfinger_new (&init_status);
+ if (init_status != TF_INIT_SUCCESS) {
+ y2error ("libthinkfinger_new failed");
+ instance().finalize ();
+ retval = INIT_FAILED;
+ write (write_fd, &retval, sizeof(libthinkfinger_state));
+ return retval;
+ }
+
+ if (libthinkfinger_set_file (instance().tf, bir_path.c_str ()) < 0)
+ {
+ y2error ("libthinkfinger_set_file failed");
+ instance().finalize ();
+ retval = SET_FILE_FAILED;
+ write (write_fd, &retval, sizeof(libthinkfinger_state));
+ return retval;
+ }
+ if (libthinkfinger_set_callback (instance().tf, callback, &tfdata) < 0)
+ {
+ y2error ("libthinkfinger_set_callback failed");
+ instance().finalize ();
+ retval = SET_CALLBACK_FAILED;
+ write (write_fd, &retval, sizeof(libthinkfinger_state));
+ return retval;
+ }
+ retval = libthinkfinger_acquire (ThinkFingerAPI::instance().tf);
+ y2milestone ("acquire done with state %d", retval);
+ instance().finalize ();
+ signal (15, SIG_DFL);
+ return retval;
+}
+
/**
* Dir
*/
@@ -65,7 +137,6 @@
return YCPNull();
}
-
/**
* Read
*/
@@ -84,12 +155,12 @@
ret = YCPString ("error_message");
}
else if (PC(0) == "state") {
+ YCPMap retmap;
if (!child_pid)
{
y2error ("ThinkFinger not initialized yet!");
return ret;
}
- YCPMap retmap;
int state;
size_t size = sizeof (libthinkfinger_state);
int retval = read (data_pipe[0], &state, size);
@@ -99,18 +170,14 @@
y2error ("error reading from pipe: %d (%m)", errno);
}
else if (retval == size) {
- if (state == SET_FILE_FAILED || state == SET_CALLBACK_FAILED)
+ if (state == INIT_FAILED ||
+ state == SET_FILE_FAILED || state == SET_CALLBACK_FAILED)
{
y2warning ("some initialization failed (%d)...", state);
return ret;
}
retmap->add (YCPString ("state"), YCPInteger (state));
}
- if (child_exited)
- {
- y2warning ("looks like child exited...");
- return ret;
- }
return retmap;
}
// wait for child exit
@@ -118,9 +185,17 @@
y2internal ("waiting for child exit...");
int status;
int retval = 255;
+//FIXME in case of
+//Warning: usb_bulk_read expected to read 0x40 (read 0x34 bytes).
+//child doesn't exit...
wait (&status);
- if (WIFEXITED (status))
+ if (WIFSIGNALED (status))
+ y2milestone ("child process was killed");
+ else if (WIFEXITED (status))
+ {
retval = WEXITSTATUS (status);
+y2milestone ("retval is %d", retval);
+ }
ret = YCPInteger (retval);
close (data_pipe[0]); // close FD for reading
}
@@ -159,7 +234,6 @@
if (child_pid)
kill (child_pid, 15);
child_pid = -1;
- if (tf) libthinkfinger_free (tf);
ret = YCPBoolean (true);
}
/**
@@ -167,14 +241,14 @@
* /tmp/YaST-123-456/hh.bir
*/
else if (PC(0) == "add-user") {
- string bir_path;
+ string path;
if (!val.isNull())
{
- bir_path = val->asString()->value();
+ path = val->asString()->value();
}
else
{
- y2error ("username is missing");
+ y2error ("path to bir file is missing");
return ret;
}
if (pipe (data_pipe) == -1) {
@@ -182,12 +256,6 @@
return ret;
}
- libthinkfinger_init_status init_status;
- tf = libthinkfinger_new (&init_status);
- if (init_status != TF_INIT_SUCCESS) {
- y2error ("libthinkfinger_new failed");
- return ret;
- }
long arg;
arg = fcntl (data_pipe[0], F_GETFL);
if (fcntl (data_pipe[0], F_SETFL, arg | O_NONBLOCK ) < 0)
@@ -197,7 +265,6 @@
close (data_pipe[1]);
return ret;
}
- signal (SIGCHLD, catch_child_exit);
child_pid = fork ();
if (child_pid == -1)
{
@@ -206,40 +273,12 @@
}
else if (child_pid == 0)
{
- // child: call the acquire function, callback gives the
- // actual information to parent
-
close (data_pipe[0]); // close the read-only FD
-
- static int retval = 255;
- s_tfdata tfdata;
- tfdata.write_fd = data_pipe[1];
-
-y2internal ("path is '%s'", bir_path.c_str());
-
- if (libthinkfinger_set_file (tf, bir_path.c_str ()) < 0)
- {
- y2error ("libthinkfinger_set_file failed");
- if (tf) libthinkfinger_free (tf);
- retval = SET_FILE_FAILED;
- write (data_pipe[1], &retval, sizeof(libthinkfinger_state));
- close (data_pipe[1]);
- exit (retval);
- }
- if (libthinkfinger_set_callback (tf, callback, &tfdata) < 0)
- {
- y2error ("libthinkfinger_set_callback failed");
- if (tf) libthinkfinger_free (tf);
- retval = SET_CALLBACK_FAILED;
- write (data_pipe[1], &retval, sizeof(libthinkfinger_state));
- close (data_pipe[1]);
- exit (retval);
- }
- int tf_state = libthinkfinger_acquire (tf);
- y2milestone ("acquire done with state %d", tf_state);
+ int state =
+ ThinkFingerAPI::instance().acquire (data_pipe[1], path);
+ y2milestone ("acquire done with state %d", state);
close (data_pipe[1]);
- if (tf) libthinkfinger_free (tf);
- exit (tf_state);
+ exit (state);
}
else // parent -> return
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/agent-thinkfinger/src/ThinkFingerAgent.h new/yast2-fingerprint-reader-2.15.2/agent-thinkfinger/src/ThinkFingerAgent.h
--- old/yast2-fingerprint-reader-2.15.0/agent-thinkfinger/src/ThinkFingerAgent.h 2007-07-23 14:41:15.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/agent-thinkfinger/src/ThinkFingerAgent.h 2007-08-10 14:05:33.000000000 +0200
@@ -23,22 +23,46 @@
#include <string>
/**
- * @short An interface class between YaST2 and ThinkFinger Agent
+ * The real interface to thinkfinger library
+ * - extra (singleton) class is used to contain signal handler function
*/
-class ThinkFingerAgent : public SCRAgent
+class ThinkFingerAPI
{
+
private:
+ ThinkFingerAPI ();
+
+ virtual ~ThinkFingerAPI();
- /**
- * pid of the child process after fork
- */
- pid_t child_pid;
+public:
+
+ static ThinkFingerAPI & instance();
+
+ static void catch_sigterm (int);
+
+ int acquire (int, string);
+
+ int test_int;
+
+ libthinkfinger *tf;
+
+ void finalize ();
+
+};
+
+/**
+ * @short An interface class between YaST2 and ThinkFinger Agent
+ */
+class ThinkFingerAgent : public SCRAgent
+{
public:
+
/**
* Default constructor.
*/
- ThinkFingerAgent();
+ ThinkFingerAgent ();
+
/**
* Destructor.
@@ -84,7 +108,10 @@
*/
int data_pipe[2];
- libthinkfinger *tf;
+ /**
+ * pid of the child process after fork
+ */
+ pid_t child_pid;
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/src/dialogs.ycp new/yast2-fingerprint-reader-2.15.2/src/dialogs.ycp
--- old/yast2-fingerprint-reader-2.15.0/src/dialogs.ycp 2007-07-31 10:46:35.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/src/dialogs.ycp 2007-08-14 10:57:32.000000000 +0200
@@ -24,7 +24,7 @@
* Summary: Dialogs definitions
* Authors: Jiri Suchomel
*
- * $Id: dialogs.ycp 39828 2007-07-31 08:46:34Z jsuchome $
+ * $Id: dialogs.ycp 40249 2007-08-14 08:57:31Z jsuchome $
*/
{
@@ -116,6 +116,7 @@
Stage::cont () ? Label::BackButton () : Label::CancelButton (),
Stage::cont () ? Label::NextButton () : Label::FinishButton ()
);
+ Wizard::SetTitleIcon ("yast-fingerprint");
if (!Stage::cont ())
Wizard::HideAbortButton ();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/src/fingerprint-reader.desktop new/yast2-fingerprint-reader-2.15.2/src/fingerprint-reader.desktop
--- old/yast2-fingerprint-reader-2.15.0/src/fingerprint-reader.desktop 2007-06-04 11:12:19.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/src/fingerprint-reader.desktop 2007-08-14 08:51:01.000000000 +0200
@@ -8,7 +8,7 @@
X-KDE-Library=yast2
X-SuSE-YaST-Call=fingerprint-reader
-X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Group=Hardware
X-SuSE-YaST-Argument=
X-SuSE-YaST-RootOnly=true
X-SuSE-YaST-AutoInst=
@@ -16,9 +16,9 @@
X-SuSE-YaST-SortKey=
X-SuSE-YaST-AutoInstResource=fingerprint-reader
-Icon=yast-fingerprint-reader
+Icon=yast-fingerprint
Exec=/sbin/yast2 fingerprint-reader
-Name=FingerprintReader
-GenericName=fingerprint-reader
+Name=Fingerprint Reader
+GenericName=Set up fingerprint authentication
X-KDE-SubstituteUID=true
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/src/FingerprintReader.ycp new/yast2-fingerprint-reader-2.15.2/src/FingerprintReader.ycp
--- old/yast2-fingerprint-reader-2.15.0/src/FingerprintReader.ycp 2007-07-31 10:46:35.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/src/FingerprintReader.ycp 2007-08-15 12:39:05.000000000 +0200
@@ -36,6 +36,7 @@
textdomain "fingerprint-reader";
import "Arch";
+import "FileUtils";
import "Pam";
import "Popup";
import "Progress";
@@ -106,7 +107,7 @@
{
// error popup: no config of non-existent device
Report::Error (_("Fingerprint reader device is not available on this system."));
-// return false;
+ return false;
}
use_pam = Pam::Enabled ("thinkfinger");
@@ -160,6 +161,10 @@
Progress::NextStage();
if (use_pam && import_dir != "")
{
+ if (!FileUtils::Exists (bir_dir))
+ {
+ SCR::Execute (.target.mkdir, bir_dir);
+ }
map out = (map) SCR::Execute (.target.bash_output,
sformat ("/bin/cp %1/*.bir %2/", import_dir, bir_dir));
if (out["stderr"]:"" != "")
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/src/UsersPluginFingerprintReader.pm new/yast2-fingerprint-reader-2.15.2/src/UsersPluginFingerprintReader.pm
--- old/yast2-fingerprint-reader-2.15.0/src/UsersPluginFingerprintReader.pm 2007-07-30 12:48:47.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/src/UsersPluginFingerprintReader.pm 2007-08-15 10:26:47.000000000 +0200
@@ -21,6 +21,8 @@
YaST::YCP::Import ("Directory");
YaST::YCP::Import ("FileUtils");
+YaST::YCP::Import ("FingerprintReader");
+YaST::YCP::Import ("Pam");
YaST::YCP::Import ("SCR");
YaST::YCP::Import ("Users");
@@ -61,19 +63,16 @@
}
# helper, check if Fingerprint Reader was already configured
-#FIXME do a pam-config query
sub fingerprint_reader_configured {
- return YaST::YCP::Boolean (1);
+ return Pam->Enabled ("thinkfinger");
}
# helper function: check if Fingerprint Reader (the device) is available
sub is_fingerprint_reader_available {
if (not defined $fingerprint_reader_available) {
- my $probe = SCR->Read (".probe.fingerprint");
- my @devices = ();
- @devices = @{$probe} if (ref $probe eq "ARRAY");
+ my @devices = @{FingerprintReader->ReadFingerprintReaderDevices ()};
$fingerprint_reader_available = (@devices > 0);
}
return $fingerprint_reader_available;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/src/users_plugin_fingerprint_reader.ycp new/yast2-fingerprint-reader-2.15.2/src/users_plugin_fingerprint_reader.ycp
--- old/yast2-fingerprint-reader-2.15.0/src/users_plugin_fingerprint_reader.ycp 2007-07-30 12:59:51.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/src/users_plugin_fingerprint_reader.ycp 2007-08-14 10:57:32.000000000 +0200
@@ -12,7 +12,7 @@
* Authors:
* Jiri Suchomel
*
- * $Id: users_plugin_fingerprint_reader.ycp 39766 2007-07-30 10:59:50Z jsuchome $
+ * $Id: users_plugin_fingerprint_reader.ycp 40249 2007-08-14 08:57:31Z jsuchome $
*/
{
@@ -76,7 +76,7 @@
);
Wizard::CreateDialog ();
- Wizard::SetDesktopIcon("users");
+ Wizard::SetTitleIcon ("yast-fingerprint");
// dialog caption
Wizard::SetContentsButtons(caption, contents, help_text,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.15.0/VERSION new/yast2-fingerprint-reader-2.15.2/VERSION
--- old/yast2-fingerprint-reader-2.15.0/VERSION 2007-06-04 11:12:20.000000000 +0200
+++ new/yast2-fingerprint-reader-2.15.2/VERSION 2007-08-15 09:12:34.000000000 +0200
@@ -1 +1 @@
-2.15.0
+2.15.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org