[yast-commit] r39599 - in /trunk/fingerprint-reader/agent-thinkfinger/src: ThinkFingerAgent.cc ThinkFingerAgent.h
Author: jsuchome Date: Mon Jul 23 14:41:01 2007 New Revision: 39599 URL: http://svn.opensuse.org/viewcvs/yast?rev=39599&view=rev Log: get the whole path to bir file from ycp Modified: trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h Modified: trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc?rev=39599&r1=39598&r2=39599&view=diff ============================================================================== --- trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc (original) +++ trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc Mon Jul 23 14:41:01 2007 @@ -105,7 +105,6 @@ return ret; } retmap->add (YCPString ("state"), YCPInteger (state)); -y2internal ("retval from read %d, state is %d", retval, state); } if (child_exited) { @@ -163,11 +162,15 @@ if (tf) libthinkfinger_free (tf); ret = YCPBoolean (true); } + /** + * parameter is whole path to target bir file, e.g. + * /tmp/YaST-123-456/hh.bir + */ else if (PC(0) == "add-user") { - string user; + string bir_path; if (!val.isNull()) { - user = val->asString()->value(); + bir_path = val->asString()->value(); } else { @@ -212,15 +215,9 @@ s_tfdata tfdata; tfdata.write_fd = data_pipe[1]; - string path (PAM_BIRDIR); - path += "/" + user + BIR_EXTENSION; -y2internal ("path is '%s'", path.c_str()); -// 1. create bir.file in tmpdir -// 2. move it (and possible rename) in Write -// 3. remove the old bir file if present in PAM_BIRDIR with org_uid -// (4. but do not remove the new one of added user of the same name!) +y2internal ("path is '%s'", bir_path.c_str()); - if (libthinkfinger_set_file (tf, path.c_str ()) < 0) + if (libthinkfinger_set_file (tf, bir_path.c_str ()) < 0) { y2error ("libthinkfinger_set_file failed"); if (tf) libthinkfinger_free (tf); @@ -241,7 +238,7 @@ int tf_state = libthinkfinger_acquire (tf); y2milestone ("acquire done with state %d", tf_state); close (data_pipe[1]); - libthinkfinger_free (tf); + if (tf) libthinkfinger_free (tf); exit (tf_state); } else // parent -> return Modified: trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h?rev=39599&r1=39598&r2=39599&view=diff ============================================================================== --- trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h (original) +++ trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h Mon Jul 23 14:41:01 2007 @@ -22,11 +22,6 @@ #include <string> -// for testing only... -#define MAX_PATH 256 -#define BIR_EXTENSION ".bir" -#define PAM_BIRDIR "/etc/pam_thinkfinger" - /** * @short An interface class between YaST2 and ThinkFinger Agent */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn.opensuse.org