Hello community,
here is the log from the commit of package yast2-fingerprint-reader
checked in at Mon Oct 6 15:56:01 CEST 2008.
--------
--- yast2-fingerprint-reader/yast2-fingerprint-reader.changes 2008-09-29 16:04:21.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-fingerprint-reader/yast2-fingerprint-reader.changes 2008-10-02 13:20:16.175060000 +0200
@@ -1,0 +2,6 @@
+Wed Oct 1 11:53:49 CEST 2008 - jsuchome@suse.cz
+
+- call _exit() to exit the child process, not exit() (bnc#430229)
+- 2.17.3
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-fingerprint-reader-2.17.2.tar.bz2
New:
----
yast2-fingerprint-reader-2.17.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-fingerprint-reader.spec ++++++
--- /var/tmp/diff_new_pack.Nh1760/_old 2008-10-06 15:55:09.000000000 +0200
+++ /var/tmp/diff_new_pack.Nh1760/_new 2008-10-06 15:55:09.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-fingerprint-reader (Version 2.17.2)
+# spec file for package yast2-fingerprint-reader (Version 2.17.3)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-fingerprint-reader
-Version: 2.17.2
+Version: 2.17.3
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-fingerprint-reader-2.17.2.tar.bz2
+Source0: yast2-fingerprint-reader-2.17.3.tar.bz2
Prefix: /usr
Requires: yast2 yast2-pam
BuildRequires: libfprint-devel libfprint0 libusb-devel
@@ -44,7 +44,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-fingerprint-reader-2.17.2
+%setup -n yast2-fingerprint-reader-2.17.3
%build
%{prefix}/bin/y2tool y2autoconf
@@ -80,6 +80,9 @@
%{_libdir}/YaST2/plugin/libpy2ag_fprint.*
%doc %{prefix}/share/doc/packages/yast2-fingerprint-reader
%changelog
+* Wed Oct 01 2008 jsuchome@suse.cz
+- call _exit() to exit the child process, not exit() (bnc#430229)
+- 2.17.3
* Mon Sep 29 2008 jsuchome@suse.cz
- check the values returned by agent (fp_enroll_finger_img) in YCP
- 2.17.2
++++++ yast2-fingerprint-reader-2.17.2.tar.bz2 -> yast2-fingerprint-reader-2.17.3.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.17.2/agent-fprint/src/FPrintAgent.cc new/yast2-fingerprint-reader-2.17.3/agent-fprint/src/FPrintAgent.cc
--- old/yast2-fingerprint-reader-2.17.2/agent-fprint/src/FPrintAgent.cc 2008-09-29 15:49:37.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.3/agent-fprint/src/FPrintAgent.cc 2008-10-02 13:06:41.000000000 +0200
@@ -11,9 +11,11 @@
#define PC(n) (path->component_str(n))
-#define INIT_FAILED 500
-#define SET_FILE_FAILED 600
-#define SET_CALLBACK_FAILED 700
+// error exit values of the child process
+#define INIT_FAILED 200
+#define NO_DEVICES 201
+#define DEVICE_OPEN_FAILED 202
+#define ENROLL_FAILURE 255
/**
@@ -44,20 +46,18 @@
void FPrintAPI::catch_sigterm (int sig_num)
{
instance().finalize ();
- exit (256);
+ _exit (256);
}
// de-initialize finger print reader (must be called at the end!)
void FPrintAPI::finalize ()
{
- y2internal ("finalize");
if (instance().data != NULL)
{
fp_print_data_free (instance().data);
instance().data = NULL;
}
fp_exit();
- y2internal ("finalized");
}
FPrintAPI::FPrintAPI()
@@ -73,80 +73,85 @@
* wrapper for fp_enroll_finger function;
* - we need to take care of the errors and signals
* @param file descriptor of the pipe
- * @param path to the target bir file FIXME
+ * @param path to the temporary directory for storing fingerprints
*/
-int FPrintAPI::acquire (int write_fd, string bir_path)
+int FPrintAPI::acquire (int write_fd, string dir_path)
{
+ // catch the abort signal to make proper cleanup
signal (15, catch_sigterm);
-// FIXME move initialization to separate call, to differentiate betw.ret values
-
struct fp_print_data *enrolled_print = NULL;
int r;
- struct fp_dscv_dev *ddev;
- struct fp_dscv_dev **discovered_devs;
- struct fp_dev *dev;
-
- r = fp_init();
- if (r < 0) {
- y2error("Failed to initialize libfprint\n");
- r = INIT_FAILED;
- write (write_fd, &r, sizeof(int));
- return r;
- }
- discovered_devs = fp_discover_devs();
- if (!discovered_devs) {
- y2error("Could not discover devices\n");
- instance().finalize ();
- r = INIT_FAILED;
- write (write_fd, &r, sizeof(int));
- return r;
- }
-
- ddev = discovered_devs[0];
+ struct fp_dscv_dev *ddev;
+ struct fp_dscv_dev **discovered_devs;
+ struct fp_dev *dev;
+
+ r = fp_init();
+ if (r < 0) {
+ y2error("Failed to initialize libfprint");
+ r = INIT_FAILED;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
+
+ discovered_devs = fp_discover_devs();
+ if (!discovered_devs) {
+ y2error("Could not discover devices");
+ instance().finalize ();
+ r = NO_DEVICES;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
+ ddev = discovered_devs[0];
- if (!ddev) {
- y2error("No devices detected.\n");
- instance().finalize ();
- r = INIT_FAILED;
- write (write_fd, &r, sizeof(int));
- return r;
- }
+ if (!ddev) {
+ y2error("No devices detected.");
+ instance().finalize ();
+ r = NO_DEVICES;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
+ /*
struct fp_driver *drv;
drv = fp_dscv_dev_get_driver(ddev);
y2milestone ("Found device claimed by %s driver",
fp_driver_get_full_name(drv));
+ */
- dev = fp_dev_open(ddev);
- fp_dscv_devs_free(discovered_devs);
- if (!dev) {
- y2error("Could not open device.\n");
- }
+ dev = fp_dev_open(ddev);
+ fp_dscv_devs_free(discovered_devs);
+ if (!dev) {
+ y2error("Could not open device.");
+ instance().finalize ();
+ r = DEVICE_OPEN_FAILED;
+ write (write_fd, &r, sizeof(int));
+ return r;
+ }
- y2milestone("Opened device. It's now time to enroll your finger.\n\n");
+ y2milestone ("Device opened successfully.");
+ /* TODO how to pass the info about stages number to the parent?
y2milestone ("You will need to successfully scan your finger %d times to "
- "complete the process.\n", fp_dev_get_nr_enroll_stages (dev));
+ "complete the process.", fp_dev_get_nr_enroll_stages (dev));
+ */
do {
sleep (1);
- y2internal ("Scan your finger now.");
-
- // FIXME not possible, this is total number of stages
- y2milestone ("remaining stages: %d", fp_dev_get_nr_enroll_stages(dev));
r = fp_enroll_finger (dev, &enrolled_print);
+ y2debug ("retval: %d", r);
+
if (r < 0) {
y2error ("Enroll failed with error %d", r);
instance().finalize ();
signal (15, SIG_DFL);
- return r;
+ return ENROLL_FAILURE;
}
-y2internal ("retval: %d", r);
+
if (write (write_fd, &r, sizeof (int)) == -1)
y2error ("write to pipe failed: %d (%m)", errno);
@@ -159,7 +164,7 @@
y2milestone("Enroll failed, something wen't wrong :(");
instance().finalize ();
signal (15, SIG_DFL);
- return r;
+ return ENROLL_FAILURE;
case FP_ENROLL_PASS:
y2milestone("Enroll stage passed. Yay!");
break;
@@ -179,12 +184,20 @@
} while (r != FP_ENROLL_COMPLETE);
if (!enrolled_print) {
- y2error ("Enroll complete but no print?\n");
+ y2error ("Enroll complete but print is null");
+ r = ENROLL_FAILURE;
}
else {
+ // set the HOME to temporary path we know from argument
+ setenv ("HOME", dir_path.c_str(), 1);
data = enrolled_print;
+ int save_r = fp_print_data_save (data, RIGHT_INDEX);
+ if (save_r < 0)
+ {
+ y2error ("Data save failed with %d", r);
+ r = save_r;
+ }
y2milestone ("Enrollment completed, exiting with %d", r);
- // FIXME save enrolled_print now
}
instance().finalize ();
@@ -235,7 +248,7 @@
}
else if (retval == size) {
if (state == INIT_FAILED ||
- state == SET_FILE_FAILED || state == SET_CALLBACK_FAILED)
+ state == NO_DEVICES || state == DEVICE_OPEN_FAILED)
{
y2warning ("some initialization failed (%d)...", state);
return ret;
@@ -381,7 +394,7 @@
}
else
{
- y2error ("path to bir file is missing");
+ y2error ("path to tmp directory is missing");
return ret;
}
if (pipe (data_pipe) == -1) {
@@ -411,7 +424,7 @@
FPrintAPI::instance().acquire (data_pipe[1], path);
y2milestone ("acquire done with state %d", state);
close (data_pipe[1]);
- exit (state);
+ _exit (state);
}
else // parent -> return
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.17.2/src/users_plugin_fingerprint_reader.ycp new/yast2-fingerprint-reader-2.17.3/src/users_plugin_fingerprint_reader.ycp
--- old/yast2-fingerprint-reader-2.17.2/src/users_plugin_fingerprint_reader.ycp 2008-09-29 15:49:37.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.3/src/users_plugin_fingerprint_reader.ycp 2008-10-02 13:06:41.000000000 +0200
@@ -12,7 +12,7 @@
* Authors:
* Jiri Suchomel
*
- * $Id: users_plugin_fingerprint_reader.ycp 51656 2008-09-29 13:50:29Z jsuchome $
+ * $Id: users_plugin_fingerprint_reader.ycp 51759 2008-10-01 14:10:27Z jsuchome $
*/
{
@@ -60,7 +60,7 @@
y2error ("user name is empty!");
return `back;
}
- string bir_path = Directory::tmpdir + "/" + username + ".bir";
+ string fingerprint_dir = Directory::tmpdir + "/" + username + "/";
term contents = `HBox (`HSpacing (1.5), `VBox(
`VSpacing(0.5),
@@ -117,7 +117,6 @@
}
// helper function, form the string for UI from actuall data
- // FIXME we don't know number of remaining swipes...
void replace_swipe_string () {
UI::ReplaceWidget (`id (`rpstatus), `Label (
@@ -134,61 +133,28 @@
}
- if (SCR::Execute (.fprint.enroll, bir_path) != true)
+ if (SCR::Execute (.fprint.enroll, fingerprint_dir) != true)
{
ui = `cancel;
// status message
UI::ReplaceWidget (`id (`rp),
`Label (_("Initialization of fingerprint reader failed.")));
}
-// FIXME show generic message... the user can enroll finger
+ else
+ status_message (
+ // status label
+ _("Device initialized."),
+ // status message
+ _("Swipe your right index finger."));
+
while (ui != `cancel)
{
map statemap = (map) SCR::Read (.fprint.state);
if (statemap != nil && statemap != $[])
{
integer state = statemap["state"]:0;
-y2security ("state: %1", state);
+ y2milestone ("state: %1", state);
switch (state) {
- /*
- case 8: { // TF_STATE_ACQUIRE_SUCCESS
- UI::ReplaceWidget (`id (`rp),
- // status label
- `Label (_("Storing data...")));
- UI::ReplaceWidget (`id (`rpstatus), `VSpacing ());
- exit = true;
- break;
- }
- case 7: { // TF_STATE_ENROLL_SUCCESS
- UI::ReplaceWidget (`id (`rp),
- // status label
- `Label (_("Storing data...")));
- UI::ReplaceWidget (`id (`rpstatus), `VSpacing ());
- exit = true;
- break;
- }
- case 9: { // TF_STATE_ACQUIRE_FAILED
- UI::ReplaceWidget (`id (`rp),
- `Label (_("Acquiring fingerprint failed.")));
- exit = true;
- break;
- }
- case 2: { // TF_STATE_SWIPE_0
- UI::ReplaceWidget (`id (`rp),
- `Label (_("Please swipe your finger...")));
- break;
- }
- case 5: { // TF_STATE_SWIPE_SUCCESS
- swipe_success = swipe_success + 1;
- replace_swipe_string ();
- break;
- }
- case 6: { // TF_STATE_SWIPE_AFILED
- swipe_failed = swipe_failed + 1;
- replace_swipe_string ();
- break;
- }
- */
case 1: { // FP_ENROLL_COMPLETE
UI::ReplaceWidget (`id (`rp),
// status label
@@ -197,7 +163,7 @@
exit = true;
break;
}
- case 2: { // FP_ENROLL_FAILED ?? FIXME
+ case 2: { // FP_ENROLL_FAILED
status_message (
// status label
_("Scan failed."),
@@ -207,7 +173,7 @@
}
case 3: { // FP_ENROLL_PASS
swipe_success = swipe_success + 1;
-// replace_swipe_string ();
+// replace_swipe_string (); FIXME
status_message (
// status label
@@ -300,7 +266,17 @@
// error message, part 1
string error = _("Could not acquire fingerprint.");
string details = "";
- if (exit_status == 253)
+ // see the error exit values in FPrintAgent.cc
+ if (exit_status == 200)
+ // error message, part 2
+ details = _("Initialization failed.");
+ else if (exit_status == 201)
+ // error message, part 2
+ details = _("No devices detected.");
+ else if (exit_status == 202)
+ // error message, part 2
+ details = _("Device could not be opened.");
+ else if (exit_status == 253)
// error message, part 2
details = _("USB error occured.");
else if (exit_status == 254)
@@ -308,9 +284,7 @@
details = _("Communication with fingerprint reader failed.");
if (exit_status != 256)
{
- UI::ReplaceWidget (`id (`rp), `Label (error));
- if (details != "")
- UI::ReplaceWidget (`id (`rpstatus), `Label (details));
+ status_message (error, details);
}
Wizard::EnableBackButton ();
}
@@ -318,10 +292,9 @@
ret = UI::UserInput ();
if (ret == `next)
{
- // FIXME no bir file can be defined yet FIXME
// modified data to add to user
map tmp_data = $[
- "bir_file" : username,
+ "_fingerprint_dir" : fingerprint_dir, // FIXME save correctly
"plugin_modified" : 1
];
if (data["what"]:"" == "edit_user")
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-fingerprint-reader-2.17.2/VERSION new/yast2-fingerprint-reader-2.17.3/VERSION
--- old/yast2-fingerprint-reader-2.17.2/VERSION 2008-09-29 15:53:13.000000000 +0200
+++ new/yast2-fingerprint-reader-2.17.3/VERSION 2008-10-02 13:08:18.000000000 +0200
@@ -1 +1 @@
-2.17.2
+2.17.3
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org